Commit e2d52f7b authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman

staging/lustre: Add __user attributes to libcfs_ioctl_get/popdata args

Just make clear which pointers are from userspace and which are not in
libcfs_ioctl_getdata/libcfs_ioctl_popdata and their callers.
Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f833ea10
......@@ -207,7 +207,7 @@ static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data)
int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand);
int libcfs_ioctl_getdata(char *buf, char *end, void *arg);
int libcfs_ioctl_popdata(void *arg, void *buf, int size);
int libcfs_ioctl_getdata(char *buf, char *end, void __user *arg);
int libcfs_ioctl_popdata(void __user *arg, void *buf, int size);
#endif /* __LIBCFS_IOCTL_H__ */
......@@ -40,7 +40,7 @@
#define LNET_MINOR 240
int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
int libcfs_ioctl_getdata(char *buf, char *end, void __user *arg)
{
struct libcfs_ioctl_hdr *hdr;
struct libcfs_ioctl_data *data;
......@@ -88,9 +88,9 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
return 0;
}
int libcfs_ioctl_popdata(void *arg, void *data, int size)
int libcfs_ioctl_popdata(void __user *arg, void *data, int size)
{
if (copy_to_user((char *)arg, data, size))
if (copy_to_user(arg, data, size))
return -EFAULT;
return 0;
}
......
......@@ -116,7 +116,7 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand)
EXPORT_SYMBOL(libcfs_deregister_ioctl);
static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,
void *arg, struct libcfs_ioctl_data *data)
void __user *arg, struct libcfs_ioctl_data *data)
{
int err = -EINVAL;
......@@ -157,7 +157,8 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,
return err;
}
static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg)
static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd,
void __user *arg)
{
char *buf;
struct libcfs_ioctl_data *data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment