boot-process, we don't want to accidentally allow "notrack" indirect
branches. Linux kernel does the same. Today it is difficult to do the
same for userland, because there is 1 known piece of software using
"notrack" (which needs to be fixed).
ok kettenis
-/* $OpenBSD: cpu.c,v 1.181 2024/02/18 05:42:50 guenther Exp $ */
+/* $OpenBSD: cpu.c,v 1.182 2024/02/24 17:00:05 deraadt Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
#ifndef SMALL_KERNEL
if (ci->ci_feature_sefflags_edx & SEFF0EDX_IBT) {
msr = rdmsr(MSR_S_CET);
- wrmsr(MSR_S_CET, msr | MSR_CET_ENDBR_EN);
+ wrmsr(MSR_S_CET, (msr & ~MSR_CET_NO_TRACK_EN) | MSR_CET_ENDBR_EN);
lcr4(rcr4() | CR4_CET);
}
#endif