lkml.org 
[lkml]   [2009]   [Jun]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/4] asm-generic: uaccess: do not expand args multiple times
Date
On Sunday 14 June 2009, Mike Frysinger wrote:
> While it's debatable whether {get,put}_user() should be called with
> arguments that have side effects, macro's should be written safely in the
> first place. In this case, a slightly off version of put_user() ended up
> causing random userspace corruption and these things aren't trivial to
> track down.
>
> While some of these conversions aren't strictly necessary, I think it's
> better to do all of them so as to be proactive in people accidently
> screwing it up in the future.

I've tried this and failed. This change adds an endless number of sparse
warnings in put_user and even gcc warnings in get_user. The problem
is that typeof() carries over the 'const' and '__user' modifiers, both
of which prevent you from assigning data to the new pointer that you
constructed.

I'd love to see a way to do this correctly, but this patch won't cut it.

Arnd <><


\
 
 \ /
  Last update: 2009-06-14 22:17    [W:1.566 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site