perf: Fix perf_event_open(.flags) test
authorPeter Zijlstra <peterz@infradead.org>
Wed, 23 Apr 2014 10:22:54 +0000 (12:22 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Mon, 19 May 2014 12:52:59 +0000 (21:52 +0900)
commit643fd0b9f5dc40fedbfbb908ebe6f1169284f7d8
tree95fd3369f0110536c8365e086f7254f4e92d69ec
parent12665b35b0b48c9583ee1b8f0a403dc708fb4a92
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>
include/uapi/linux/perf_event.h