Merge branch 'master' into next
Conflicts: fs/exec.c Removed IMA changes (the IMA checks are now performed via may_open()). Signed-off-by: James Morris <jmorris@namei.org>
This commit is contained in:
@@ -1133,8 +1133,7 @@ static int cgroup_get_sb(struct file_system_type *fs_type,
|
||||
free_cg_links:
|
||||
free_cg_links(&tmp_cg_links);
|
||||
drop_new_super:
|
||||
up_write(&sb->s_umount);
|
||||
deactivate_super(sb);
|
||||
deactivate_locked_super(sb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@@ -193,6 +193,7 @@ static void drop_futex_key_refs(union futex_key *key)
|
||||
* @uaddr: virtual address of the futex
|
||||
* @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED
|
||||
* @key: address where result is stored.
|
||||
* @rw: mapping needs to be read/write (values: VERIFY_READ, VERIFY_WRITE)
|
||||
*
|
||||
* Returns a negative error code or 0
|
||||
* The key words are stored in *key on success.
|
||||
@@ -203,7 +204,8 @@ static void drop_futex_key_refs(union futex_key *key)
|
||||
*
|
||||
* lock_page() might sleep, the caller should not hold a spinlock.
|
||||
*/
|
||||
static int get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key)
|
||||
static int
|
||||
get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)
|
||||
{
|
||||
unsigned long address = (unsigned long)uaddr;
|
||||
struct mm_struct *mm = current->mm;
|
||||
@@ -226,7 +228,7 @@ static int get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key)
|
||||
* but access_ok() should be faster than find_vma()
|
||||
*/
|
||||
if (!fshared) {
|
||||
if (unlikely(!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))))
|
||||
if (unlikely(!access_ok(rw, uaddr, sizeof(u32))))
|
||||
return -EFAULT;
|
||||
key->private.mm = mm;
|
||||
key->private.address = address;
|
||||
@@ -235,7 +237,7 @@ static int get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key)
|
||||
}
|
||||
|
||||
again:
|
||||
err = get_user_pages_fast(address, 1, 0, &page);
|
||||
err = get_user_pages_fast(address, 1, rw == VERIFY_WRITE, &page);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -677,7 +679,7 @@ static int futex_wake(u32 __user *uaddr, int fshared, int nr_wake, u32 bitset)
|
||||
if (!bitset)
|
||||
return -EINVAL;
|
||||
|
||||
ret = get_futex_key(uaddr, fshared, &key);
|
||||
ret = get_futex_key(uaddr, fshared, &key, VERIFY_READ);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
|
||||
@@ -723,10 +725,10 @@ futex_wake_op(u32 __user *uaddr1, int fshared, u32 __user *uaddr2,
|
||||
int ret, op_ret;
|
||||
|
||||
retry:
|
||||
ret = get_futex_key(uaddr1, fshared, &key1);
|
||||
ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
ret = get_futex_key(uaddr2, fshared, &key2);
|
||||
ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_WRITE);
|
||||
if (unlikely(ret != 0))
|
||||
goto out_put_key1;
|
||||
|
||||
@@ -814,10 +816,10 @@ static int futex_requeue(u32 __user *uaddr1, int fshared, u32 __user *uaddr2,
|
||||
int ret, drop_count = 0;
|
||||
|
||||
retry:
|
||||
ret = get_futex_key(uaddr1, fshared, &key1);
|
||||
ret = get_futex_key(uaddr1, fshared, &key1, VERIFY_READ);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
ret = get_futex_key(uaddr2, fshared, &key2);
|
||||
ret = get_futex_key(uaddr2, fshared, &key2, VERIFY_READ);
|
||||
if (unlikely(ret != 0))
|
||||
goto out_put_key1;
|
||||
|
||||
@@ -1140,7 +1142,7 @@ static int futex_wait(u32 __user *uaddr, int fshared,
|
||||
q.bitset = bitset;
|
||||
retry:
|
||||
q.key = FUTEX_KEY_INIT;
|
||||
ret = get_futex_key(uaddr, fshared, &q.key);
|
||||
ret = get_futex_key(uaddr, fshared, &q.key, VERIFY_READ);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
|
||||
@@ -1330,7 +1332,7 @@ static int futex_lock_pi(u32 __user *uaddr, int fshared,
|
||||
q.pi_state = NULL;
|
||||
retry:
|
||||
q.key = FUTEX_KEY_INIT;
|
||||
ret = get_futex_key(uaddr, fshared, &q.key);
|
||||
ret = get_futex_key(uaddr, fshared, &q.key, VERIFY_WRITE);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
|
||||
@@ -1594,7 +1596,7 @@ retry:
|
||||
if ((uval & FUTEX_TID_MASK) != task_pid_vnr(current))
|
||||
return -EPERM;
|
||||
|
||||
ret = get_futex_key(uaddr, fshared, &key);
|
||||
ret = get_futex_key(uaddr, fshared, &key, VERIFY_WRITE);
|
||||
if (unlikely(ret != 0))
|
||||
goto out;
|
||||
|
||||
|
@@ -1583,8 +1583,8 @@ static void sysrq_handle_gdb(int key, struct tty_struct *tty)
|
||||
|
||||
static struct sysrq_key_op sysrq_gdb_op = {
|
||||
.handler = sysrq_handle_gdb,
|
||||
.help_msg = "Gdb",
|
||||
.action_msg = "GDB",
|
||||
.help_msg = "debug(G)",
|
||||
.action_msg = "DEBUG",
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@@ -319,6 +319,22 @@ struct kprobe __kprobes *get_kprobe(void *addr)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Arm a kprobe with text_mutex */
|
||||
static void __kprobes arm_kprobe(struct kprobe *kp)
|
||||
{
|
||||
mutex_lock(&text_mutex);
|
||||
arch_arm_kprobe(kp);
|
||||
mutex_unlock(&text_mutex);
|
||||
}
|
||||
|
||||
/* Disarm a kprobe with text_mutex */
|
||||
static void __kprobes disarm_kprobe(struct kprobe *kp)
|
||||
{
|
||||
mutex_lock(&text_mutex);
|
||||
arch_disarm_kprobe(kp);
|
||||
mutex_unlock(&text_mutex);
|
||||
}
|
||||
|
||||
/*
|
||||
* Aggregate handlers for multiple kprobes support - these handlers
|
||||
* take care of invoking the individual kprobe handlers on p->list
|
||||
@@ -538,7 +554,7 @@ static int __kprobes add_new_kprobe(struct kprobe *ap, struct kprobe *p)
|
||||
ap->flags &= ~KPROBE_FLAG_DISABLED;
|
||||
if (!kprobes_all_disarmed)
|
||||
/* Arm the breakpoint again. */
|
||||
arch_arm_kprobe(ap);
|
||||
arm_kprobe(ap);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -789,11 +805,8 @@ static int __kprobes __unregister_kprobe_top(struct kprobe *p)
|
||||
* enabled and not gone - otherwise, the breakpoint would
|
||||
* already have been removed. We save on flushing icache.
|
||||
*/
|
||||
if (!kprobes_all_disarmed && !kprobe_disabled(old_p)) {
|
||||
mutex_lock(&text_mutex);
|
||||
arch_disarm_kprobe(p);
|
||||
mutex_unlock(&text_mutex);
|
||||
}
|
||||
if (!kprobes_all_disarmed && !kprobe_disabled(old_p))
|
||||
disarm_kprobe(p);
|
||||
hlist_del_rcu(&old_p->hlist);
|
||||
} else {
|
||||
if (p->break_handler && !kprobe_gone(p))
|
||||
@@ -810,7 +823,7 @@ noclean:
|
||||
if (!kprobe_disabled(old_p)) {
|
||||
try_to_disable_aggr_kprobe(old_p);
|
||||
if (!kprobes_all_disarmed && kprobe_disabled(old_p))
|
||||
arch_disarm_kprobe(old_p);
|
||||
disarm_kprobe(old_p);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -1364,7 +1377,7 @@ int __kprobes disable_kprobe(struct kprobe *kp)
|
||||
try_to_disable_aggr_kprobe(p);
|
||||
|
||||
if (!kprobes_all_disarmed && kprobe_disabled(p))
|
||||
arch_disarm_kprobe(p);
|
||||
disarm_kprobe(p);
|
||||
out:
|
||||
mutex_unlock(&kprobe_mutex);
|
||||
return ret;
|
||||
@@ -1393,7 +1406,7 @@ int __kprobes enable_kprobe(struct kprobe *kp)
|
||||
}
|
||||
|
||||
if (!kprobes_all_disarmed && kprobe_disabled(p))
|
||||
arch_arm_kprobe(p);
|
||||
arm_kprobe(p);
|
||||
|
||||
p->flags &= ~KPROBE_FLAG_DISABLED;
|
||||
if (p != kp)
|
||||
|
@@ -54,9 +54,9 @@ enum {
|
||||
* table (if it's not there yet), and we check it for lock order
|
||||
* conflicts and deadlocks.
|
||||
*/
|
||||
#define MAX_LOCKDEP_ENTRIES 8192UL
|
||||
#define MAX_LOCKDEP_ENTRIES 16384UL
|
||||
|
||||
#define MAX_LOCKDEP_CHAINS_BITS 14
|
||||
#define MAX_LOCKDEP_CHAINS_BITS 15
|
||||
#define MAX_LOCKDEP_CHAINS (1UL << MAX_LOCKDEP_CHAINS_BITS)
|
||||
|
||||
#define MAX_LOCKDEP_CHAIN_HLOCKS (MAX_LOCKDEP_CHAINS*5)
|
||||
|
@@ -340,39 +340,44 @@ void oops_exit(void)
|
||||
}
|
||||
|
||||
#ifdef WANT_WARN_ON_SLOWPATH
|
||||
void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
|
||||
{
|
||||
struct slowpath_args {
|
||||
const char *fmt;
|
||||
va_list args;
|
||||
char function[KSYM_SYMBOL_LEN];
|
||||
unsigned long caller = (unsigned long)__builtin_return_address(0);
|
||||
};
|
||||
|
||||
static void warn_slowpath_common(const char *file, int line, void *caller, struct slowpath_args *args)
|
||||
{
|
||||
const char *board;
|
||||
|
||||
sprint_symbol(function, caller);
|
||||
|
||||
printk(KERN_WARNING "------------[ cut here ]------------\n");
|
||||
printk(KERN_WARNING "WARNING: at %s:%d %s()\n", file,
|
||||
line, function);
|
||||
printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
|
||||
board = dmi_get_system_info(DMI_PRODUCT_NAME);
|
||||
if (board)
|
||||
printk(KERN_WARNING "Hardware name: %s\n", board);
|
||||
|
||||
if (*fmt) {
|
||||
va_start(args, fmt);
|
||||
vprintk(fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (args)
|
||||
vprintk(args->fmt, args->args);
|
||||
|
||||
print_modules();
|
||||
dump_stack();
|
||||
print_oops_end_marker();
|
||||
add_taint(TAINT_WARN);
|
||||
}
|
||||
|
||||
void warn_slowpath_fmt(const char *file, int line, const char *fmt, ...)
|
||||
{
|
||||
struct slowpath_args args;
|
||||
|
||||
args.fmt = fmt;
|
||||
va_start(args.args, fmt);
|
||||
warn_slowpath_common(file, line, __builtin_return_address(0), &args);
|
||||
va_end(args.args);
|
||||
}
|
||||
EXPORT_SYMBOL(warn_slowpath_fmt);
|
||||
|
||||
void warn_slowpath_null(const char *file, int line)
|
||||
{
|
||||
static const char *empty = "";
|
||||
warn_slowpath_fmt(file, line, empty);
|
||||
warn_slowpath_common(file, line, __builtin_return_address(0), NULL);
|
||||
}
|
||||
EXPORT_SYMBOL(warn_slowpath_null);
|
||||
#endif
|
||||
|
@@ -241,9 +241,9 @@ static int create_image(int platform_mode)
|
||||
|
||||
local_irq_disable();
|
||||
|
||||
sysdev_suspend(PMSG_FREEZE);
|
||||
error = sysdev_suspend(PMSG_FREEZE);
|
||||
if (error) {
|
||||
printk(KERN_ERR "PM: Some devices failed to power down, "
|
||||
printk(KERN_ERR "PM: Some system devices failed to power down, "
|
||||
"aborting hibernation\n");
|
||||
goto Enable_irqs;
|
||||
}
|
||||
|
@@ -38,7 +38,8 @@
|
||||
*/
|
||||
unsigned long long __attribute__((weak)) sched_clock(void)
|
||||
{
|
||||
return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ);
|
||||
return (unsigned long long)(jiffies - INITIAL_JIFFIES)
|
||||
* (NSEC_PER_SEC / HZ);
|
||||
}
|
||||
|
||||
static __read_mostly int sched_clock_running;
|
||||
|
@@ -101,7 +101,6 @@ static int __maybe_unused one = 1;
|
||||
static int __maybe_unused two = 2;
|
||||
static unsigned long one_ul = 1;
|
||||
static int one_hundred = 100;
|
||||
static int one_thousand = 1000;
|
||||
|
||||
/* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */
|
||||
static unsigned long dirty_bytes_min = 2 * PAGE_SIZE;
|
||||
@@ -1045,28 +1044,6 @@ static struct ctl_table vm_table[] = {
|
||||
.mode = 0444 /* read-only*/,
|
||||
.proc_handler = &proc_dointvec,
|
||||
},
|
||||
{
|
||||
.ctl_name = CTL_UNNUMBERED,
|
||||
.procname = "nr_pdflush_threads_min",
|
||||
.data = &nr_pdflush_threads_min,
|
||||
.maxlen = sizeof nr_pdflush_threads_min,
|
||||
.mode = 0644 /* read-write */,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &one,
|
||||
.extra2 = &nr_pdflush_threads_max,
|
||||
},
|
||||
{
|
||||
.ctl_name = CTL_UNNUMBERED,
|
||||
.procname = "nr_pdflush_threads_max",
|
||||
.data = &nr_pdflush_threads_max,
|
||||
.maxlen = sizeof nr_pdflush_threads_max,
|
||||
.mode = 0644 /* read-write */,
|
||||
.proc_handler = &proc_dointvec_minmax,
|
||||
.strategy = &sysctl_intvec,
|
||||
.extra1 = &nr_pdflush_threads_min,
|
||||
.extra2 = &one_thousand,
|
||||
},
|
||||
{
|
||||
.ctl_name = VM_SWAPPINESS,
|
||||
.procname = "swappiness",
|
||||
|
@@ -2380,7 +2380,7 @@ static const char readme_msg[] =
|
||||
"# echo print-parent > /debug/tracing/trace_options\n"
|
||||
"# echo 1 > /debug/tracing/tracing_enabled\n"
|
||||
"# cat /debug/tracing/trace > /tmp/trace.txt\n"
|
||||
"echo 0 > /debug/tracing/tracing_enabled\n"
|
||||
"# echo 0 > /debug/tracing/tracing_enabled\n"
|
||||
;
|
||||
|
||||
static ssize_t
|
||||
|
Reference in New Issue
Block a user