diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-16 07:40:44 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-16 08:00:15 -0500 |
commit | f65cb45cba63f249458b669aa67069eabc37b2f5 (patch) | |
tree | 5ebb0ec9a74704e8059e23625179e5e55c4ce016 /fs/exec.c | |
parent | 0cc0c027d4e028632933f1be2dc4cd730358183b (diff) |
perfcounters: flush on setuid exec
Pavel Machek pointed out that performance counters should be flushed
when crossing protection domains on setuid execution.
Reported-by: Pavel Machek <pavel@suse.cz>
Acked-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
35 | #include <linux/pagemap.h> | 35 | #include <linux/pagemap.h> |
36 | #include <linux/perf_counter.h> | ||
36 | #include <linux/highmem.h> | 37 | #include <linux/highmem.h> |
37 | #include <linux/spinlock.h> | 38 | #include <linux/spinlock.h> |
38 | #include <linux/key.h> | 39 | #include <linux/key.h> |
@@ -1017,6 +1018,13 @@ int flush_old_exec(struct linux_binprm * bprm) | |||
1017 | set_dumpable(current->mm, suid_dumpable); | 1018 | set_dumpable(current->mm, suid_dumpable); |
1018 | } | 1019 | } |
1019 | 1020 | ||
1021 | /* | ||
1022 | * Flush performance counters when crossing a | ||
1023 | * security domain: | ||
1024 | */ | ||
1025 | if (!get_dumpable(current->mm)) | ||
1026 | perf_counter_exit_task(current); | ||
1027 | |||
1020 | /* An exec changes our domain. We are no longer part of the thread | 1028 | /* An exec changes our domain. We are no longer part of the thread |
1021 | group */ | 1029 | group */ |
1022 | 1030 | ||