[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3B8641A1-5345-44A5-B610-9BCBC980493D@linux.dev>
Date: Thu, 22 May 2025 20:39:39 +0800
From: Muchun Song <muchun.song@...ux.dev>
To: Oscar Salvador <osalvador@...e.de>
Cc: Ge Yang <yangge1116@....com>,
akpm@...ux-foundation.org,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
stable@...r.kernel.org,
21cnbao@...il.com,
david@...hat.com,
baolin.wang@...ux.alibaba.com,
liuzixing@...on.cn
Subject: Re: [PATCH] mm/hugetlb: fix kernel NULL pointer dereference when
replacing free hugetlb folios
> On May 22, 2025, at 19:49, Oscar Salvador <osalvador@...e.de> wrote:
>
> On Thu, May 22, 2025 at 07:34:56PM +0800, Ge Yang wrote:
>> It seems that we cannot simply remove the folio_test_hugetlb() check. The
>> reasons are as follows:
>
> Yeah, my thought was whether we could move the folio_hstate within
> alloc_and_dissolve_hugetlb_folio(), since the latter really needs to take the
> lock.
> But isolate_or_dissolve_huge_page() also needs the 'hstate' not only to
> pass it onto alloc_and_dissolve_hugetlb_folio() but to check whether
> hstate is gigantic.
But I think we could use "folio_order() > MAX_PAGE_ORDER" to replace the check
of hstate_is_gigantic(), right? Then ee could remove the first parameter of hstate
from alloc_and_dissolve_hugetlb_folio() and obtain hstate in it.
>
> Umh, kinda hate sparkling the locks all around.
>
>
> --
> Oscar Salvador
> SUSE Labs
Powered by blists - more mailing lists