1
0
mirror of https://github.com/speed47/spectre-meltdown-checker synced 2024-12-23 04:43:37 +01:00

fix(centos): check according to redhat patch. https://access.redhat.com/articles/3311301

This commit is contained in:
fccagou 2018-01-08 11:14:22 +01:00
parent 623e180ae1
commit 0f50e04dab

View File

@ -155,7 +155,7 @@ if [ -e /sys/kernel/debug/sched_features ]; then
# try to mount the debugfs hierarchy ourselves and remember it to umount afterwards # try to mount the debugfs hierarchy ourselves and remember it to umount afterwards
mount -t debugfs debugfs /sys/kernel/debug 2>/dev/null && mounted_debugfs=1 mount -t debugfs debugfs /sys/kernel/debug 2>/dev/null && mounted_debugfs=1
fi fi
if [ -e /sys/kernel/debug/ibrs_enabled ]; then if [ -e /sys/kernel/debug/ibrs_enabled -o -e /sys/kernel/debug/x86/ibrs_enabled ]; then
# if the file is there, we have IBRS compiled-in # if the file is there, we have IBRS compiled-in
pstatus green YES pstatus green YES
ibrs_supported=1 ibrs_supported=1
@ -163,7 +163,7 @@ else
pstatus red NO pstatus red NO
fi fi
ibrs_enabled=$(cat /sys/kernel/debug/ibrs_enabled 2>/dev/null) [ -f /sys/kernel/debug/ibrs_enabled ] && ibrs_enabled=$(cat /sys/kernel/debug/ibrs_enabled 2>/dev/null) || ibrs_enabled=$(cat /sys/kernel/debug/x86/ibrs_enabled 2>/dev/null)
/bin/echo -n "* IBRS enabled for Kernel space: " /bin/echo -n "* IBRS enabled for Kernel space: "
# 0 means disabled # 0 means disabled
# 1 is enabled only for kernel space # 1 is enabled only for kernel space
@ -278,6 +278,9 @@ elif dmesg | grep -Eq 'Kernel/User page tables isolation: enabled|Kernel page ta
# if we can't find the flag, grep in dmesg # if we can't find the flag, grep in dmesg
pstatus green YES pstatus green YES
kpti_enabled=1 kpti_enabled=1
elif [ -e /sys/kernel/debug/x86/pti_enabled -a "$(cat /sys/kernel/debug/x86/pti_enabled)" = 1 ]; then
pstatus green YES
kpti_enabled=1
else else
pstatus red NO pstatus red NO
fi fi