User: Password:
|
|
Subscribe / Log in / New account

Re: 9pfs double kfree

From:  Dave Jones <davej-AT-redhat.com>
To:  Al Viro <viro-AT-ftp.linux.org.uk>
Subject:  Re: 9pfs double kfree
Date:  Mon, 6 Mar 2006 02:28:23 -0500
Cc:  "David S. Miller" <davem-AT-davemloft.net>, linux-kernel-AT-vger.kernel.org, ericvh-AT-gmail.com, rminnich-AT-lanl.gov
Archive-link:  Article, Thread

On Mon, Mar 06, 2006 at 07:23:46AM +0000, Al Viro wrote:
 > On Sun, Mar 05, 2006 at 11:07:11PM -0800, David S. Miller wrote:
 > > From: Dave Jones <davej@redhat.com>
 > > Date: Mon, 6 Mar 2006 02:04:58 -0500
 > > 
 > > > (I wish we had a kfree variant that NULL'd the target when it was free'd)
 > > 
 > > Excellent idea.
 > 
 > ITYM "poison the pointer variable".  Otherwise that sort of crap will go
 > unnoticed.

yeah, even better idea. Just like slab debug, but without the overhead
of poisoning the whole object.

I wonder if we could get away with something as simple as..

#define kfree(foo) \
	__kfree(foo); \
	foo = KFREE_POISON;

?

		Dave

-- 
http://www.codemonkey.org.uk


(Log in to post comments)


Copyright © 2006, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds