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]
Message-Id: <1156423265.7908.10.camel@kleikamp.austin.ibm.com>
Date:	Thu, 24 Aug 2006 12:41:05 +0000
From:	Dave Kleikamp <shaggy@...tin.ibm.com>
To:	Andrew Morton <akpm@...l.org>
Cc:	Badari Pulavarty <pbadari@...ibm.com>,
	ext2-devel <Ext2-devel@...ts.sourceforge.net>,
	Herbert Xu <herbert@...dor.apana.org.au>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [Ext2-devel] [RFC][PATCH] Manage jbd allocations from its own
	slabs

On Wed, 2006-08-23 at 16:34 -0700, Andrew Morton wrote:
> On Wed, 23 Aug 2006 16:08:15 -0700
> Badari Pulavarty <pbadari@...ibm.com> wrote:

> >  /*
> > + * jbd slab management: create 1k, 2k, 4k, 8k slabs and allocate
> > + * frozen and commit buffers from these slabs.
> > + *
> > + * Reason for doing this is to avoid, SLAB_DEBUG - since it could
> > + * cause bh to cross page boundary.
> > + */
> > +
> > +static kmem_cache_t *jbd_slab[4];
> > +static const char *jbd_slab_names[4] = {
> > +	"jbd_1k",
> > +	"jbd_2k",
> > +	"jbd_4k",
> > +	"jbd_8k",
> > +};
> > +
> > +static void journal_destroy_jbd_slabs(void)
> > +{
> > +	int i;
> > +
> > +	for (i=0; i<4; i++) {
> > +		if (jbd_slab[i])
> > +			kmem_cache_destroy(jbd_slab[i]);
> > +		jbd_slab[i] = NULL;
> > +	}
> > +}
> > +
> > +static int journal_init_jbd_slabs(void)
> > +{
> > +	int i = 0;
> > +	int retval = 0;
> > +
> > +	for (i=0; i<4; i++) {
> > +		unsigned long slab_size = 1024 << i;
> > +		jbd_slab[i] = kmem_cache_create(jbd_slab_names[i],
> > +					slab_size, slab_size,
> > +					0, NULL, NULL);
> 
> OK, passing align=slab_size fixes the bug.

The comments above don't mention the alignment of the slabs, so a
comment here may help explain that the alignment is the key to avoiding
the page-straddling.  Or you could elaborate above.

Shaggy
-- 
David Kleikamp
IBM Linux Technology Center

-
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