Skip to content

Commit

Permalink
nds32: fix up stack guard gap
Browse files Browse the repository at this point in the history
Commit 1be7107 ("mm: larger stack guard gap, between vmas") fixed
up all architectures to deal with the stack guard gap.  But when nds32
was added to the tree, it forgot to do the same thing.

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]>
Reported-by: iLifetruth <[email protected]>
Acked-by: Hugh Dickins <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
gregkh committed Jul 21, 2021
1 parent ebea676 commit c453db6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/nds32/mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c453db6

Please sign in to comment.