lkml.org 
[lkml]   [2009]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: is avoiding compat ioctls possible?
> 
> > we already opencoded this (probably before it was macroisied or we just
> > pasted it), so the radeon one is buggy, I should just go and compat_* all
> > of these then and we should be all happy?
>
> It should be, it's only working because:
>
> 1) A malicious userland hasn't put garbage in the upper bits for
> you yet.
>
> 2) Nobody has tested s390 yet :-)
>

So will an inline like this work?

static inline void *__user convert_user_ptr(uint64_t ioctl_ptr)
{
#ifdef CONFIG_COMPAT
if (is_compat_task())
return compat_ptr((compat_uptr_t)ioctl_ptr);
else
#endif
return (void __user *)(unsigned long)ioctl_ptr;
}

then I can convert all the code to just use that instead of explicity
casts or brokenness.

Dave.


\
 
 \ /
  Last update: 2009-10-28 04:57    [W:0.065 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site