diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/exec.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/exec.c b/fs/exec.c index 71a6efe5d8b..605be573fe8 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -33,6 +33,7 @@ #include <linux/string.h> #include <linux/init.h> #include <linux/pagemap.h> +#include <linux/perf_counter.h> #include <linux/highmem.h> #include <linux/spinlock.h> #include <linux/key.h> @@ -1010,6 +1011,13 @@ int flush_old_exec(struct linux_binprm * bprm) current->personality &= ~bprm->per_clear; + /* + * Flush performance counters when crossing a + * security domain: + */ + if (!get_dumpable(current->mm)) + perf_counter_exit_task(current); + /* An exec changes our domain. We are no longer part of the thread group */ |