All of lore.kernel.org
 help / color / mirror / Atom feed
* [withdrawn] mm-mmapc-fix-off-by-one-in-mmap-overflow-check.patch removed from -mm tree
@ 2015-05-14 18:19 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2015-05-14 18:19 UTC (permalink / raw)
  To: reesefaucette, linux, mm-commits


The patch titled
     Subject: mm/mmap.c: fix off-by-one in mmap overflow check 
has been removed from the -mm tree.  Its filename was
     mm-mmapc-fix-off-by-one-in-mmap-overflow-check.patch

This patch was dropped because it was withdrawn

------------------------------------------------------
From: Reese Faucette <reesefaucette@gmail.com>
Subject: mm/mmap.c: fix off-by-one in mmap overflow check 

When checking for overflow, the code in mm/mmap.c compares the first byte
*after* the end of mapped region to the start of the region instead of the
last byte of the mapped region.

This prevents mapping a region which abuts the end of physical space, as
mmap() incorrectly rejects the region with -EOVERFLOW, because pgoff +
(len >> PAGE_SHIFT) will be 0, which is < pgoff.  -reese

Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/mmap.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/mmap.c~mm-mmapc-fix-off-by-one-in-mmap-overflow-check mm/mmap.c
--- a/mm/mmap.c~mm-mmapc-fix-off-by-one-in-mmap-overflow-check
+++ a/mm/mmap.c
@@ -1280,7 +1280,7 @@ unsigned long do_mmap_pgoff(struct file
 		return -ENOMEM;
 
 	/* offset overflow? */
-	if ((pgoff + (len >> PAGE_SHIFT)) < pgoff)
+	if ((pgoff + (len >> PAGE_SHIFT) - 1) < pgoff)
 		return -EOVERFLOW;
 
 	/* Too many mappings? */
_

Patches currently in -mm which might be from reesefaucette@gmail.com are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-05-14 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-14 18:19 [withdrawn] mm-mmapc-fix-off-by-one-in-mmap-overflow-check.patch removed from -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.