Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2017-10-20 15:32:55 +0200
committerTakashi Iwai <tiwai@suse.de>2017-10-20 20:58:48 +0200
commit329d743c789e3c089d8112ad9fb2fbc2b5a92012 (patch)
tree72406db1574de2d16ddc0e514034751a52086fce
parentf0d1fdaf94e45a183f19b97b6e9e261413738304 (diff)
scsi: sg: only check for dxfer_len greater than 256Mrpm-4.4.92-6.18
(bsc#1064206). suse-commit: a69df70f25bb9f986a02b8fb7832c815fa58d739
-rw-r--r--drivers/scsi/sg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index a7c26bed8365..5b83b7f0b837 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -776,6 +776,9 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
"sg_common_write: scsi opcode=0x%02x, cmd_size=%d\n",
(int) cmnd[0], (int) hp->cmd_len));
+ if (hp->dxfer_len >= SZ_256M)
+ return -EINVAL;
+
k = sg_start_req(srp, cmnd);
if (k) {
SCSI_LOG_TIMEOUT(1, sg_printk(KERN_INFO, sfp->parentdp,