From 8e33a1dbf245cf9af679348f6143853cdf939898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Sun, 25 Jan 2026 11:18:23 +0100 Subject: [PATCH] fix: set cpu_* vars to a default value On ARM64 systems, /proc/cpuinfo uses different field names (CPU implementer, CPU variant, CPU part, CPU revision) instead of x86-style fields (cpu family, model, stepping). This left these variables empty, causing printf to fail with 'invalid number' errors when formatting them as hex values. Fixes #520. --- spectre-meltdown-checker.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spectre-meltdown-checker.sh b/spectre-meltdown-checker.sh index e6e4f97..b38c5ed 100755 --- a/spectre-meltdown-checker.sh +++ b/spectre-meltdown-checker.sh @@ -2309,6 +2309,11 @@ parse_cpu_details() # if we got no cpu_ucode (e.g. we're in a vm), fall back to 0x0 : "${cpu_ucode:=0x0}" + # on non-x86 systems (e.g. ARM), these fields may not exist in cpuinfo, fall back to 0 + : "${cpu_family:=0}" + : "${cpu_model:=0}" + : "${cpu_stepping:=0}" + if [ -n "${SMC_MOCK_CPU_UCODE:-}" ]; then cpu_ucode="$SMC_MOCK_CPU_UCODE" _debug "parse_cpu_details: MOCKING cpu ucode to $cpu_ucode"