linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Duncan <LDuncan@suse.com>
To: Tom Abraham <TAbraham@suse.com>, Himanshu Madhani <hmadhani@marvell.com>
Cc: "jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH] scsi: qla2xxx: avoid crash in qlt_handle_abts_completion() if mcmd == NULL
Date: Wed, 20 Nov 2019 17:08:53 +0000	[thread overview]
Message-ID: <74bc094b-e534-7170-4cba-e7aa2451dd6c@suse.com> (raw)
In-Reply-To: <20191104181803.5475-1-tabraham@suse.com>

On 11/4/19 10:18 AM, Thomas Abraham wrote:
> qlt_ctio_to_cmd() will return a NULL mcmd if h == QLA_TGT_SKIP_HANDLE. If
> the error subcodes don't match the exact codes checked a crash will occur
> when calling free_mcmd on the null mcmd
> 
> Signed-off-by: Thomas Abraham <tabraham@suse.com>
> ---
>  drivers/scsi/qla2xxx/qla_target.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index a06e56224a55..611ab224662f 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -5732,7 +5732,8 @@ static void qlt_handle_abts_completion(struct scsi_qla_host *vha,
>  			    vha->vp_idx, entry->compl_status,
>  			    entry->error_subcode1,
>  			    entry->error_subcode2);
> -			ha->tgt.tgt_ops->free_mcmd(mcmd);
> +			if (mcmd)
> +				ha->tgt.tgt_ops->free_mcmd(mcmd);
>  		}
>  	} else if (mcmd) {
>  		ha->tgt.tgt_ops->free_mcmd(mcmd);
> 

Reviewed-by: Lee Duncan <lduncan@suse.com>

      parent reply	other threads:[~2019-11-20 18:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 18:18 [PATCH] scsi: qla2xxx: avoid crash in qlt_handle_abts_completion() if mcmd == NULL Thomas Abraham
2019-11-11 17:32 ` Roman Bolshakov
2019-11-13  1:41 ` Martin K. Petersen
2019-11-20 17:08 ` Lee Duncan [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=74bc094b-e534-7170-4cba-e7aa2451dd6c@suse.com \
    --to=lduncan@suse.com \
    --cc=TAbraham@suse.com \
    --cc=hare@suse.com \
    --cc=hmadhani@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.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 NNTP newsgroup(s).