staging/lustre: Properly mark obd_iocontrol argument as __user
authorOleg Drokin <green@linuxhacker.ru>
Sun, 3 Jan 2016 17:05:43 +0000 (12:05 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2016 22:29:30 +0000 (14:29 -0800)
Also update all methods and calls everywhere.

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/llite/dir.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/lmv/lmv_obd.c
drivers/staging/lustre/lustre/lov/lov_obd.c
drivers/staging/lustre/lustre/mdc/mdc_request.c
drivers/staging/lustre/lustre/obdecho/echo_client.c
drivers/staging/lustre/lustre/osc/osc_request.c

index 86897c2f6c68d4195d7455d31903330ffadbc520..f00d9a2e7afe5b6a74e901d2ed21712b33b378a4 100644 (file)
@@ -964,7 +964,7 @@ struct md_enqueue_info {
 struct obd_ops {
        struct module *owner;
        int (*iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
-                        void *karg, void *uarg);
+                        void *karg, void __user *uarg);
        int (*get_info)(const struct lu_env *env, struct obd_export *,
                        __u32 keylen, void *key, __u32 *vallen, void *val,
                        struct lov_stripe_md *lsm);
index 97d80397503c6e9d007fb5fb0fa2acd73cc70537..4f631e6bf0486aef944756c91826952f36c2a909 100644 (file)
@@ -1155,7 +1155,7 @@ static inline int obd_adjust_kms(struct obd_export *exp,
 }
 
 static inline int obd_iocontrol(unsigned int cmd, struct obd_export *exp,
-                               int len, void *karg, void *uarg)
+                               int len, void *karg, void __user *uarg)
 {
        int rc;
 
index eb2fc23574ca8b0fcaa80d59ad309d7c93046a80..5cfe8bb5fce2e23ed3b4225798d59025b8f0af4f 100644 (file)
@@ -1724,7 +1724,8 @@ out_quotactl:
                        return -EFAULT;
                return 0;
        case LL_IOC_GET_CONNECT_FLAGS: {
-               return obd_iocontrol(cmd, sbi->ll_md_exp, 0, NULL, (void *)arg);
+               return obd_iocontrol(cmd, sbi->ll_md_exp, 0, NULL,
+                                    (void __user *)arg);
        }
        case OBD_IOC_CHANGELOG_SEND:
        case OBD_IOC_CHANGELOG_CLEAR:
@@ -1847,7 +1848,8 @@ out_quotactl:
                return rc;
        }
        default:
-               return obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL, (void *)arg);
+               return obd_iocontrol(cmd, sbi->ll_dt_exp, 0, NULL,
+                                    (void __user *)arg);
        }
 }
 
index 39e2ffd5f97f1addb2d0b0067285935b30f07185..c91b5b4111c926890a41c6d4095b4a4471ef8b59 100644 (file)
@@ -1518,7 +1518,7 @@ static int ll_lov_setstripe(struct inode *inode, struct file *file,
                ll_layout_refresh(inode, &gen);
                lsm = ccc_inode_lsm_get(inode);
                rc = obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2dtexp(inode),
-                                  0, lsm, (void *)arg);
+                                  0, lsm, (void __user *)arg);
                ccc_inode_lsm_put(inode, lsm);
        }
        return rc;
@@ -1532,7 +1532,7 @@ static int ll_lov_getstripe(struct inode *inode, unsigned long arg)
        lsm = ccc_inode_lsm_get(inode);
        if (lsm != NULL)
                rc = obd_iocontrol(LL_IOC_LOV_GETSTRIPE, ll_i2dtexp(inode), 0,
-                                  lsm, (void *)arg);
+                                  lsm, (void __user *)arg);
        ccc_inode_lsm_put(inode, lsm);
        return rc;
 }
@@ -2497,7 +2497,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                        return err;
 
                return obd_iocontrol(cmd, ll_i2dtexp(inode), 0, NULL,
-                                    (void *)arg);
+                                    (void __user *)arg);
        }
        }
 }
index 9ebfb39a81886121fb0e06e50399b9ccdee1d2f5..59bdd580b249b3bbf5083212211e84b8fc46de54 100644 (file)
@@ -876,7 +876,7 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len,
 }
 
 static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
-                        int len, void *karg, void *uarg)
+                        int len, void *karg, void __user *uarg)
 {
        struct obd_device    *obddev = class_exp2obd(exp);
        struct lmv_obd       *lmv = &obddev->u.lmv;
index 1dde0b8fa9a6b6ed9403f9506f95547bbf1dc320..65077b7e235bd25695c803fc52b72468f8d4a70e 100644 (file)
@@ -1385,7 +1385,7 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp,
 }
 
 static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
-                        void *karg, void *uarg)
+                        void *karg, void __user *uarg)
 {
        struct obd_device *obddev = class_exp2obd(exp);
        struct lov_obd *lov = &obddev->u.lov;
index 3929f9129c8b4d7f5a3ded88a32be630a2dddadd..43481278096ff125113d28215905f22304f299cb 100644 (file)
@@ -1722,7 +1722,7 @@ static int mdc_ioc_swap_layouts(struct obd_export *exp,
 }
 
 static int mdc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
-                        void *karg, void *uarg)
+                        void *karg, void __user *uarg)
 {
        struct obd_device *obd = exp->exp_obd;
        struct obd_ioctl_data *data = karg;
index 5b76c222e2cf9aa9fca30ec6b0fd07e6861f1d35..d3e398f70434bb24d0a5f26e89f5277c797747f2 100644 (file)
@@ -1619,7 +1619,7 @@ static int echo_client_brw_ioctl(const struct lu_env *env, int rw,
 
 static int
 echo_client_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
-                     void *karg, void *uarg)
+                     void *karg, void __user *uarg)
 {
        struct obd_device      *obd = exp->exp_obd;
        struct echo_device     *ed = obd2echo_dev(obd);
index 7034f0a942c52046549067180ccf09ffce873187..6eb678c00e7b91ad1c912167e24dadcfcf0863b9 100644 (file)
@@ -2591,7 +2591,7 @@ static int osc_getstripe(struct lov_stripe_md *lsm, struct lov_user_md *lump)
 }
 
 static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
-                        void *karg, void *uarg)
+                        void *karg, void __user *uarg)
 {
        struct obd_device *obd = exp->exp_obd;
        struct obd_ioctl_data *data = karg;