Message ID | 20180607143807.3611-9-yu-cheng.yu@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jun 7, 2018 at 7:41 AM Yu-cheng Yu <yu-cheng.yu@intel.com> wrote: > > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com> Please justify. This seems actively harmful to me.
On Thu, 2018-06-07 at 11:48 -0700, Andy Lutomirski wrote: > On Thu, Jun 7, 2018 at 7:41 AM Yu-cheng Yu <yu-cheng.yu@intel.com> wrote: > > > > Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com> > > Please justify. This seems actively harmful to me. I will remove this patch.
diff --git a/mm/mremap.c b/mm/mremap.c index 049470aa1e3e..70f20edb248e 100644 --- a/mm/mremap.c +++ b/mm/mremap.c @@ -525,7 +525,7 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, unsigned long, new_addr) { struct mm_struct *mm = current->mm; - struct vm_area_struct *vma; + struct vm_area_struct *vma = find_vma(mm, addr); unsigned long ret = -EINVAL; unsigned long charged = 0; bool locked = false; @@ -533,6 +533,9 @@ SYSCALL_DEFINE5(mremap, unsigned long, addr, unsigned long, old_len, LIST_HEAD(uf_unmap_early); LIST_HEAD(uf_unmap); + if (vma->vm_flags & VM_SHSTK) + return ret; + if (flags & ~(MREMAP_FIXED | MREMAP_MAYMOVE)) return ret;
Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com> --- mm/mremap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)