Re: [PATCH v28 26/32] x86/cet/shstk: Introduce shadow stack token setup/verify routines

From
Dave Hansen <hidden>
Date
2021-07-22 21:15:40
Also in
linux-api, linux-arch, linux-mm, lkml
Reply to
Yu-cheng Yu, 2021-07-22
On 7/22/21 1:52 PM, Yu-cheng Yu wrote:
quoted hunk ↗ jump to hunk
+	if (fpregs_state_valid(fpu, smp_processor_id())) {
+		rdmsrl(MSR_IA32_PL3_SSP, ssp);
+	} else {
+		struct cet_user_state *p;
+
+		/*
+		 * When !fpregs_state_valid() and get_xsave_addr() returns
+		 * null, XFEAUTRE_CET_USER is in init state.  Shadow stack
+		 * pointer is null in this case, so return zero.
+		 */
+		p = get_xsave_addr(&fpu->state.xsave, XFEATURE_CET_USER);
+		if (p)
+			ssp = p->user_ssp;
+	}
+
+	fpregs_unlock();
Why are we even calling into this code if shadow stacks might be
disabled?  Seems like we should have just errored out long before
getting here.
Thread (62 messages) 62 messages, 5 authors, last reply 2021-08-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help