]> git.karo-electronics.de Git - karo-tx-linux.git/commit
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)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:34:58 +0000 (15:34 -0400)
commit55e131e30e6fe07ab213a4ee1cf1b662fe64d90f
tree03c8bff677d89b2132d75498b6dab7eed1c54f6f
parentbc661f5d238569cae7ca9da01e12451b7785fb01
vm: fix vm_pgoff wrap in stack expansion

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>
[PG: .34 doesn't have perf call via 3af9e859 (in .36); adjust accordingly]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
mm/mmap.c