[PATCH] mm: arm64: Fix the out-of-bounds issue in contpte_clear_young_dirty_ptes

Will Deacon will at kernel.org
Wed May 29 08:21:23 PDT 2024


On Wed, May 29, 2024 at 03:59:13PM +0100, Mark Rutland wrote:
> On Tue, May 28, 2024 at 08:39:55PM +1200, Barry Song wrote:
> > On Tue, May 28, 2024 at 8:26 PM Mark Rutland <mark.rutland at arm.com> wrote:
> > > On Fri, May 24, 2024 at 12:54:44PM +1200, Barry Song wrote:
> > > > From: Barry Song <v-songbaohua at oppo.com>
> > > >
> > > > We are passing a huge nr to __clear_young_dirty_ptes() right
> > > > now. While we should pass the number of pages, we are actually
> > > > passing CONT_PTE_SIZE. This is causing lots of crashes of
> > > > MADV_FREE, panic oops could vary everytime.
> > > >
> > > > Fixes: 89e86854fb0a ("mm/arm64: override clear_young_dirty_ptes() batch helper")
> > >
> > > I was seeing ths same thing on v6.10-rc1 (syzkaller splat and reproducer
> > > included at the end of the mail). The patch makes sense to me, and fixed the
> > > splat in testing, so:
> > >
> > > Reviewed-by: Mark Rutland <mark.rutland at arm.com>
> > > Tested-by: Mark Rutland <mark.rutland at arm.com>
> > 
> > Thanks!
> > 
> > > Since this only affects arm64 and is already in mainline, I assume the fix
> > > should go via the arm64 tree even though the broken commit went via mm.
> > 
> > Either mm or arm64 is fine with me, but I noticed that Andrew has already
> > included it in mm-hotfixes-unstable. If it works, we may want to stick with
> > that. :-)
> 
> Going via mm is also fine by me, I had just expected it'd be quicker to
> go via arm64 (and evidently I was wrong there!). :)

Sorry, I was fishing! I'm happy for it to land via -mm.

Will



More information about the linux-arm-kernel mailing list