projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4583a4f
)
scsi: scsi_debug: num_tgts must be >= 0
author
Maurizio Lombardi
<mlombard@redhat.com>
Fri, 15 Nov 2019 16:37:27 +0000
(17:37 +0100)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Wed, 20 Nov 2019 02:37:34 +0000
(21:37 -0500)
Passing the parameter "num_tgts=-1" will start an infinite loop that
exhausts the system memory
Link:
https://lore.kernel.org/r/20191115163727.24626-1-mlombard@redhat.com
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi_debug.c
patch
|
blob
|
history
diff --git
a/drivers/scsi/scsi_debug.c
b/drivers/scsi/scsi_debug.c
index 4daf2637c011dd4a8922151b86f7289ad35a7ac7..44cb054d5e6649e3825c4fc106a24091a22e0a2a 100644
(file)
--- a/
drivers/scsi/scsi_debug.c
+++ b/
drivers/scsi/scsi_debug.c
@@
-5263,6
+5263,11
@@
static int __init scsi_debug_init(void)
return -EINVAL;
}
+ if (sdebug_num_tgts < 0) {
+ pr_err("num_tgts must be >= 0\n");
+ return -EINVAL;
+ }
+
if (sdebug_guard > 1) {
pr_err("guard must be 0 or 1\n");
return -EINVAL;