]> git.hungrycats.org Git - linux/commit
[PATCH] x86_64: make in_gate_vma() safer
authorAndi Kleen <ak@muc.de>
Wed, 6 Oct 2004 01:14:35 +0000 (18:14 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 6 Oct 2004 01:14:35 +0000 (18:14 -0700)
commitf1b519a3b2d1d56917016e5b4a25f763296cec91
treeda10db58c4883f911d9f0fda2ebbfb0a7b81d139
parent0a6fd29efa2a1b59083bc9534e9c8e909acc175f
[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>
arch/x86_64/ia32/syscall32.c
arch/x86_64/mm/init.c
include/asm-x86_64/proto.h