Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm: fix use-after-free in sys_remap_file_pages
commit 4eb9198 upstream. remap_file_pages calls mmap_region, which may merge the VMA with other existing VMAs, and free "vma". This can lead to a use-after-free bug. Avoid the bug by remembering vm_flags before calling mmap_region, and not trying to dereference vma later. Signed-off-by: Rik van Riel <[email protected]> Reported-by: Dmitry Vyukov <[email protected]> Cc: PaX Team <[email protected]> Cc: Kees Cook <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Cyrill Gorcunov <[email protected]> Cc: Hugh Dickins <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information