From: Chao Gao Validate that writing invalid values to SSP MSRs triggers a #GP exception. This verifies that necessary validity checks are performed by the hardware or the underlying VMM. Signed-off-by: Chao Gao Signed-off-by: Mathias Krause Signed-off-by: Sean Christopherson --- x86/cet.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/x86/cet.c b/x86/cet.c index 8c2cf8c6..80864fb1 100644 --- a/x86/cet.c +++ b/x86/cet.c @@ -56,6 +56,7 @@ int main(int ac, char **av) char *shstk_virt; unsigned long shstk_phys; pteval_t pte = 0; + u8 vector; bool rvc; if (!this_cpu_has(X86_FEATURE_SHSTK)) { @@ -105,5 +106,9 @@ int main(int ac, char **av) write_cr4(read_cr4() & ~X86_CR4_CET); wrmsr(MSR_IA32_U_CET, 0); + /* SSP should be 4-Byte aligned */ + vector = wrmsr_safe(MSR_IA32_PL3_SSP, 0x1); + report(vector == GP_VECTOR, "MSR_IA32_PL3_SSP alignment test."); + return report_summary(); } -- 2.52.0.rc1.455.g30608eb744-goog