mirror of
https://github.com/speed47/spectre-meltdown-checker.git
synced 2026-06-07 15:13:02 +02:00
feat: hide CVE checks that arebirrelevant for current arch
CVE_REGISTRY gains an optional fifth field that tags checks as x86-only or arm-only, untagged entries apply everywhere. The main CVE dispatcher and the affectedness summary both skip gated entries in default "all CVEs" runs, removing the noise of arm64 errata on x86 hosts and of x86 CVEs on ARM hosts across text, json, nrpe and prometheus outputs. Explicit --cve/--variant/--errata selection bypasses the gate so manual queries still run anywhere. The gate honours no-hw mode by ignoring the host CPU and keying off the inspected kernel's architecture only, which handles cross-arch offline analysis driven by --kernel/--config/--map.
This commit is contained in:
+12
-3
@@ -43,10 +43,19 @@ if [ "$g_mode" = hw-only ]; then
|
||||
pr_info "Hardware-only mode, skipping vulnerability checks"
|
||||
else
|
||||
for cve in $g_supported_cve_list; do
|
||||
if [ "$opt_cve_all" = 1 ] || echo "$opt_cve_list" | grep -qw "$cve"; then
|
||||
check_"$(echo "$cve" | tr - _)"
|
||||
pr_info
|
||||
# In a default "all CVEs" run, skip checks whose arch tag doesn't match
|
||||
# the host CPU or the inspected kernel. Explicit --cve/--variant/--errata
|
||||
# selection bypasses the gate.
|
||||
if [ "$opt_cve_all" = 1 ]; then
|
||||
if ! _is_cve_relevant_arch "$cve"; then
|
||||
pr_debug "main: skipping $cve (arch tag not relevant)"
|
||||
continue
|
||||
fi
|
||||
elif ! echo "$opt_cve_list" | grep -qw "$cve"; then
|
||||
continue
|
||||
fi
|
||||
check_"$(echo "$cve" | tr - _)"
|
||||
pr_info
|
||||
done
|
||||
fi # g_mode != hw-only
|
||||
|
||||
|
||||
Reference in New Issue
Block a user