]> git.baikalelectronics.ru Git - kernel.git/commit
x86/arch_prctl/64: Remove FSBASE/GSBASE < 4G optimization
authorAndy Lutomirski <luto@kernel.org>
Tue, 26 Apr 2016 19:23:28 +0000 (12:23 -0700)
committerIngo Molnar <mingo@kernel.org>
Fri, 29 Apr 2016 09:56:41 +0000 (11:56 +0200)
commit86ddc88c26887c51bdd4e65622cf3191780867eb
tree2af8619a78d1713abee9a4bcebf0fc5b453ef536
parent0fea0919204466350d58dc802d8548c522ee0ab3
x86/arch_prctl/64: Remove FSBASE/GSBASE < 4G optimization

As far as I know, the optimization doesn't work on any modern distro
because modern distros use high addresses for ASLR.  Remove it.

The ptrace code was either wrong or very strange, but the behavior
with this patch should be essentially identical to the behavior
without this patch unless user code goes out of its way to mislead
ptrace.

On newer CPUs, once the FSGSBASE instructions are enabled, we won't
want to use the optimized variant anyway.

This isn't actually much of a performance regression, it has no effect
on normal dynamically linked programs, and it's a considerably
simplification. It also removes some nasty special cases from code
that is already way too full of special cases for comfort.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/dd1599b08866961dba9d2458faa6bbd7fba471d7.1461698311.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/segment.h
arch/x86/kernel/process_64.c
arch/x86/kernel/ptrace.c