[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bf5c64c4-cea2-4132-bdbb-6400f852ab52@redhat.com>
Date: Thu, 25 Sep 2025 09:50:17 +0200
From: David Hildenbrand <david@...hat.com>
To: Fushuai Wang <wangfushuai@...du.com>, akpm@...ux-foundation.org,
xu.xin16@....com.cn, chengming.zhou@...ux.dev
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org, cuigaosheng1@...wei.com
Subject: Re: [PATCH] ksm: Fix potential NULL pointer dereference
On 25.09.25 05:13, Fushuai Wang wrote:
> The stable_tree_search() function may return an error pointer
> (NULL or ERR_PTR(...)). The current code does not check for
> these cases before dereferencing the returned value.
We discussed this in [1] where Willy clarified that there is no
de-referencing happening [2].
So no, this is not required.
Consider "&kfolio->page" currently being a "(struct page *) kfolio",
which is just a pointer cast and no de-referencing.
[1]
https://lore.kernel.org/linux-mm/20241024032300.2501949-1-cuigaosheng1@huawei.com/
[2] https://lore.kernel.org/linux-mm/Zzdrnod2zcTeI-Nt@casper.infradead.org/
--
Cheers
David / dhildenb
Powered by blists - more mailing lists