[lkml]   [2019]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 12/26] compat_ioctl: move more drivers to compat_ptr_ioctl
Em Thu, 25 Apr 2019 16:35:34 +0100
Al Viro <> escreveu:

> On Thu, Apr 25, 2019 at 12:21:53PM -0300, Mauro Carvalho Chehab wrote:
> > If I understand your patch description well, using compat_ptr_ioctl
> > only works if the driver is not for s390, right?
> No; s390 is where "oh, just set ->compat_ioctl same as ->unlocked_ioctl
> and be done with that; compat_ptr() is a no-op anyway" breaks. IOW,
> s390 is the reason for having compat_ptr_ioctl() in the first place;
> that thing works on all biarch architectures, as long as all stuff
> handled by ->ioctl() takes pointer to arch-independent object as
> argument. IOW,
> argument ignored => OK
> any arithmetical type => no go, compat_ptr() would bugger it
> pointer to int => OK

That's the case for all LIRC ioctls: they all use a pointer to u32

> pointer to string => OK
> pointer to u64 => OK
> pointer to struct {u64 addr; char s[11];} => OK
> pointer to long => needs explicit handler
> pointer to struct {void *addr; char s[11];} => needs explicit handler
> pointer to struct {int x; u64 y;} => needs explicit handler on amd64
> For "just use ->unlocked_ioctl for ->ioctl" we have
> argument ignored => OK
> any arithmetical type => OK
> any pointer => instant breakage on s390, in addtion to cases that break
> with compat_ptr_ioctl().
> Probably some form of that ought to go into commit message for compat_ptr_ioctl()
> introduction...



 \ /
  Last update: 2019-04-25 17:54    [W:0.087 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site