mirror of
https://github.com/speed47/spectre-meltdown-checker
synced 2025-01-03 18:15:57 +01:00
Merge pull request #5 from fccagou/centos
fix(centos): check according to redhat patch.
This commit is contained in:
commit
d1498fe03f
@ -165,7 +165,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
|
||||||
@ -173,7 +173,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
|
||||||
@ -288,6 +288,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
|
||||||
|
Loading…
Reference in New Issue
Block a user