From 94cd37ebb293321115a36a422b091fdb72d2fb08 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 16 Sep 2020 05:27:32 -0700 Subject: x86: Use HAS_CPU_FEATURE with IBT and SHSTK [BZ #26625] commit 04bba1e5d84b6fd8d3a3b006bc240cd5d241ee30 Author: H.J. Lu Date: Wed Aug 5 13:51:56 2020 -0700 x86: Set CPU usable feature bits conservatively [BZ #26552] Set CPU usable feature bits only for CPU features which are usable in user space and whose usability can be detected from user space, excluding features like FSGSBASE whose enable bit can only be checked in the kernel. no longer turns on the usable bits of IBT and SHSTK since we don't know if IBT and SHSTK are usable until much later. Use HAS_CPU_FEATURE to check if the processor supports IBT and SHSTK. --- sysdeps/x86/cpu-features.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/x86/cpu-features.c') diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index a9945b94bb..6551df19c0 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -723,9 +723,9 @@ no_cpuid: GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK */ unsigned int cet_feature = 0; - if (!CPU_FEATURE_USABLE (IBT)) + if (!HAS_CPU_FEATURE (IBT)) cet_feature |= GNU_PROPERTY_X86_FEATURE_1_IBT; - if (!CPU_FEATURE_USABLE (SHSTK)) + if (!HAS_CPU_FEATURE (SHSTK)) cet_feature |= GNU_PROPERTY_X86_FEATURE_1_SHSTK; if (cet_feature) -- cgit 1.4.1