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: <46E9933D.5070802@redhat.com>
Date:	Thu, 13 Sep 2007 15:45:01 -0400
From:	Chuck Ebbert <cebbert@...hat.com>
To:	"J. Bruce Fields" <bfields@...ldses.org>
CC:	Pavel Emelyanov <xemul@...nvz.org>,
	Trond Myklebust <trond.myklebust@....uio.no>,
	Andrew Morton <akpm@...l.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	devel@...nvz.org
Subject: Re: [PATCH] Memory shortage can result in inconsistent flocks state

On 09/13/2007 03:34 PM, J. Bruce Fields wrote:
>> Doesn't that create a leak in some cases?
>>
>>>         for_each_lock(inode, before) {
>>>                 struct file_lock *fl = *before;
>>>                 if (IS_POSIX(fl))
>>>                         break;
>>>                 if (IS_LEASE(fl))
>>>                         continue;
>>>                 if (filp != fl->fl_file)
>>>                         continue;
>>>                 if (request->fl_type == fl->fl_type)
>>>                         goto out;  <<<<<<<<<<<<<<<< LEAK?
> 
> You mean, a leak of the memory allocated for new_fl?  That's freed at
> the exit labeled with "out".  It's the only exit:
> 
> 	out:
> 	        unlock_kernel();
> 		if (new_fl)
> 			locks_free_lock(new_fl);
> 		return error;
> 
> And new_fl is initially NULL, assigned only once by the allocation, then
> assigned to NULL only at the very end when we know we've succeeded.
> 
> Am I missing something else?
> 

Never mind, I didn't look closely enough. Looks good to me.

-
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