Re: [PATCH] Fix OOPS in mmap_region() when merging adjacent VM_LOCKEDfile segments

From: Hugh Dickins
Date: Fri Jan 30 2009 - 12:42:36 EST

On Fri, 30 Jan 2009, Linus Torvalds wrote:
> On Thu, 29 Jan 2009, Greg KH wrote:
> >
> > Which version was the "non-cleanup" version that should be added to the
> > stable trees?
> There were two different versions:
> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Subject: Re: possible bug in mmap_region() in linux-2.6.28 kernel
> Message-Id: <20090128134350.034ac6a7.akpm@xxxxxxxxxxxxxxxxxxxx>
> From: Lee Schermerhorn <Lee.Schermerhorn@xxxxxx>
> Subject: [PATCH] Fix OOPS in mmap_region() when merging adjacent VM_LOCKED file segments
> Message-Id: <1233259410.2315.75.camel@lts-notebook>
> and I'm actually not at all sure which one should go into stable (or if we
> should just pick the same one that went into mainline).
> But none of the above really changes the fact that the patch I committed
> to mainline was really quite fundamentally more invasive than either of
> the "simple" patches. All three patches are small, with mine arguably the
> smallest of the lot, but mine actually changed semantics, while Andrew's
> and Lee's patch literally only fix the invalid pointer use.
> I'll leave it to others to decide which one goes into -stable. I
> personally don't really think it matters. I argue above that mine is
> pretty safe and thus perfectly fine even for -stable, but reality has a
> habit of sometimes disagreeing with me. Dang.

I'd say one of the non-cleanup versions for -stable
(but I've not compared them to see which one is better).

I'm still working my way through all the ->mmap methods to check
their safety with regard to yesterday's change (there are about
ten times as many as the last time I looked). So far there's only
one driver mmap I want to go back and recheck, the vast majority
are as good today as they were the day before, but ...

... what I think you have done is break the vma merging on
ordinary files: because of that irritating VM_CAN_NONLINEAR
flag which generic_file_mmap() and some others add in.

To break the merging won't cause anyone much trouble,
but is a slight regression we should fix.

I'd have been very upset not to find something ;)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at