diff options
author | Alex Shi <alex.shi@linaro.org> | 2018-02-01 12:01:59 +0800 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2018-02-01 12:01:59 +0800 |
commit | 4e5a5112cc603d1dcfe7247723e1c08b8ffbc7ff (patch) | |
tree | 0eafc6ed77e008065ece3acd9ea83cc1a19a4122 /mm/mmap.c | |
parent | 05eda3c7aedbe06e9692a4a1ca511c6ab3d72de5 (diff) | |
parent | 90aaf2f25609f99b63fcbed280716f80b4bc5f56 (diff) |
Merge tag 'v3.18.93' into linux-linaro-lsk-v3.18lsk-v3.18-18.02
This is the 3.18.93 stable release
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 954ad5a3c140..60ba08e971fb 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2191,7 +2191,8 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address) gap_addr = TASK_SIZE; next = vma->vm_next; - if (next && next->vm_start < gap_addr) { + if (next && next->vm_start < gap_addr && + (next->vm_flags & (VM_WRITE|VM_READ|VM_EXEC))) { if (!(next->vm_flags & VM_GROWSUP)) return -ENOMEM; /* Check that both stack segments have the same anon_vma? */ @@ -2271,7 +2272,8 @@ int expand_downwards(struct vm_area_struct *vma, if (gap_addr > address) return -ENOMEM; prev = vma->vm_prev; - if (prev && prev->vm_end > gap_addr) { + if (prev && prev->vm_end > gap_addr && + (prev->vm_flags & (VM_WRITE|VM_READ|VM_EXEC))) { if (!(prev->vm_flags & VM_GROWSDOWN)) return -ENOMEM; /* Check that both stack segments have the same anon_vma? */ |