lkml.org 
[lkml]   [2014]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 00/18] uaccess: fix sparse warning on get_user for bitwise types
From
On Mon, Dec 15, 2014 at 12:51 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> At the moment, if p and x are both tagged as bitwise types,
> get_user(x, p) produces a sparse warning on many architectures.
> This is because *p on these architectures is loaded into long
> (typically using asm), then cast back to typeof(*p).
>
> When typeof(*p) is a bitwise type (which is uncommon), such a cast needs
> __force, otherwise sparse produces a warning.
>
> Some architectures already have the __force tag, add it
> where it's missing.
>
> Specificlly, vhost wants to read bitwise types from userspace using get_user.
> At the moment this triggers sparse errors, since the value is passed through an
> integer.
>
> For now, I worked around this by converting vhost code to access_ok +
> __get_user, but that's not robust, I'd like to switch to get_user for 3.19.
>
> I tested this on x86 only so far. Since it's just adding __force, should be
> trivially safe everywhere?
>
> Please review, and consider for 3.19.
>
> Who can merge this? Arnd?
Hi Michael

FYI, there is new arch (arch/nios2) in 3.19. Is your patchset include
the fix for it?
Thanks.

Regards
Ley Foon


\
 
 \ /
  Last update: 2014-12-15 11:41    [W:0.273 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site