vm: fix vm_pgoff wrap in stack expansion
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 13 Apr 2011 15:07:28 +0000 (08:07 -0700)
committerBrad Figg <brad.figg@canonical.com>
Wed, 27 Apr 2011 18:41:40 +0000 (11:41 -0700)
commit5a46e18da7acd620677991294716fbba2b90372a
tree3649d98b019bdb24a96b62593520a6ada268641f
parent1f8d42c9a17768ace971fbca272a0e4a89a7e6f7
vm: fix vm_pgoff wrap in stack expansion

BugLink: http://bugs.launchpad.net/bugs/769042

commit a626ca6a656450e9f4df91d0dda238fff23285f4 upstream.

Commit 982134ba6261 ("mm: avoid wrapping vm_pgoff in mremap()") fixed
the case of a expanding mapping causing vm_pgoff wrapping when you used
mremap.  But there was another case where we expand mappings hiding in
plain sight: the automatic stack expansion.

This fixes that case too.

This one also found by Robert Święcki, using his nasty system call
fuzzer tool.  Good job.

Reported-and-tested-by: Robert Święcki <robert@swiecki.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
mm/mmap.c