From: Douglas Gilbert <dgilbert@interlog.com>
To: Maurizio Lombardi <mlombard@redhat.com>, jejb@linux.ibm.com
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi_debug: num_tgts must be >= 0
Date: Sat, 16 Nov 2019 14:30:57 +1100 [thread overview]
Message-ID: <a52b6464-c710-3477-a79d-dca0b9915bf6@interlog.com> (raw)
In-Reply-To: <20191115163727.24626-1-mlombard@redhat.com>
On 2019-11-16 3:37 a.m., Maurizio Lombardi wrote:
> Passing the parameter "num_tgts=-1" will start
> an infinite loop that exhausts the system memory
Ouch.
> Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
> ---
> drivers/scsi/scsi_debug.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index d323523f5f9d..32965ec76965 100644
> --- 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;
>
next prev parent reply other threads:[~2019-11-16 3:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 16:37 [PATCH] scsi_debug: num_tgts must be >= 0 Maurizio Lombardi
2019-11-16 3:30 ` Douglas Gilbert [this message]
2019-11-19 4:41 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a52b6464-c710-3477-a79d-dca0b9915bf6@interlog.com \
--to=dgilbert@interlog.com \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mlombard@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox