Thread (5 messages) 5 messages, 3 authors, 2021-06-30

Re: [PATCH] nds32: fix up stack guard gap

From: Hugh Dickins <hughd@google.com>
Date: 2021-06-29 20:33:34

On Tue, 29 Jun 2021, Greg Kroah-Hartman wrote:
Commit 1be7107fbe18 ("mm: larger stack guard gap, between vmas") fixed
up almost all architectures to deal with the stack guard gap, but forgit
nds32.

Resolve this by properly fixing up the nsd32's version of
arch_get_unmapped_area()

Reported-by: iLifetruth <redacted>
Cc: Nick Hu <redacted>
Cc: Greentime Hu <redacted>
Cc: Vincent Chen <redacted>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Qiang Liu <redacted>
Cc: stable <redacted>
Fixes: 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Hugh Dickins <hughd@google.com>

but it's a bit unfair to say that commit forgot nds32:
nds32 came into the tree nearly a year later.
quoted hunk ↗ jump to hunk
---
 arch/nds32/mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/nds32/mm/mmap.c b/arch/nds32/mm/mmap.c
index c206b31ce07a..1bdf5e7d1b43 100644
--- a/arch/nds32/mm/mmap.c
+++ b/arch/nds32/mm/mmap.c
@@ -59,7 +59,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
 
 		vma = find_vma(mm, addr);
 		if (TASK_SIZE - len >= addr &&
-		    (!vma || addr + len <= vma->vm_start))
+		    (!vma || addr + len <= vm_start_gap(vma)))
 			return addr;
 	}
 
-- 
2.32.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help