aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2014-04-23 06:22:54 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-05-19 08:52:59 -0400
commit643fd0b9f5dc40fedbfbb908ebe6f1169284f7d8 (patch)
tree95fd3369f0110536c8365e086f7254f4e92d69ec
parent12665b35b0b48c9583ee1b8f0a403dc708fb4a92 (diff)
perf: Fix perf_event_open(.flags) test
Vince noticed that we test the (unsigned long) flags field against an (unsigned int) constant. This would allow setting the high bits on 64bit platforms and not get an error. There is nothing that uses the high bits, so it should be entirely harmless, but we don't want userspace to accidentally set them anyway, so fix the constants. Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Reported-by: Vince Weaver <vincent.weaver@maine.edu> Tested-by: Vince Weaver <vincent.weaver@maine.edu> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20140423102254.GL11096@twins.programming.kicks-ass.net Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/uapi/linux/perf_event.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 853bc1ccb395..e3fc8f09d110 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -722,10 +722,10 @@ enum perf_callchain_context {
722 PERF_CONTEXT_MAX = (__u64)-4095, 722 PERF_CONTEXT_MAX = (__u64)-4095,
723}; 723};
724 724
725#define PERF_FLAG_FD_NO_GROUP (1U << 0) 725#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
726#define PERF_FLAG_FD_OUTPUT (1U << 1) 726#define PERF_FLAG_FD_OUTPUT (1UL << 1)
727#define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ 727#define PERF_FLAG_PID_CGROUP (1UL << 2) /* pid=cgroup id, per-cpu mode only */
728#define PERF_FLAG_FD_CLOEXEC (1U << 3) /* O_CLOEXEC */ 728#define PERF_FLAG_FD_CLOEXEC (1UL << 3) /* O_CLOEXEC */
729 729
730union perf_mem_data_src { 730union perf_mem_data_src {
731 __u64 val; 731 __u64 val;