Skip to contentSkip to conversation

nds32: fix up stack guard gap

PATCH In review Greg Kroah-Hartman 3 participants 5 messages Jun 29, 2021 – Jun 30, 2021 Stable branch

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 nds32: fix up stack guard gap

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()

Cc Nick Hu <[email protected]>
Cc Greentime Hu <[email protected]>
Cc Vincent Chen <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Qiang Liu <[email protected]>
Cc stable <[email protected]>
Fixes 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
---
 arch/nds32/mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/mm/mmap.c +1 -1
index c206b31ce07a..1bdf5e7d1b43 100644
@@ -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;
 	}
 
Signature · 1 line
2.32.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Greg Kroah-Hartman

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()

Quoted 10 lines
Cc Nick Hu <[email protected]>
Cc Greentime Hu <[email protected]>
Cc Vincent Chen <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Qiang Liu <[email protected]>
Cc stable <[email protected]>
Fixes 1be7107fbe18 ("mm: larger stack guard gap, between vmas")

but it's a bit unfair to say that commit forgot nds32:
nds32 came into the tree nearly a year later.

Quoted 21 lines
---
 arch/nds32/mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/mm/mmap.c +1 -1
index c206b31ce07a..1bdf5e7d1b43 100644
@@ -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;
 	}
 
Signature · 1 line
2.32.0
#2 lore raw

Hi,

Quoted 21 lines · Hugh Dickins
Quoted 7 lines · Greg Kroah-Hartman

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()

Quoted 10 lines
Cc Nick Hu <[email protected]>
Cc Greentime Hu <[email protected]>
Cc Vincent Chen <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Qiang Liu <[email protected]>
Cc stable <[email protected]>
Fixes 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
Quoted 4 lines

but it's a bit unfair to say that commit forgot nds32:
nds32 came into the tree nearly a year later.

Could we use "not forward ported to"?

Quoted 22 lines
Quoted 22 lines
---
 arch/nds32/mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/mm/mmap.c +1 -2
index c206b31ce07a..1bdf5e7d1b43 100644
@@ -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

author maintainer
#3 lore raw
Quoted 24 lines · Qiang Liu

Hi,

Quoted 21 lines · Hugh Dickins
Quoted 17 lines · Greg Kroah-Hartman

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()

Cc Nick Hu <[email protected]>
Cc Greentime Hu <[email protected]>
Cc Vincent Chen <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Qiang Liu <[email protected]>
Cc stable <[email protected]>
Fixes 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
Quoted 5 lines
Quoted 4 lines

but it's a bit unfair to say that commit forgot nds32:
nds32 came into the tree nearly a year later.

Could we use "not forward ported to"?

Nah, it was just a mistake in the nds32 implementation when it was submitted.

thanks,

greg k-h

author maintainer
#4 lore raw
In reply to Hugh Dickins
Quoted 20 lines · Hugh Dickins
Quoted 7 lines · Greg Kroah-Hartman

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()

Quoted 10 lines
Cc Nick Hu <[email protected]>
Cc Greentime Hu <[email protected]>
Cc Vincent Chen <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Qiang Liu <[email protected]>
Cc stable <[email protected]>
Fixes 1be7107fbe18 ("mm: larger stack guard gap, between vmas")
Quoted 4 lines

but it's a bit unfair to say that commit forgot nds32:
nds32 came into the tree nearly a year later.

Ah, missed that. I will change the text to say that.

greg k-h