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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Apr 2009 16:06:42 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Wu Fengguang <fengguang.wu@...el.com>
Cc:	Eric Paris <eparis@...hat.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>,
	Matt Mackall <mpm@...enic.com>,
	Christoph Lameter <cl@...ux-foundation.org>,
	Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH] use GFP_NOFS in kernel_event()


* Wu Fengguang <fengguang.wu@...el.com> wrote:

> On Thu, Apr 30, 2009 at 09:48:21PM +0800, Wu Fengguang wrote:
> > On Thu, Apr 30, 2009 at 09:19:33PM +0800, Eric Paris wrote:
> > > inotify: lockdep annotation when watch being removed
> > > 
> > > From: Eric Paris <eparis@...hat.com>
> > > 
> > > When a dentry is being evicted from memory pressure, if the inode associated
> > > with that dentry has i_nlink == 0 we are going to drop all of the watches and
> > > kick everything out.  Lockdep complains that previously holding inotify_mutex
> > > we did a __GFP_FS allocation and now __GFP_FS reclaim is taking that lock.
> > > There is no deadlock or danger, since we know on this code path we are
> > > actually cleaning up and evicting everything.  So we move the lock into a new
> > > class for clean up.
> > 
> > I can reproduce the bug and hence confirm that this patch works, so
> > 
> > Tested-by: Wu Fengguang <fengguang.wu@...el.com>
> 
> btw, I really see no point to have one GFP_KERNEL and one GFP_NOFS
> sitting side by side inside kernel_event(). So this patch?
> 
> ---
> inotify: use consistent GFP_KERNEL in kernel_event()
> 
> kernel_event() has side by side kmem_cache_alloc(GFP_NOFS)
> and kmalloc(GFP_KERNEL). Change to consistent GFP_KERNELs.
> 
> cc: Al Viro <viro@...iv.linux.org.uk>
> Signed-off-by: Wu Fengguang <fengguang.wu@...el.com>
> ---
>  fs/notify/inotify/inotify_user.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- mm.orig/fs/notify/inotify/inotify_user.c
> +++ mm/fs/notify/inotify/inotify_user.c
> @@ -189,7 +189,7 @@ static struct inotify_kernel_event * ker
>  {
>  	struct inotify_kernel_event *kevent;
>  
> -	kevent = kmem_cache_alloc(event_cachep, GFP_NOFS);
> +	kevent = kmem_cache_alloc(event_cachep, GFP_KERNEL);

good point - this essentially reverts the earlier workaround.

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