• Andi Kleen's avatar
    [PATCH] x86_64: make in_gate_vma() safer · f1b519a3
    Andi Kleen authored
    x86-64 in_gate_vma would take a read lock on the VMA when the passed
    address was inside the 32bit vsyscall page.
    
    This would be called by get_user_pages, which already holds the mmap_sem.
    
    Unfortunately some callers of get_user_pages hold the mmap_sem for writing,
    which could in theory cause a deadlock.
    
    I think it can currently not happen because the only users who hold it for
    write before calling gup() are coredump and AIO in the ring setup, and both
    should not ever access the vsyscall page. 
    
    But not taking the semaphore is safer and avoid this here.
    Signed-off-by: default avatarAndi Kleen <ak@suse.de>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    f1b519a3
syscall32.c 2.85 KB