OSDN Git Service

x86/process/64: Use FSGSBASE instructions on thread copy and ptrace
authorChang S. Bae <chang.seok.bae@intel.com>
Wed, 8 May 2019 10:02:23 +0000 (03:02 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 22 Jun 2019 09:38:53 +0000 (11:38 +0200)
commitf60a83df4593c5e03e746ded66d8b436c4ad6e41
treee55d1c124a87c27558089966dce2a9f6276d6b68
parent1ab5f3f7fe3d7548b4361b68c1fed140c6841af9
x86/process/64: Use FSGSBASE instructions on thread copy and ptrace

When FSGSBASE is enabled, copying threads and reading fsbase and gsbase
using ptrace must read the actual values.

When copying a thread, use save_fsgs() and copy the saved values.  For
ptrace, the bases must be read from memory regardless of the selector if
FSGSBASE is enabled.

[ tglx: Invoke __rdgsbase_inactive() with interrupts disabled ]
[ luto: Massage changelog ]

Suggested-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "H . Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ravi Shankar <ravi.v.shankar@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Link: https://lkml.kernel.org/r/1557309753-24073-9-git-send-email-chang.seok.bae@intel.com
arch/x86/kernel/process_64.c