mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 05:31:17 -04:00
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: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f833ea10c7
commit
e2d52f7b3a
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user