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, 9 Jul 2012 09:52:09 +0800
From:	Fengguang Wu <fengguang.wu@...el.com>
To:	David Rientjes <rientjes@...gle.com>
Cc:	JoonSoo Kim <js1304@...il.com>,
	Vegard Nossum <vegard.nossum@...il.com>,
	Christoph Lameter <cl@...ux.com>,
	Pekka Enberg <penberg@...nel.org>, Rus <rus@...nxsoft.com>,
	Ben Hutchings <ben@...adent.org.uk>,
	Steven Rostedt <rostedt@...dmis.org>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: WARNING: __GFP_FS allocations with IRQs disabled
 (kmemcheck_alloc_shadow)

On Sun, Jul 08, 2012 at 04:01:44PM -0700, David Rientjes wrote:
> On Mon, 9 Jul 2012, JoonSoo Kim wrote:
> 
> > diff --git a/mm/slub.c b/mm/slub.c
> > index 8c691fa..5d41cad 100644
> > --- a/mm/slub.c
> > +++ b/mm/slub.c
> > @@ -1324,8 +1324,14 @@ static struct page *allocate_slab(struct
> > kmem_cache *s, gfp_t flags, int node)
> >                 && !(s->flags & (SLAB_NOTRACK | DEBUG_DEFAULT_FLAGS))) {
> >                 int pages = 1 << oo_order(oo);
> > 
> > +               if (flags & __GFP_WAIT)
> > +                       local_irq_enable();
> > +
> >                 kmemcheck_alloc_shadow(page, oo_order(oo), flags, node);
> > 
> > +               if (flags & __GFP_WAIT)
> > +                       local_irq_disable();
> > +
> >                 /*
> >                  * Objects from caches that have a constructor don't get
> >                  * cleared when they're allocated, so we need to do it here.
> 
> This patch is suboptimal when the branch is taken since you just disabled 
> irqs and now are immediately reenabling them and then disabling them 
> again.  (And your patch is also whitespace damaged, has no changelog, and 
> isn't signed off so it can't be applied.)

Agreed.

> The correct fix is what I proposed at 
> http://marc.info/?l=linux-kernel&m=133754837703630 and was awaiting 
> testing.  If Rus, Steven, or Fengguang could test this then we could add 
> it as a stable backport as well.

Acked-by: Fengguang Wu <fengguang.wu@...el.com>
Tested-by: Fengguang Wu <fengguang.wu@...el.com>

Thanks,
Fengguang
--
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