[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZjPUqKSE_CUVT3Y-@arm.com>
Date: Thu, 2 May 2024 19:00:08 +0100
From: Catalin Marinas <catalin.marinas@....com>
To: Will Deacon <will@...nel.org>, Mark Rutland <mark.rutland@....com>,
Anshuman Khandual <anshuman.khandual@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Zi Yan <zi.yan@...rutgers.edu>,
"Aneesh Kumar K.V" <aneesh.kumar@...nel.org>,
Ryan Roberts <ryan.roberts@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH v2] arm64/mm: pmd_mkinvalid() must handle swap pmds
On Tue, Apr 30, 2024 at 06:57:52PM +0100, Catalin Marinas wrote:
> On Tue, 30 Apr 2024 14:31:38 +0100, Ryan Roberts wrote:
> > __split_huge_pmd_locked() can be called for a present THP, devmap or
> > (non-present) migration entry. It calls pmdp_invalidate()
> > unconditionally on the pmdp and only determines if it is present or not
> > based on the returned old pmd.
> >
> > But arm64's pmd_mkinvalid(), called by pmdp_invalidate(),
> > unconditionally sets the PMD_PRESENT_INVALID flag, which causes future
> > pmd_present() calls to return true - even for a swap pmd. Therefore any
> > lockless pgtable walker could see the migration entry pmd in this state
> > and start interpretting the fields (e.g. pmd_pfn()) as if it were
> > present, leading to BadThings (TM). GUP-fast appears to be one such
> > lockless pgtable walker.
> >
> > [...]
>
> Applied to arm64 (for-next/fixes), thanks! It should land in 6.9-rc7. I
> removed the debug/test code, please send it as a separate patch for
> 6.10.
>
> [1/1] arm64/mm: pmd_mkinvalid() must handle swap pmds
> https://git.kernel.org/arm64/c/e783331c7720
Since Andrew merged the generic mm fix, I dropped this patch from the
arm64 for-next/fixes branch.
--
Catalin
Powered by blists - more mailing lists