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]
Message-ID: <B2FD678A64EAAD45B089B123FDFC3ED70916AAA4@inbmail01.lsi.com>
Date:	Mon, 10 Jan 2011 13:41:28 +0530
From:	"Desai, Kashyap" <Kashyap.Desai@....com>
To:	Jesper Juhl <jj@...osbits.net>,
	DL-MPT Fusion Linux <DL-MPTFusionLinux@....com>
CC:	"Moore, Eric" <Eric.Moore@....com>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Support, Software" <support@....com>
Subject: RE: [PATCH] SCSI, LSI Fusion MPT: Fix memory leak in
 mptctl_getiocinfo()

Jesper, Your finding is correct.

Please consider this patch as an ACKed by me.

~ Kashyap


> -----Original Message-----
> From: Jesper Juhl [mailto:jj@...osbits.net]
> Sent: Monday, December 27, 2010 2:44 AM
> To: DL-MPT Fusion Linux
> Cc: Moore, Eric; linux-scsi@...r.kernel.org; linux-
> kernel@...r.kernel.org; Support, Software
> Subject: [PATCH] SCSI, LSI Fusion MPT: Fix memory leak in
> mptctl_getiocinfo()
> 
> Hi,
> 
> A 'kfree(karg)' is missing in a failure path in
> drivers/message/fusion/mptctl.c::mptctl_getiocinfo() which can cause a
> memory leak. This patch should take care of that.
> 
> Hope I didn't miss something obvious, but to me it looks like adding
> this
> kfree() is the right thing to do. If you disagree feel free to correct
> me
> :-)
> 
> 
> Signed-off-by: Jesper Juhl <jj@...osbits.net>
> ---
>  mptctl.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
>   compile tested only since I don't have proper hardware to test for
> real.
> 
> diff --git a/drivers/message/fusion/mptctl.c
> b/drivers/message/fusion/mptctl.c
> index a3856ed..1dcc13a 100644
> --- a/drivers/message/fusion/mptctl.c
> +++ b/drivers/message/fusion/mptctl.c
> @@ -1307,8 +1307,10 @@ mptctl_getiocinfo (unsigned long arg, unsigned
> int data_size)
>  	else
>  		karg->adapterType = MPT_IOCTL_INTERFACE_SCSI;
> 
> -	if (karg->hdr.port > 1)
> +	if (karg->hdr.port > 1) {
> +		kfree(karg);
>  		return -EINVAL;
> +	}
>  	port = karg->hdr.port;
> 
>  	karg->port = port;
> 
> 
> --
> Jesper Juhl <jj@...osbits.net>            http://www.chaosbits.net/
> Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
> Plain text mails only, please.

--
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