diff options
-rw-r--r-- | fs/exec.c | 2 | ||||
-rw-r--r-- | include/linux/mm.h | 8 | ||||
-rw-r--r-- | mm/memory.c | 2 | ||||
-rw-r--r-- | mm/mmap.c | 7 |
4 files changed, 8 insertions, 11 deletions
@@ -200,7 +200,7 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | |||
200 | 200 | ||
201 | #ifdef CONFIG_STACK_GROWSUP | 201 | #ifdef CONFIG_STACK_GROWSUP |
202 | if (write) { | 202 | if (write) { |
203 | ret = expand_stack_downwards(bprm->vma, pos); | 203 | ret = expand_downwards(bprm->vma, pos); |
204 | if (ret < 0) | 204 | if (ret < 0) |
205 | return NULL; | 205 | return NULL; |
206 | } | 206 | } |
diff --git a/include/linux/mm.h b/include/linux/mm.h index e173cd297d88..d2948af126ca 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1518,15 +1518,17 @@ unsigned long ra_submit(struct file_ra_state *ra, | |||
1518 | struct address_space *mapping, | 1518 | struct address_space *mapping, |
1519 | struct file *filp); | 1519 | struct file *filp); |
1520 | 1520 | ||
1521 | /* Do stack extension */ | 1521 | /* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */ |
1522 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | 1522 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
1523 | |||
1524 | /* CONFIG_STACK_GROWSUP still needs to to grow downwards at some places */ | ||
1525 | extern int expand_downwards(struct vm_area_struct *vma, | ||
1526 | unsigned long address); | ||
1523 | #if VM_GROWSUP | 1527 | #if VM_GROWSUP |
1524 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); | 1528 | extern int expand_upwards(struct vm_area_struct *vma, unsigned long address); |
1525 | #else | 1529 | #else |
1526 | #define expand_upwards(vma, address) do { } while (0) | 1530 | #define expand_upwards(vma, address) do { } while (0) |
1527 | #endif | 1531 | #endif |
1528 | extern int expand_stack_downwards(struct vm_area_struct *vma, | ||
1529 | unsigned long address); | ||
1530 | 1532 | ||
1531 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ | 1533 | /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */ |
1532 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); | 1534 | extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr); |
diff --git a/mm/memory.c b/mm/memory.c index 61e66f026563..4c6ea10f3d18 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -2966,7 +2966,7 @@ static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned lo | |||
2966 | if (prev && prev->vm_end == address) | 2966 | if (prev && prev->vm_end == address) |
2967 | return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; | 2967 | return prev->vm_flags & VM_GROWSDOWN ? 0 : -ENOMEM; |
2968 | 2968 | ||
2969 | expand_stack(vma, address - PAGE_SIZE); | 2969 | expand_downwards(vma, address - PAGE_SIZE); |
2970 | } | 2970 | } |
2971 | if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { | 2971 | if ((vma->vm_flags & VM_GROWSUP) && address + PAGE_SIZE == vma->vm_end) { |
2972 | struct vm_area_struct *next = vma->vm_next; | 2972 | struct vm_area_struct *next = vma->vm_next; |
@@ -1774,7 +1774,7 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) | |||
1774 | /* | 1774 | /* |
1775 | * vma is the first one with address < vma->vm_start. Have to extend vma. | 1775 | * vma is the first one with address < vma->vm_start. Have to extend vma. |
1776 | */ | 1776 | */ |
1777 | static int expand_downwards(struct vm_area_struct *vma, | 1777 | int expand_downwards(struct vm_area_struct *vma, |
1778 | unsigned long address) | 1778 | unsigned long address) |
1779 | { | 1779 | { |
1780 | int error; | 1780 | int error; |
@@ -1821,11 +1821,6 @@ static int expand_downwards(struct vm_area_struct *vma, | |||
1821 | return error; | 1821 | return error; |
1822 | } | 1822 | } |
1823 | 1823 | ||
1824 | int expand_stack_downwards(struct vm_area_struct *vma, unsigned long address) | ||
1825 | { | ||
1826 | return expand_downwards(vma, address); | ||
1827 | } | ||
1828 | |||
1829 | #ifdef CONFIG_STACK_GROWSUP | 1824 | #ifdef CONFIG_STACK_GROWSUP |
1830 | int expand_stack(struct vm_area_struct *vma, unsigned long address) | 1825 | int expand_stack(struct vm_area_struct *vma, unsigned long address) |
1831 | { | 1826 | { |