]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit9224186529a8aa7a1148cc7e759e65f812906f95
tree95fd3369f0110536c8365e086f7254f4e92d69ec
parentb0073b0d62e552d921370b9489fcb7ed87660a7f
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