Skip to content
Commit 7ce5a2b9 authored by H. Peter Anvin's avatar H. Peter Anvin
Browse files

x86-64: Clear a 64-bit FS/GS base on fork if selector is nonzero



When we do a thread switch, we clear the outgoing FS/GS base if the
corresponding selector is nonzero.  This is taken by __switch_to() as
an entry invariant; it does not verify that it is true on entry.
However, copy_thread() doesn't enforce this constraint, which can
result in inconsistent results after fork().

Make copy_thread() match the behavior of __switch_to().

Reported-and-tested-by: default avatarSamuel Thibault <samuel.thibault@inria.fr>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
LKML-Reference: <4BD1E061.8030605@zytor.com>
Cc: <stable@kernel.org>
parent ae7c9b70
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment