mbox series

[0/8] qla2xxx klocwork fixes

Message ID 20230518075841.40363-1-njavali@marvell.com
Headers show
Series qla2xxx klocwork fixes | expand

Message

Nilesh Javali May 18, 2023, 7:58 a.m. UTC
Martin,

Please apply the qla2xxx driver klocwork fixes to
the scsi tree at your earliest convenience.

Thanks,
Nilesh

Bikash Hazarika (2):
  qla2xxx: klocwork - Fix potential null pointer dereference
  qla2xxx: klocwork - correct the index of array

Nilesh Javali (4):
  qla2xxx: klocwork - Array index may go out of bound
  qla2xxx: klocwork - Check for a valid fcport pointer
  qla2xxx: klocwork - Check valid rport returned by fc_bsg_to_rport
  qla2xxx: Update version to 10.02.08.400-k

Quinn Tran (1):
  qla2xxx: klocwork - Fix buffer overrun

Shreyas Deodhar (1):
  qla2xxx: klocwork - pointer may be dereferenced

 drivers/scsi/qla2xxx/qla_bsg.c     | 6 ++++++
 drivers/scsi/qla2xxx/qla_edif.c    | 3 ++-
 drivers/scsi/qla2xxx/qla_init.c    | 2 +-
 drivers/scsi/qla2xxx/qla_inline.h  | 5 ++++-
 drivers/scsi/qla2xxx/qla_iocb.c    | 8 +++++---
 drivers/scsi/qla2xxx/qla_os.c      | 3 ++-
 drivers/scsi/qla2xxx/qla_version.h | 4 ++--
 7 files changed, 22 insertions(+), 9 deletions(-)


base-commit: 44ef1604ae9492a7d9238ea79aa0cc7b4c4de860

Comments

Bart Van Assche May 18, 2023, 5:44 p.m. UTC | #1
On 5/18/23 00:58, Nilesh Javali wrote:
> Klocwork reported warning of null pointer may be dereferenced.
> The routine exits when sa_ctl is NULL and fcport is allocated after
> the exit call thus causing NULL fcport pointer to dereference at the
> time of exit.
> 
> Add a check for a valid fcport pointer at the time of exit.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: Nilesh Javali <njavali@marvell.com>
> ---
>   drivers/scsi/qla2xxx/qla_edif.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_edif.c b/drivers/scsi/qla2xxx/qla_edif.c
> index ec0e20255bd3..14e314c12dd6 100644
> --- a/drivers/scsi/qla2xxx/qla_edif.c
> +++ b/drivers/scsi/qla2xxx/qla_edif.c
> @@ -2411,7 +2411,8 @@ qla24xx_issue_sa_replace_iocb(scsi_qla_host_t *vha, struct qla_work_evt *e)
>   	kref_put(&sp->cmd_kref, qla2x00_sp_release);
>   	fcport->flags &= ~FCF_ASYNC_SENT;
>   done:
> -	fcport->flags &= ~FCF_ASYNC_ACTIVE;
> +	if (fcport)
> +		fcport->flags &= ~FCF_ASYNC_ACTIVE;
>   	return rval;
>   }

Please change the "goto done" statements that occur before fcport is set 
into "return rval" instead of making the above change.

Bart.