From af592d0465a659d3be2b62dd0d069c6aeeab5460 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Mon, 28 Oct 2019 10:50:37 +0000 Subject: [PATCH] Fix reset of the kernel stack pointer in TSS for !PTI case on pmap activation after r354095. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks --- sys/amd64/amd64/pmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index b94972118417..65f387829971 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -8650,7 +8650,7 @@ pmap_activate_sw_pti_post(struct thread *td, pmap_t pmap) { PCPU_GET(tssp)->tss_rsp0 = pmap->pm_ucr3 != PMAP_NO_CR3 ? - PCPU_GET(pti_rsp0) : (uintptr_t)td->td_pcb; + PCPU_GET(pti_rsp0) : (uintptr_t)td->td_md.md_stack_base; } static void inline