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: <4F8C2F8F.1040009@parallels.com>
Date:	Mon, 16 Apr 2012 11:41:19 -0300
From:	Glauber Costa <glommer@...allels.com>
To:	Christoph Lameter <cl@...ux.com>
CC:	<linux-mm@...ck.org>, Suleiman Souhlal <suleiman@...gle.com>,
	<devel@...nvz.org>, <linux-kernel@...r.kernel.org>,
	Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: [PATCH] slub: don't create a copy of the name string in kmem_cache_create

On 04/16/2012 11:02 AM, Christoph Lameter wrote:
> On Fri, 13 Apr 2012, Glauber Costa wrote:
>
>> When creating a cache, slub keeps a copy of the cache name through
>> strdup. The slab however, doesn't do that. This means that everyone
>> registering caches have to keep a copy themselves anyway, since code
>> needs to work on all allocators.
>>
>> Having slab create a copy of it as well may very well be the right
>> thing to do: but at this point, the callers are already there
>
> What would break if we would add that to slab? I think this is more robust
> because right now slab relies on the caller not freeing the string.

Hard to think of anything, since we call kmem_cache_create() outside of
interrupt context anyway.

We have one more point in which we can fail - specially now that we are 
constraining memory usage, but one can argue that if we are short on 
memory, better not create another cache anyway.

My main reason for taking this out of slub, instead of adding to the 
slab, is that I don't remember any single bug report about that - and 
there are certainly people around using slab, and the interface has been 
around for so long, that pretty much everyone will assume this anyway.

I am happy, however, to patch it either way.

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