lkml.org 
[lkml]   [2008]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 9/12]: wext: Dispatch and handle compat ioctls entirely in net/wireless/wext.c
Date
On Tuesday 03 June 2008, David Miller wrote:
> Next we can kill the hacks in fs/compat_ioctl.c and also
> dispatch compat ioctls down into the driver and 80211 protocol
> helper layers in order to handle iw_point objects embedded in
> stream replies which need to be translated.

Great work! Thanks for getting one large chunk of fs/compat_ioctl.c
removed on the way.

> diff --git a/include/net/wext.h b/include/net/wext.h
> index 80b31d8..6d76a39 100644
> --- a/include/net/wext.h
> +++ b/include/net/wext.h
> @@ -12,6 +12,8 @@ extern int wext_proc_init(struct net *net);
> extern void wext_proc_exit(struct net *net);
> extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
> void __user *arg);
> +extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
> + unsigned long arg);

Is it intentional that the prototypes are so different? Why not
pass a void __user *arg instead of unsigned long arg?

> +int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
> + unsigned long arg)
> +{
> + void __user *argp = (void __user *)arg;

For the conversion, you should also use compat_ptr() instead of the
cast. This currently only makes a difference on s390, which does
not have wireless, but it's better not to give wrong examples in the
code.

Arnd <><


\
 
 \ /
  Last update: 2008-06-04 14:25    [W:1.051 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site