Re: [PATCH] mm: hugetlb_vmemmap: fix a race between vmemmap pmd split

From: Muchun Song
Date: Fri Jul 07 2023 - 21:43:40 EST




> On Jul 8, 2023, at 03:38, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Fri, 7 Jul 2023 11:38:59 +0800 Muchun Song <songmuchun@xxxxxxxxxxxxx> wrote:
>
>> The local variable @page in __split_vmemmap_huge_pmd() to obtain a pmd
>> page without holding page_table_lock may possiblely get the page table
>> page instead of a huge pmd page. The effect may be in set_pte_at()
>> since we may pass an invalid page struct, if set_pte_at() wants to
>> access the page struct (e.g. CONFIG_PAGE_TABLE_CHECK is enabled), it
>> may crash the kernel. So fix it. And inline __split_vmemmap_huge_pmd()
>> since it only has one user.
>
> Is this likely enough to justify a backport?
>
> I'm thinking "add cc:stable and merge into 6.6-rc1", so it hits -stable
> after a couple of months of testing.
>

Hi Andrew,

It is better to backport it to stable. Could you help me add it?

Thanks.