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:	Thu, 26 Sep 2013 00:31:22 -0400
From:	Douglas Gilbert <dgilbert@...erlog.com>
To:	vaughan <vaughan.cao@...cle.com>,
	Vegard Nossum <vegard.nossum@...cle.com>
CC:	James Bottomley <JBottomley@...allels.com>,
	linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] sg: fix memory leak

On 13-09-25 10:05 PM, vaughan wrote:
> On 09/25/2013 10:26 PM, Vegard Nossum wrote:
>> Commit e32c9e6300e3af659cbfe45e90a1e7dcd3572ada introduced a memory
>> leak. Fix it.
>>
>> Cc: stable@...r.kernel.org
>> Cc: Vaughan Cao <vaughan.cao@...cle.com>
>> Cc: Douglas Gilbert <dgilbert@...erlog.com>
>> Signed-off-by: Vegard Nossum <vegard.nossum@...cle.com>
>> ---
>>   drivers/scsi/sg.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
>> index 5cbc4bb..a97143f 100644
>> --- a/drivers/scsi/sg.c
>> +++ b/drivers/scsi/sg.c
>> @@ -2060,6 +2060,7 @@ sg_add_sfp(Sg_device * sdp, int dev)
>>   	spin_lock_irqsave(&sdp->sfd_lock, iflags);
>>   	if (sdp->detached) {
>>   		spin_unlock_irqrestore(&sdp->sfd_lock, iflags);
>> +		kfree(sfp);
>>   		return ERR_PTR(-ENODEV);
>>   	}
>>   	list_add_tail(&sfp->sfd_siblings, &sdp->sfds);
> You're right. It's a memory leak.

Signed-off-by: Douglas Gilbert <dgilbert@...erlog.com>


There also a memory leak at the second 'return NULL;'
in dev_seq_start() .

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