From e16426e0d815b5a85389d65a4b4bce81327ed985 Mon Sep 17 00:00:00 2001 From: Akira Takeuchi Date: Fri, 28 Jun 2013 16:53:01 +0100 Subject: [PATCH] --- yaml --- r: 377457 b: refs/heads/master c: c6dc9f0a4eeb7c014904475372c66e6d0ac5a572 h: refs/heads/master i: 377455: b2929ce553c59cef8b47c4e1258698494660ede1 v: v3 --- [refs] | 2 +- trunk/arch/mn10300/include/asm/uaccess.h | 2 +- trunk/fs/exec.c | 16 +++++++--------- trunk/kernel/time/tick-broadcast.c | 7 ++----- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index aa426aaea2ea..428b52fb606a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a75930c6332f39bfe05059259e13cdee54933f9f +refs/heads/master: c6dc9f0a4eeb7c014904475372c66e6d0ac5a572 diff --git a/trunk/arch/mn10300/include/asm/uaccess.h b/trunk/arch/mn10300/include/asm/uaccess.h index 780560b330d9..d7966e0f7698 100644 --- a/trunk/arch/mn10300/include/asm/uaccess.h +++ b/trunk/arch/mn10300/include/asm/uaccess.h @@ -161,7 +161,7 @@ struct __large_struct { unsigned long buf[100]; }; #define __get_user_check(x, ptr, size) \ ({ \ - const __typeof__(ptr) __guc_ptr = (ptr); \ + const __typeof__(*(ptr))* __guc_ptr = (ptr); \ int _e; \ if (likely(__access_ok((unsigned long) __guc_ptr, (size)))) \ _e = __get_user_nocheck((x), __guc_ptr, (size)); \ diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index ffd7a813ad3d..643019585574 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -1135,6 +1135,13 @@ void setup_new_exec(struct linux_binprm * bprm) set_dumpable(current->mm, suid_dumpable); } + /* + * Flush performance counters when crossing a + * security domain: + */ + if (!get_dumpable(current->mm)) + perf_event_exit_task(current); + /* An exec changes our domain. We are no longer part of the thread group */ @@ -1198,15 +1205,6 @@ void install_exec_creds(struct linux_binprm *bprm) commit_creds(bprm->cred); bprm->cred = NULL; - - /* - * Disable monitoring for regular users - * when executing setuid binaries. Must - * wait until new credentials are committed - * by commit_creds() above - */ - if (get_dumpable(current->mm) != SUID_DUMP_USER) - perf_event_exit_task(current); /* * cred_guard_mutex must be held at least to this point to prevent * ptrace_attach() from altering our determination of the task's diff --git a/trunk/kernel/time/tick-broadcast.c b/trunk/kernel/time/tick-broadcast.c index 20d6fba70652..b4c245580b79 100644 --- a/trunk/kernel/time/tick-broadcast.c +++ b/trunk/kernel/time/tick-broadcast.c @@ -599,6 +599,8 @@ void tick_broadcast_oneshot_control(unsigned long reason) } else { if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) { clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT); + if (dev->next_event.tv64 == KTIME_MAX) + goto out; /* * The cpu which was handling the broadcast * timer marked this cpu in the broadcast @@ -612,11 +614,6 @@ void tick_broadcast_oneshot_control(unsigned long reason) tick_broadcast_pending_mask)) goto out; - /* - * Bail out if there is no next event. - */ - if (dev->next_event.tv64 == KTIME_MAX) - goto out; /* * If the pending bit is not set, then we are * either the CPU handling the broadcast