[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <yc7zi3u4766orj7k7czsjxpaykuwbcehhcgler4vixkfzxjgke@yqlywdfalbu4>
Date: Tue, 21 Oct 2025 10:19:12 -0400
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Huiwen He <hehuiwen@...inos.cn>, markus.elfring@....de,
aliceryhl@...gle.com, andrewjballance@...il.com,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
maple-tree@...ts.infradead.org
Subject: Re: [PATCH] maple_tree: Fix potential NULL pointer dereference if
mas_pop_node() fails
* Matthew Wilcox <willy@...radead.org> [251019 16:14]:
> On Sun, Oct 19, 2025 at 07:49:16PM +0800, Huiwen He wrote:
...
>
> Do not send a v2 until somebody has a substantive comment. I suspect
> that what you are doing here is wrong, but I lack the understanding to
> explain why it is wrong.
Thanks Matthew.
This is not necessary.
At this point we ALWAYS have enough allocations.
I'm guessing you saw the WARN_ON() and return of NULL and assumed we'd
need to check the return in caller. This WARN_ON() is in place in case
the calculations are incorrect in some corner case (which has never
happened in mainline), so this will add extra instructions for a
significant amount of calls, especially the mas_wr_node_store() path,
with no chance of catching an error.
In fact, the only time I've seen the tree fail to allocate enough memory
is when syzbot fails allocations - and that will happen in the
preallocation stage, which does check the return.
So, thanks for looking but this patch is unnecessary.
Thanks,
Liam
Powered by blists - more mailing lists