]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit317603610444870b4f8347645d60cac8085d2c55
tree8483e6be0a7c3040c858b1dd5026c176b4f1e551
parent2f97a68aefc406ea73c5d1347625dd9a0206b7d0
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