Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1559073
| From | Matthew Wilcox <mawilcox@microsoft.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH] radix-tree: Fix private list warnings |
| Date | 2017-01-14 22:40 +0100 |
| Message-ID | <sZEdk-2AG-13@gated-at.bofh.it> (permalink) |
| References | <sYXi2-1Pf-13@gated-at.bofh.it> <sZz3X-81T-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Johannes Weiner [mailto:hannes@cmpxchg.org]
> On Thu, Jan 12, 2017 at 05:28:23PM -0800, Matthew Wilcox wrote:
> > The newly introduced warning in radix_tree_free_nodes() was testing the
> > wrong variable; it should have been 'old' instead of 'node'. Rather
> > than replace that one instance, I noticed that we can simply put the
> > WARN_ON_ONCE in radix_tree_node_free() and it will be just as effective.
> >
> > Fixes: ea07b862ac8e ("mm: workingset: fix use-after-free in shadow node
> shrinker")
> > Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
>
> Thanks for the fix in radix_tree_free_nodes(). But I intentionally
> spread out the warnings to retain the line numbers. The inlining in
> that code will obscure which tree operation ends up triggering.
The backtrace should make that fairly obvious though; even if radix_tree_node_free() gets inlined, the caller of radix_tree_free_nodes() probably doesn't also call radix_tree_shrink() or delete_node(). You're really looking for the caller in the backtrace that's outside of radix-tree.c.
By the way, if you'd run the radix tree test-suite, the WARN_ON_ONCE would have triggered (that's how I spotted the bug). The test-suite is getting pretty useful these days; would you mind running it in future?
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] radix-tree: Fix private list warnings Matthew Wilcox <mawilcox@linuxonhyperv.com> - 2017-01-13 00:50 +0100
Re: [PATCH] radix-tree: Fix private list warnings Johannes Weiner <hannes@cmpxchg.org> - 2017-01-14 17:10 +0100
RE: [PATCH] radix-tree: Fix private list warnings Matthew Wilcox <mawilcox@microsoft.com> - 2017-01-14 22:40 +0100
Re: [PATCH] radix-tree: Fix private list warnings Johannes Weiner <hannes@cmpxchg.org> - 2017-01-15 02:00 +0100
csiph-web