Re: [PATCH v8 14/21] mm/mmap: Avoid zeroing vma tree in mmap_region()

From: Lorenzo Stoakes
Date: Fri Oct 04 2024 - 10:58:26 EST


On Fri, Oct 04, 2024 at 03:32:28PM +0100, Lorenzo Stoakes wrote:
> On Fri, Oct 04, 2024 at 03:26:26PM +0100, Lorenzo Stoakes wrote:
> > On Fri, Oct 04, 2024 at 03:23:37PM +0100, Lorenzo Stoakes wrote:
> > > On Fri, Oct 04, 2024 at 11:35:44AM +0200, Bert Karwatzki wrote:
> > > > Here's the log procduced by this kernel:
> > > >
> > > > c9e7f76815d3 (HEAD -> maple_tree_debug_4) hack: set of info stuff v5
> > > > 7e3bb072761a mm: correct error handling in mmap_region()
> > > > 77df9e4bb222 (tag: next-20241001, origin/master, origin/HEAD, master) Add linux-next specific files for 20241001
> > > >
> > > > Again it took two attempts to trigger the bug.
> > > >
> > > > Bert Karwatzki
> > > >
> > >

[snip]

OK sorry to keep on updating so quick, but been busy testing out the fix.

This version passes all tests so shooould work generally.

I'll do a proper write-up, etc. but generally it's because we can have a
condition where one node is empty other than the end node that is to be
overwritten, but we weren't being careful about that on a spanning store,
so were merging this AND writing in the new entry resulting in the observed
duplicate.

You need very specific circumstances to trigger this which the MAP_FIXED
series + steam seemed to provide :)

Please give this a try and let me know how it works.

Huge thanks for all your help throughout this! :)

----8<----