lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E653C94-D457-4881-BAAC-35EA5DC178D8@oracle.com>
Date:   Wed, 14 Sep 2022 16:23:28 +0000
From:   Himanshu Madhani <himanshu.madhani@...cle.com>
To:     Rafael Mendonca <rafaelmendsr@...il.com>
CC:     Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream <GR-QLogic-Storage-Upstream@...vell.com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        Martin Petersen <martin.petersen@...cle.com>,
        Michael Christie <michael.christie@...cle.com>,
        linux-scsi <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] scsi: qla2xxx: Fix memory leak in
 __qlt_24xx_handle_abts()



> On Sep 13, 2022, at 7:49 PM, Rafael Mendonca <rafaelmendsr@...il.com> wrote:
> 
> Commit 8f394da36a36 ("scsi: qla2xxx: Drop TARGET_SCF_LOOKUP_LUN_FROM_TAG")
> made the __qlt_24xx_handle_abts() function return early if
> tcm_qla2xxx_find_cmd_by_tag() doesn't find a command, but it missed to
> clean up the allocated memory for the management command in such a case.
> 
> Fixes: 8f394da36a36 ("scsi: qla2xxx: Drop TARGET_SCF_LOOKUP_LUN_FROM_TAG")
> Signed-off-by: Rafael Mendonca <rafaelmendsr@...il.com>
> ---
> drivers/scsi/qla2xxx/qla_target.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
> index 62666df1a59e..4acff4e84b90 100644
> --- a/drivers/scsi/qla2xxx/qla_target.c
> +++ b/drivers/scsi/qla2xxx/qla_target.c
> @@ -2151,8 +2151,10 @@ static int __qlt_24xx_handle_abts(struct scsi_qla_host *vha,
> 
> 	abort_cmd = ha->tgt.tgt_ops->find_cmd_by_tag(sess,
> 				le32_to_cpu(abts->exchange_addr_to_abort));
> -	if (!abort_cmd)
> +	if (!abort_cmd) {
> +		mempool_free(mcmd, qla_tgt_mgmt_cmd_mempool);
> 		return -EIO;
> +	}
> 	mcmd->unpacked_lun = abort_cmd->se_cmd.orig_fe_lun;
> 
> 	if (abort_cmd->qpair) {
> -- 
> 2.34.1
> 
Looks Good.

Reviewed-by: Himanshu Madhani <himanshu.madhani@...cle.com>

-- 
Himanshu Madhani	Oracle Linux Engineering

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ