]> git.baikalelectronics.ru Git - kernel.git/commit
x86/entry/32: Fix FIXUP_ESPFIX_STACK with user CR3
authorAndy Lutomirski <luto@kernel.org>
Sun, 24 Nov 2019 16:50:03 +0000 (08:50 -0800)
committerIngo Molnar <mingo@kernel.org>
Mon, 25 Nov 2019 08:36:47 +0000 (09:36 +0100)
commit7b7cf8e089b47ac30b78ba45f6ee3ce7b5aece17
treeb7f1190c4712e52a4eeb867c98286f15da644845
parent4bbf0a46ca805355e0d5eea49aecf477f5cc2b35
x86/entry/32: Fix FIXUP_ESPFIX_STACK with user CR3

UNWIND_ESPFIX_STACK needs to read the GDT, and the GDT mapping that
can be accessed via %fs is not mapped in the user pagetables.  Use
SGDT to find the cpu_entry_area mapping and read the espfix offset
from that instead.

Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/entry/entry_32.S