From: Damien Le Moal <dlemoal@kernel.org>
To: Aleksandr Aprelkov <aaprelkov@usergate.com>,
Hannes Reinecke <hare@suse.com>
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH] scsi: aic79xx: add scb NULL check in ahd_handle_msg_reject()
Date: Mon, 1 Apr 2024 16:10:41 +0900 [thread overview]
Message-ID: <22ccaa0a-96d4-42f2-b7e2-8b4113cacb58@kernel.org> (raw)
In-Reply-To: <20240401061010.589751-1-aaprelkov@usergate.com>
On 4/1/24 15:10, Aleksandr Aprelkov wrote:
> If ahd_lookup_scb() returns NULL and ahd_sent_msg() checks are false,
> then NULL pointer dereference happens
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Aleksandr Aprelkov <aaprelkov@usergate.com>
> ---
> drivers/scsi/aic7xxx/aic79xx_core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c
> index 3e3100dbfda3..9e0fafa12e87 100644
> --- a/drivers/scsi/aic7xxx/aic79xx_core.c
> +++ b/drivers/scsi/aic7xxx/aic79xx_core.c
> @@ -5577,7 +5577,7 @@ ahd_handle_msg_reject(struct ahd_softc *ahd, struct ahd_devinfo *devinfo)
> "Using asynchronous transfers\n",
> ahd_name(ahd), devinfo->channel,
> devinfo->target, devinfo->lun);
> - } else if ((scb->hscb->control & SIMPLE_QUEUE_TAG) != 0) {
> + } else if (scb && (scb->hscb->control & SIMPLE_QUEUE_TAG) != 0) {
"!= 0" is not needed.
> int tag_type;
> int mask;
>
--
Damien Le Moal
Western Digital Research
prev parent reply other threads:[~2024-04-01 7:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 6:10 [PATCH] scsi: aic79xx: add scb NULL check in ahd_handle_msg_reject() Aleksandr Aprelkov
2024-04-01 7:10 ` Damien Le Moal [this message]
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=22ccaa0a-96d4-42f2-b7e2-8b4113cacb58@kernel.org \
--to=dlemoal@kernel.org \
--cc=aaprelkov@usergate.com \
--cc=hare@suse.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=martin.petersen@oracle.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).