Commit 75bbff3e authored by Hugh Dickins's avatar Hugh Dickins Committed by Greg Hackmann
Browse files

UPSTREAM: mm: fix new crash in unmapped_area_topdown()



commit f4cb767d upstream.

Trinity gets kernel BUG at mm/mmap.c:1963! in about 3 minutes of
mmap testing.  That's the VM_BUG_ON(gap_end < gap_start) at the
end of unmapped_area_topdown().  Linus points out how MAP_FIXED
(which does not have to respect our stack guard gap intentions)
could result in gap_end below gap_start there.  Fix that, and
the similar case in its alternative, unmapped_area().

Cc: stable@vger.kernel.org
Fixes: 1be7107f ("mm: larger stack guard gap, between vmas")
Reported-by: default avatarDave Jones <davej@codemonkey.org.uk>
Debugged-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarHugh Dickins <hughd@google.com>
Acked-by: default avatarMichal Hocko <mhocko@suse.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
(cherry picked from commit 28ebf895)

Bug: 38413813
Change-Id: I4cceb484114ba9033d29687eeed4558c64f13dae
Signed-off-by: default avatarGreg Hackmann <ghackmann@google.com>
parent ab1824f6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment