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] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 17 Dec 2007 21:51:33 +0200
From:	"Pekka Enberg" <penberg@...helsinki.fi>
To:	"John Reiser" <jreiser@...wagon.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: slab quirks in DEBUG, ctor, and initialization

Hi John,

On Dec 17, 2007 5:47 PM, John Reiser <jreiser@...wagon.com> wrote:
> In mm/slab.c, the DEBUG variant of cache_alloc_debugcheck_after
> might call  cachep->ctor(objp, cachep, 0);  but the non-DEBUG
> variant does absolutely nothing.  idr_pre_get is a routine
> which notices the difference.

How does ipr_pre_get notice this?

On Dec 17, 2007 5:47 PM, John Reiser <jreiser@...wagon.com> wrote:
> Even when cache_alloc_debugcheck_after does invoke the ctor,
> then it is conditional upon  cachep->flags & SLAB_POISON.  This
> assumes that the only two states are poisoned and all-zero
> (from .bss static, or via a cleared new page frame.)
> So if SLAB_POISON is not specified, then a ctor which
> does anything other than memset(,0,) is out of luck.
> Instead: if a ctor is specified then it should be called
> for each successful allocation.

Sorry, I don't understand at all what's the problem is here. For the
common (non-poison) case, we initialize all objects *once* whenever a
cache is grown (see cache_grow calling cache_init_objs) which is the
whole point of having constructors. When poisoning is enabled, we
obviously cannot do this which is why we call the constructor for
every allocation.

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