From 5eed688fdcaa34c4e8086336e1c4f931d65a4a88 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 29 Jun 2013 10:28:52 -0700 Subject: [PATCH] --- yaml --- r: 377459 b: refs/heads/master c: a61aef7fc00bac9068e98bf00aaa38e766f19a57 h: refs/heads/master i: 377457: e16426e0d815b5a85389d65a4b4bce81327ed985 377455: b2929ce553c59cef8b47c4e1258698494660ede1 v: v3 --- [refs] | 2 +- trunk/fs/exec.c | 16 +++++++++------- trunk/kernel/time/tick-broadcast.c | 7 +++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index c768f0a2bb7b..27932ba0f428 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e3f12a53042e26202993baa3ad4ff8768173653d +refs/heads/master: a61aef7fc00bac9068e98bf00aaa38e766f19a57 diff --git a/trunk/fs/exec.c b/trunk/fs/exec.c index 643019585574..ffd7a813ad3d 100644 --- a/trunk/fs/exec.c +++ b/trunk/fs/exec.c @@ -1135,13 +1135,6 @@ 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 */ @@ -1205,6 +1198,15 @@ 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 b4c245580b79..20d6fba70652 100644 --- a/trunk/kernel/time/tick-broadcast.c +++ b/trunk/kernel/time/tick-broadcast.c @@ -599,8 +599,6 @@ 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 @@ -614,6 +612,11 @@ 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