Skip to content
Commit a8b92b8c authored by David Hildenbrand's avatar David Hildenbrand Committed by Vasily Gorbik
Browse files

s390/pci_mmio: fully validate the VMA before calling follow_pte()

We should not walk/touch page tables outside of VMA boundaries when
holding only the mmap sem in read mode. Evil user space can modify the
VMA layout just before this function runs and e.g., trigger races with
page table removal code since commit dd2283f2

 ("mm: mmap: zap pages
with read mmap_sem in munmap").

find_vma() does not check if the address is >= the VMA start address;
use vma_lookup() instead.

Reviewed-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: default avatarLiam R. Howlett <Liam.Howlett@oracle.com>
Fixes: dd2283f2

 ("mm: mmap: zap pages with read mmap_sem in munmap")
Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 6880fa6c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment