[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9EE9FD55-991E-48D9-9DE2-DA7F7E850352@nvidia.com>
Date: Tue, 10 Dec 2024 11:17:36 -0500
From: Zi Yan <ziy@...dia.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
Vlastimil Babka <vbabka@...e.cz>, Andrew Morton <akpm@...ux-foundation.org>,
Johannes Weiner <hannes@...xchg.org>, Yu Zhao <yuzhao@...gle.com>,
stable@...r.kernel.org
Subject: Re: [PATCH v1] mm/page_alloc: don't call pfn_to_page() on possibly
non-existent PFN in split_large_buddy()
On 10 Dec 2024, at 4:34, David Hildenbrand wrote:
> In split_large_buddy(), we might call pfn_to_page() on a PFN that might
> not exist. In corner cases, such as when freeing the highest pageblock in
> the last memory section, this could result with CONFIG_SPARSEMEM &&
> !CONFIG_SPARSEMEM_EXTREME in __pfn_to_section() returning NULL and
> and __section_mem_map_addr() dereferencing that NULL pointer.
>
> Let's fix it, and avoid doing a pfn_to_page() call for the first
> iteration, where we already have the page.
>
> So far this was found by code inspection, but let's just CC stable as
> the fix is easy.
>
> Fixes: fd919a85cd55 ("mm: page_isolation: prepare for hygienic freelists")
> Reported-by: Vlastimil Babka <vbabka@...e.cz>
> Closes: https://lkml.kernel.org/r/e1a898ba-a717-4d20-9144-29df1a6c8813@suse.cz
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Cc: Zi Yan <ziy@...dia.com>
> Cc: Yu Zhao <yuzhao@...gle.com>
> Cc: <stable@...r.kernel.org>
> Signed-off-by: David Hildenbrand <david@...hat.com>
Reviewed-by: Zi Yan <ziy@...dia.com>
Best Regards,
Yan, Zi
Powered by blists - more mailing lists