1
0
mirror of https://github.com/speed47/spectre-meltdown-checker synced 2025-01-09 20:48:23 +01:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Stéphane Lesimple
5ca7fe91ff fix: pteinv: don't check kernel image if not available 2019-11-23 14:01:56 +01:00
Stéphane Lesimple
4ba68fba74 fix: silence useless error from grep (fixes #322) 2019-11-23 13:51:00 +01:00

View File

@ -1111,6 +1111,7 @@ try_decompress()
_debug "try_decompress: magic for $3 found at offset $pos"
if ! command -v "$3" >/dev/null 2>&1; then
kernel_err="missing '$3' tool, please install it, usually it's in the '$5' package"
_debug "try_decompress: $kernel_err"
return 0
fi
pos=${pos%%:*}
@ -1144,6 +1145,7 @@ extract_kernel()
# Initial attempt for uncompressed images or objects:
if check_kernel "$1"; then
_debug "extract_kernel: found kernel is valid, no decompression needed"
cat "$1" > "$kerneltmp"
kernel=$kerneltmp
return 0
@ -3973,7 +3975,8 @@ check_CVE_2018_3639_linux()
if [ "$kernel_ssbd_enabled" = 1 ]; then
_info_nol "* SSB mitigation currently active for selected processes: "
mitigated_processes=$(grep -El 'Speculation.?Store.?Bypass:[[:space:]]+thread (force )?mitigated' /proc/*/status \
# silence grep's stderr here to avoid ENOENT errors from processes that have exited since the shell's expansion of the *
mitigated_processes=$(grep -El 'Speculation.?Store.?Bypass:[[:space:]]+thread (force )?mitigated' /proc/*/status 2>/dev/null \
| sed s/status/exe/ | xargs -r -n1 readlink -f | xargs -r -n1 basename | sort -u | tr "\n" " " | sed 's/ $//')
if [ -n "$mitigated_processes" ]; then
pstatus green YES "$mitigated_processes"
@ -4130,6 +4133,10 @@ check_CVE_2018_3620_linux()
if [ "$opt_sysfs_only" != 1 ]; then
_info_nol "* Kernel supports PTE inversion: "
if ! command -v "${opt_arch_prefix}strings" >/dev/null 2>&1; then
pstatus yellow UNKNOWN "missing 'strings' tool, please install it"
pteinv_supported=-1
elif [ -n "$kernel_err" ]; then
pstatus yellow UNKNOWN "$kernel_err"
pteinv_supported=-1
else
if "${opt_arch_prefix}strings" "$kernel" | grep -Fq 'PTE Inversion'; then