lkml.org 
[lkml]   [2014]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [perf] yet another 32/64-bit range check failure
On Wed, 23 Apr 2014, Peter Zijlstra wrote:
>
> Something like so should do I suppose.
>
> ---
> Subject: 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.
>
> Reported-by: Vince Weaver <vincent.weaver@maine.edu>
> Signed-off-by: Peter Zijlstra <peterz@infradead.org>

Tested-by: Vince Weaver <vincent.weaver@maine.edu>

Your patch fixes the problem, or at least the test I wrote to check the
issue now fails properly.

Oddly, with this patch applied, it's made it a lot harder (but not
impossible) to trigger the memory corruption bug, although that might just
be coincidence.

Vince


\
 
 \ /
  Last update: 2014-04-26 02:01    [W:0.099 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site