mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
scsi: Block reset attempts to UFS through scsi ioctl
User layer can reset scsi host/bus/target/device through scsi ioctl. Block this path to UFS as it may cause stability issues to UFS. Change-Id: I18e721f36d4f255139645f986ceb329f40b2fb33 Signed-off-by: Can Guo <cang@codeaurora.org>
This commit is contained in:
parent
7b7d13e1a5
commit
b1419061a3
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue