x86/process/64: Use FSGSBASE instructions on thread copy and ptrace
authorChang S. Bae <chang.seok.bae@intel.com>
Thu, 28 May 2020 20:13:53 +0000 (16:13 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jun 2020 13:47:02 +0000 (15:47 +0200)
commit005f141e5d5e05d3986539567d0bc5aa2f4dc640
tree8483e6be0a7c3040c858b1dd5026c176b4f1e551
parent673903495c85137791d5820d690229efe09c8f7b
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1557309753-24073-9-git-send-email-chang.seok.bae@intel.com
Link: https://lkml.kernel.org/r/20200528201402.1708239-8-sashal@kernel.org
arch/x86/kernel/process.c
arch/x86/kernel/process_64.c