mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
[PATCH] Fix MADV_REMOVE protection checking
madvise_remove needs to respect file and mmap protections. Signed-off-by: Hugh Dickins <hugh@veritas.com> [ Will the real CVE-2006-1524 stand up, please.. ] Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
e14d95f773
commit
69cf0fac60
@ -168,6 +168,9 @@ static long madvise_remove(struct vm_area_struct *vma,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((vma->vm_flags & (VM_SHARED|VM_WRITE)) != (VM_SHARED|VM_WRITE))
|
||||
return -EACCES;
|
||||
|
||||
mapping = vma->vm_file->f_mapping;
|
||||
|
||||
offset = (loff_t)(start - vma->vm_start)
|
||||
|
Loading…
Reference in New Issue
Block a user