[PATCH] x86_64: make in_gate_vma() safer
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: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment