Commit e09bee34 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman
Browse files

staging/lustre: Properly mark obd_iocontrol argument as __user



Also update all methods and calls everywhere.

Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 44164fc9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;

+4 −2
Original line number Diff line number Diff line
@@ -1724,7 +1724,8 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
			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 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
		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);
	}
}

+3 −3
Original line number Diff line number Diff line
@@ -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);
	}
	}
}
+1 −1
Original line number Diff line number Diff line
@@ -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;
Loading