scsi_debug: num_tgts must be >= 0
PATCH 1/1 scsi_debug: num_tgts must be >= 0
Passing the parameter "num_tgts=-1" will start
an infinite loop that exhausts the system memory
Signed-off-by Maurizio Lombardi <[email protected]>
--- drivers/scsi/scsi_debug.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/scsi/scsi_debug.c +5 -0
@@ -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 ;
Signature · 1 line
Maurizio Lombardi
Quoted 2 lines · Maurizio Lombardi
Passing the parameter "num_tgts=-1" will start
an infinite loop that exhausts the system memory
Ouch.
Quoted 1 line
Signed-off-by Maurizio Lombardi <[email protected]>
Acked-by Douglas Gilbert <[email protected]>
Quoted 21 lines
--- drivers/scsi/scsi_debug.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/scsi/scsi_debug.c +5
-0@@ -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 ;
Martin K. Petersen
AppliedMaurizio,
Quoted 2 lines
Passing the parameter "num_tgts=-1" will start an infinite loop that exhausts the system memory
Applied to 5.5/scsi-queue, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering