diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-24 19:16:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-24 19:16:55 -0400 |
commit | 44744bb344abe032b387d361209038d2956e8c75 (patch) | |
tree | e5b4eec5a313c9ee9b7b0f22ce3ba77970ea17e0 /kernel/events | |
parent | 959dc2587d69f77af9de63199bd2dc468a736595 (diff) | |
parent | b3f207855f57b9c8f43a547a801340bb5cbc59e5 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar:
"A kprobes and a perf compat ioctl fix"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf: Handle compat ioctl
kprobes: Skip kretprobe hit in NMI context to avoid deadlock
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 1cf24b3e42ec..f9c1ed002dbc 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/cgroup.h> | 41 | #include <linux/cgroup.h> |
42 | #include <linux/module.h> | 42 | #include <linux/module.h> |
43 | #include <linux/mman.h> | 43 | #include <linux/mman.h> |
44 | #include <linux/compat.h> | ||
44 | 45 | ||
45 | #include "internal.h" | 46 | #include "internal.h" |
46 | 47 | ||
@@ -3717,6 +3718,26 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
3717 | return 0; | 3718 | return 0; |
3718 | } | 3719 | } |
3719 | 3720 | ||
3721 | #ifdef CONFIG_COMPAT | ||
3722 | static long perf_compat_ioctl(struct file *file, unsigned int cmd, | ||
3723 | unsigned long arg) | ||
3724 | { | ||
3725 | switch (_IOC_NR(cmd)) { | ||
3726 | case _IOC_NR(PERF_EVENT_IOC_SET_FILTER): | ||
3727 | case _IOC_NR(PERF_EVENT_IOC_ID): | ||
3728 | /* Fix up pointer size (usually 4 -> 8 in 32-on-64-bit case */ | ||
3729 | if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) { | ||
3730 | cmd &= ~IOCSIZE_MASK; | ||
3731 | cmd |= sizeof(void *) << IOCSIZE_SHIFT; | ||
3732 | } | ||
3733 | break; | ||
3734 | } | ||
3735 | return perf_ioctl(file, cmd, arg); | ||
3736 | } | ||
3737 | #else | ||
3738 | # define perf_compat_ioctl NULL | ||
3739 | #endif | ||
3740 | |||
3720 | int perf_event_task_enable(void) | 3741 | int perf_event_task_enable(void) |
3721 | { | 3742 | { |
3722 | struct perf_event *event; | 3743 | struct perf_event *event; |
@@ -4222,7 +4243,7 @@ static const struct file_operations perf_fops = { | |||
4222 | .read = perf_read, | 4243 | .read = perf_read, |
4223 | .poll = perf_poll, | 4244 | .poll = perf_poll, |
4224 | .unlocked_ioctl = perf_ioctl, | 4245 | .unlocked_ioctl = perf_ioctl, |
4225 | .compat_ioctl = perf_ioctl, | 4246 | .compat_ioctl = perf_compat_ioctl, |
4226 | .mmap = perf_mmap, | 4247 | .mmap = perf_mmap, |
4227 | .fasync = perf_fasync, | 4248 | .fasync = perf_fasync, |
4228 | }; | 4249 | }; |