diff options
| author | Eugene Syromiatnikov <esyr@redhat.com> | 2018-05-21 08:34:20 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2018-05-25 02:11:11 -0400 |
| commit | 82489c5fe5f99ca95f708fecae9f2c8aa99398bb (patch) | |
| tree | 4d51b54bc8885bfad3feb2888dc5c4f298d9d6e3 | |
| parent | 9511bce9fe8e5e6c0f923c09243a713eba560141 (diff) | |
perf/core: Wire up compat PERF_EVENT_IOC_QUERY_BPF, PERF_EVENT_IOC_MODIFY_ATTRIBUTES
Since pointer size is different in compat, and switching in _perf_ioctl
is done using exact ioctl numbers, all new ioctl numbers that use pointer
should be added to perf_compat_ioctl for _IOC_SIZE fixup before passing
to perf_ioctl routine (this shouldn't be needed if semantics of the size
argument of _IO* macros was honored).
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Link: http://lkml.kernel.org/r/20180521123420.GA24291@asgard.redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
| -rw-r--r-- | kernel/events/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 24dea13a27ed..08f5e1b42b43 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -5120,6 +5120,8 @@ static long perf_compat_ioctl(struct file *file, unsigned int cmd, | |||
| 5120 | switch (_IOC_NR(cmd)) { | 5120 | switch (_IOC_NR(cmd)) { |
| 5121 | case _IOC_NR(PERF_EVENT_IOC_SET_FILTER): | 5121 | case _IOC_NR(PERF_EVENT_IOC_SET_FILTER): |
| 5122 | case _IOC_NR(PERF_EVENT_IOC_ID): | 5122 | case _IOC_NR(PERF_EVENT_IOC_ID): |
| 5123 | case _IOC_NR(PERF_EVENT_IOC_QUERY_BPF): | ||
| 5124 | case _IOC_NR(PERF_EVENT_IOC_MODIFY_ATTRIBUTES): | ||
| 5123 | /* Fix up pointer size (usually 4 -> 8 in 32-on-64-bit case */ | 5125 | /* Fix up pointer size (usually 4 -> 8 in 32-on-64-bit case */ |
| 5124 | if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) { | 5126 | if (_IOC_SIZE(cmd) == sizeof(compat_uptr_t)) { |
| 5125 | cmd &= ~IOCSIZE_MASK; | 5127 | cmd &= ~IOCSIZE_MASK; |
