Patchwork [3.5,67/96] Revert "mm: ensure get_unmapped_area() returns higher address than mmap_min_addr"

login
register
mail settings
Submitter Luis Henriques
Date Jan. 13, 2014, 2:24 p.m.
Message ID <1389623099-18783-68-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/309930/
State New
Headers show

Comments

Luis Henriques - Jan. 13, 2014, 2:24 p.m.
3.5.7.29 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Luis Henriques <luis.henriques@canonical.com>

This reverts commit 745545489d25d1b9ecf2d78a8f9a31a362806d2d, which is
commit 2afc745f3e3079ab16c826be4860da2529054dd2 upstream.

According to Akira, the backport for the 3.5 kernel was insufficient to
solve the problem.  Thus, this is being reverted and a complete fix will be
applied.

Cc: Akira Takeuchi <takeuchi.akr@jp.panasonic.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 mm/mmap.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/mm/mmap.c b/mm/mmap.c
index 758ff55..7e24763 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1443,7 +1443,7 @@  arch_get_unmapped_area(struct file *filp, unsigned long addr,
 	struct vm_area_struct *vma;
 	unsigned long start_addr;
 
-	if (len > TASK_SIZE - mmap_min_addr)
+	if (len > TASK_SIZE)
 		return -ENOMEM;
 
 	if (flags & MAP_FIXED)
@@ -1452,7 +1452,7 @@  arch_get_unmapped_area(struct file *filp, unsigned long addr,
 	if (addr) {
 		addr = PAGE_ALIGN(addr);
 		vma = find_vma(mm, addr);
-		if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
+		if (TASK_SIZE - len >= addr &&
 		    (!vma || addr + len <= vma->vm_start))
 			return addr;
 	}
@@ -1517,7 +1517,7 @@  arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
 	unsigned long addr = addr0, start_addr;
 
 	/* requested length too big for entire address space */
-	if (len > TASK_SIZE - mmap_min_addr)
+	if (len > TASK_SIZE)
 		return -ENOMEM;
 
 	if (flags & MAP_FIXED)
@@ -1527,7 +1527,7 @@  arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0,
 	if (addr) {
 		addr = PAGE_ALIGN(addr);
 		vma = find_vma(mm, addr);
-		if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
+		if (TASK_SIZE - len >= addr &&
 				(!vma || addr + len <= vma->vm_start))
 			return addr;
 	}