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

From: Andrew Morton
Date: Sat Jul 08 2023 - 20:46:28 EST


On Sat, 8 Jul 2023 09:42:57 +0800 Muchun Song <muchun.song@xxxxxxxxx> wrote:

>
>
> > 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?
>

I have added cc:stable to this and I have staged it for 6.6-rc1.