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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 15 Jan 2011 23:09:11 -0800
From:	"Nicholas A. Bellinger" <nab@...ux-iscsi.org>
To:	Roland Dreier <rdreier@...co.com>
Cc:	linux-kernel@...r.kernel.org,
	linux-scsi <linux-scsi@...r.kernel.org>
Subject: Re: [PATCH] [SCSI] target: Fix memory leak on error path

On Sat, 2011-01-15 at 21:42 -0800, Roland Dreier wrote:
> If allocation of pt->pscsi_cdb fails, we need to free the just-allocated
> pt or else it will be leaked.
> 
> Signed-off-by: Roland Dreier <rolandd@...co.com>

Good catch here.  Committed as dea3bdb0081 and pushed into
lio-core-2.6.git/linus-38-rc1 and scsi-post-merge-2.6.git/for-jejb.

Thanks Roland!

--nab

> ---
>  drivers/target/target_core_pscsi.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
> index 742d246..60a2509 100644
> --- a/drivers/target/target_core_pscsi.c
> +++ b/drivers/target/target_core_pscsi.c
> @@ -817,6 +817,7 @@ pscsi_alloc_task(struct se_cmd *cmd)
>  		if (!(pt->pscsi_cdb)) {
>  			printk(KERN_ERR "pSCSI: Unable to allocate extended"
>  					" pt->pscsi_cdb\n");
> +			kfree(pt);
>  			return NULL;
>  		}
>  	} else
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ