Merge "scsi: Block reset attempts to UFS through scsi ioctl"

This commit is contained in:
qctecmdr 2020-06-25 01:48:41 -07:00 committed by Gerrit - the friendly Code Review server
commit cac85f094b

View File

@ -2330,12 +2330,17 @@ scsi_ioctl_reset(struct scsi_device *dev, int __user *arg)
struct scsi_cmnd *scmd;
struct Scsi_Host *shost = dev->host;
struct request *rq;
const char *string;
unsigned long flags;
int error = 0, rtn, val;
if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO))
return -EACCES;
string = shost->hostt->name;
if (!strcmp(string, "ufshcd"))
return -EACCES;
error = get_user(val, arg);
if (error)
return error;