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: <1399593989.13268.59.camel@kjgkr>
Date:	Fri, 09 May 2014 09:06:29 +0900
From:	Jaegeuk Kim <jaegeuk.kim@...sung.com>
To:	Catalin Marinas <catalin.marinas@....com>
Cc:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Johannes Weiner <hannes@...xchg.org>,
	"Linux Kernel, Mailing List" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [BUG] kmemleak on __radix_tree_preload

2014-05-08 (목), 17:52 +0100, Catalin Marinas:
> On Thu, May 08, 2014 at 04:53:30PM +0100, Paul E. McKenney wrote:
> > On Thu, May 08, 2014 at 04:29:48PM +0100, Catalin Marinas wrote:
> > > BTW, is it safe to have a union overlapping node->parent and
> > > node->rcu_head.next? I'm still staring at the radix-tree code but a
> > > scenario I have in mind is that call_rcu() has been raised for a few
> > > nodes, other CPU may have some reference to one of them and set
> > > node->parent to NULL (e.g. concurrent calls to radix_tree_shrink()),
> > > breaking the RCU linking. I can't confirm this theory yet ;)
> > 
> > If this were reproducible, I would suggest retrying with non-overlapping
> > node->parent and node->rcu_head.next, but you knew that already.  ;-)
> 
> Reading the code, I'm less convinced about this scenario (though it's
> worth checking without the union).
> 
> > But the usual practice would be to make node removal exclude shrinking.
> > And the radix-tree code seems to delegate locking to the caller.
> > 
> > So, is the correct locking present in the page cache?  The radix-tree
> > code seems to assume that all update operations for a given tree are
> > protected by a lock global to that tree.
> 
> The calling code in mm/filemap.c holds mapping->tree_lock when deleting
> radix-tree nodes, so no concurrent calls.
> 
> > Another diagnosis approach would be to build with
> > CONFIG_DEBUG_OBJECTS_RCU_HEAD=y, which would complain about double
> > call_rcu() invocations.  Rumor has it that is is necessary to turn off
> > other kmem debugging for this to tell you anything -- I have seen cases
> > where the kmem debugging obscures the debug-objects diagnostics.
> 
> Another test Jaegeuk could run (hopefully he has some time to look into
> this).

Yap, I'll test this too.
Thanks,

> 
> Thanks for suggestions.
> 

-- 
Jaegeuk Kim
Samsung

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