3 Commits

Author SHA1 Message Date
speed47
4b9ea5767e update: fwdb from v347+i20251110+615b to v348+i20260227+615b, 49 microcode changes 2026-02-28 09:47:55 +00:00
Stéphane Lesimple
a20641fbad fix: handle non-numeric ARM CPU architecture values
Some old ARM processors (e.g., ARM926EJ-S) report CPU architecture
with suffix in /proc/cpuinfo (e.g., "5TEJ" for ARMv5TEJ).

This caused an "integer expression expected" error when comparing
against numeric values. Extract the numeric prefix before integer comparisons.

Fixes #505.
2026-01-25 12:57:41 +01:00
Stéphane Lesimple
d550ea8c85 fix: harmless 'dmesg: write error' that could happen on some systems
Fixes #519.
2026-01-25 11:53:13 +01:00

View File

@@ -668,6 +668,8 @@ is_cpu_affected()
_debug "checking cpu$i: <$cpupart> <$cpuarch>" _debug "checking cpu$i: <$cpupart> <$cpuarch>"
# some kernels report AArch64 instead of 8 # some kernels report AArch64 instead of 8
[ "$cpuarch" = "AArch64" ] && cpuarch=8 [ "$cpuarch" = "AArch64" ] && cpuarch=8
# some kernels report architecture with suffix (e.g. "5TEJ" for ARMv5TEJ), extract numeric prefix
cpuarch=$(echo "$cpuarch" | grep -oE '^[0-9]+')
if [ -n "$cpupart" ] && [ -n "$cpuarch" ]; then if [ -n "$cpupart" ] && [ -n "$cpuarch" ]; then
# Cortex-R7 and Cortex-R8 are real-time and only used in medical devices or such # Cortex-R7 and Cortex-R8 are real-time and only used in medical devices or such
# I can't find their CPU part number, but it's probably not that useful anyway # I can't find their CPU part number, but it's probably not that useful anyway
@@ -1889,11 +1891,11 @@ dmesg_grep()
# grep for something in dmesg, ensuring that the dmesg buffer # grep for something in dmesg, ensuring that the dmesg buffer
# has not been truncated # has not been truncated
dmesg_grepped='' dmesg_grepped=''
if ! dmesg | grep -qE -e '(^|\] )Linux version [0-9]' -e '^FreeBSD is a registered' ; then if ! dmesg 2>/dev/null | grep -qE -e '(^|\] )Linux version [0-9]' -e '^FreeBSD is a registered' ; then
# dmesg truncated # dmesg truncated
return 2 return 2
fi fi
dmesg_grepped=$(dmesg | grep -E "$1" | head -n1) dmesg_grepped=$(dmesg 2>/dev/null | grep -E "$1" | head -n1)
# not found: # not found:
[ -z "$dmesg_grepped" ] && return 1 [ -z "$dmesg_grepped" ] && return 1
# found, output is in $dmesg_grepped # found, output is in $dmesg_grepped
@@ -2020,13 +2022,13 @@ write_msr_one_core()
msr_locked_down=1 msr_locked_down=1
write_msr_msg="your kernel is configured to deny writes to MSRs from user space" write_msr_msg="your kernel is configured to deny writes to MSRs from user space"
return $WRITE_MSR_RET_LOCKDOWN return $WRITE_MSR_RET_LOCKDOWN
elif dmesg | grep -qF "msr: Direct access to MSR"; then elif dmesg 2>/dev/null | grep -qF "msr: Direct access to MSR"; then
_debug "write_msr: locked down kernel detected (Red Hat / Fedora)" _debug "write_msr: locked down kernel detected (Red Hat / Fedora)"
mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_WRMSR_${_msr}_RET=$WRITE_MSR_RET_LOCKDOWN") mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_WRMSR_${_msr}_RET=$WRITE_MSR_RET_LOCKDOWN")
msr_locked_down=1 msr_locked_down=1
write_msr_msg="your kernel is locked down (Fedora/Red Hat), please reboot without secure boot and retry" write_msr_msg="your kernel is locked down (Fedora/Red Hat), please reboot without secure boot and retry"
return $WRITE_MSR_RET_LOCKDOWN return $WRITE_MSR_RET_LOCKDOWN
elif dmesg | grep -qF "raw MSR access is restricted"; then elif dmesg 2>/dev/null | grep -qF "raw MSR access is restricted"; then
_debug "write_msr: locked down kernel detected (vanilla)" _debug "write_msr: locked down kernel detected (vanilla)"
mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_WRMSR_${_msr}_RET=$WRITE_MSR_RET_LOCKDOWN") mockme=$(printf "%b\n%b" "$mockme" "SMC_MOCK_WRMSR_${_msr}_RET=$WRITE_MSR_RET_LOCKDOWN")
msr_locked_down=1 msr_locked_down=1
@@ -2217,12 +2219,12 @@ parse_cpu_details()
cpu_stepping=$(grep '^stepping' "$procfs/cpuinfo" | awk '{print $3}' | grep -E '^[0-9]+$' | head -n1) cpu_stepping=$(grep '^stepping' "$procfs/cpuinfo" | awk '{print $3}' | grep -E '^[0-9]+$' | head -n1)
cpu_ucode=$( grep '^microcode' "$procfs/cpuinfo" | awk '{print $3}' | head -n1) cpu_ucode=$( grep '^microcode' "$procfs/cpuinfo" | awk '{print $3}' | head -n1)
else else
cpu_vendor=$( dmesg | grep -i -m1 'Origin=' | cut -f2 -w | cut -f2 -d= | cut -f2 -d\" ) cpu_vendor=$( dmesg 2>/dev/null | grep -i -m1 'Origin=' | cut -f2 -w | cut -f2 -d= | cut -f2 -d\" )
cpu_family=$( dmesg | grep -i -m1 'Family=' | cut -f4 -w | cut -f2 -d= ) cpu_family=$( dmesg 2>/dev/null | grep -i -m1 'Family=' | cut -f4 -w | cut -f2 -d= )
cpu_family=$(( cpu_family )) cpu_family=$(( cpu_family ))
cpu_model=$( dmesg | grep -i -m1 'Model=' | cut -f5 -w | cut -f2 -d= ) cpu_model=$( dmesg 2>/dev/null | grep -i -m1 'Model=' | cut -f5 -w | cut -f2 -d= )
cpu_model=$(( cpu_model )) cpu_model=$(( cpu_model ))
cpu_stepping=$( dmesg | grep -i -m1 'Stepping=' | cut -f6 -w | cut -f2 -d= ) cpu_stepping=$( dmesg 2>/dev/null | grep -i -m1 'Stepping=' | cut -f6 -w | cut -f2 -d= )
cpu_friendly_name=$(sysctl -n hw.model 2>/dev/null) cpu_friendly_name=$(sysctl -n hw.model 2>/dev/null)
fi fi
@@ -4863,7 +4865,7 @@ check_CVE_2017_5754_linux()
kpti_enabled=$(cat /sys/kernel/debug/x86/pti_enabled 2>/dev/null) kpti_enabled=$(cat /sys/kernel/debug/x86/pti_enabled 2>/dev/null)
_debug "kpti_enabled: file /sys/kernel/debug/x86/pti_enabled exists and says: $kpti_enabled" _debug "kpti_enabled: file /sys/kernel/debug/x86/pti_enabled exists and says: $kpti_enabled"
elif is_xen_dom0; then elif is_xen_dom0; then
pti_xen_pv_domU=$(xl dmesg | grep 'XPTI' | grep 'DomU enabled' | head -n1) pti_xen_pv_domU=$(xl dmesg 2>/dev/null | grep 'XPTI' | grep 'DomU enabled' | head -n1)
[ -n "$pti_xen_pv_domU" ] && kpti_enabled=1 [ -n "$pti_xen_pv_domU" ] && kpti_enabled=1
fi fi
@@ -5481,9 +5483,9 @@ check_CVE_2018_3646_linux()
pstatus green YES "unconditional flushes" pstatus green YES "unconditional flushes"
else else
if is_xen_dom0; then if is_xen_dom0; then
l1d_xen_hardware=$(xl dmesg | grep 'Hardware features:' | grep 'L1D_FLUSH' | head -n1) l1d_xen_hardware=$(xl dmesg 2>/dev/null | grep 'Hardware features:' | grep 'L1D_FLUSH' | head -n1)
l1d_xen_hypervisor=$(xl dmesg | grep 'Xen settings:' | grep 'L1D_FLUSH' | head -n1) l1d_xen_hypervisor=$(xl dmesg 2>/dev/null | grep 'Xen settings:' | grep 'L1D_FLUSH' | head -n1)
l1d_xen_pv_domU=$(xl dmesg | grep 'PV L1TF shadowing:' | grep 'DomU enabled' | head -n1) l1d_xen_pv_domU=$(xl dmesg 2>/dev/null | grep 'PV L1TF shadowing:' | grep 'DomU enabled' | head -n1)
if [ -n "$l1d_xen_hardware" ] && [ -n "$l1d_xen_hypervisor" ] && [ -n "$l1d_xen_pv_domU" ]; then if [ -n "$l1d_xen_hardware" ] && [ -n "$l1d_xen_hypervisor" ] && [ -n "$l1d_xen_pv_domU" ]; then
l1d_mode=5 l1d_mode=5
@@ -6882,7 +6884,7 @@ exit 0 # ok
# with X being either I for Intel, or A for AMD # with X being either I for Intel, or A for AMD
# When the date is unknown it defaults to 20000101 # When the date is unknown it defaults to 20000101
# %%% MCEDB v347+i20251110+615b # %%% MCEDB v348+i20260227+615b
# I,0x00000611,0xFF,0x00000B27,19961218 # I,0x00000611,0xFF,0x00000B27,19961218
# I,0x00000612,0xFF,0x000000C6,19961210 # I,0x00000612,0xFF,0x000000C6,19961210
# I,0x00000616,0xFF,0x000000C6,19961210 # I,0x00000616,0xFF,0x000000C6,19961210
@@ -7220,9 +7222,9 @@ exit 0 # ok
# I,0x000606A0,0xFF,0x80000031,20200308 # I,0x000606A0,0xFF,0x80000031,20200308
# I,0x000606A4,0xFF,0x0B000280,20200817 # I,0x000606A4,0xFF,0x0B000280,20200817
# I,0x000606A5,0x87,0x0C0002F0,20210308 # I,0x000606A5,0x87,0x0C0002F0,20210308
# I,0x000606A6,0x87,0x0D000410,20250311 # I,0x000606A6,0x87,0x0D000421,20250819
# I,0x000606C0,0xFF,0xFD000220,20210629 # I,0x000606C0,0xFF,0xFD000220,20210629
# I,0x000606C1,0x10,0x010002E0,20250306 # I,0x000606C1,0x10,0x010002F1,20250819
# I,0x000606E0,0xFF,0x0000000B,20161104 # I,0x000606E0,0xFF,0x0000000B,20161104
# I,0x000606E1,0xFF,0x00000108,20190423 # I,0x000606E1,0xFF,0x00000108,20190423
# I,0x000606E4,0xFF,0x0000000C,20190124 # I,0x000606E4,0xFF,0x0000000C,20190124
@@ -7234,7 +7236,7 @@ exit 0 # ok
# I,0x000706E2,0xFF,0x00000042,20190420 # I,0x000706E2,0xFF,0x00000042,20190420
# I,0x000706E3,0xFF,0x81000008,20181002 # I,0x000706E3,0xFF,0x81000008,20181002
# I,0x000706E4,0xFF,0x00000046,20190905 # I,0x000706E4,0xFF,0x00000046,20190905
# I,0x000706E5,0x80,0x000000CA,20250107 # I,0x000706E5,0x80,0x000000CC,20250724
# I,0x00080650,0xFF,0x00000018,20180108 # I,0x00080650,0xFF,0x00000018,20180108
# I,0x00080664,0xFF,0x4C000025,20230926 # I,0x00080664,0xFF,0x4C000025,20230926
# I,0x00080665,0xFF,0x4C000026,20240228 # I,0x00080665,0xFF,0x4C000026,20240228
@@ -7242,10 +7244,10 @@ exit 0 # ok
# I,0x000806A0,0xFF,0x00000010,20190507 # I,0x000806A0,0xFF,0x00000010,20190507
# I,0x000806A1,0x10,0x00000033,20230113 # I,0x000806A1,0x10,0x00000033,20230113
# I,0x000806C0,0xFF,0x00000068,20200402 # I,0x000806C0,0xFF,0x00000068,20200402
# I,0x000806C1,0x80,0x000000BC,20241201 # I,0x000806C1,0x80,0x000000BE,20250724
# I,0x000806C2,0xC2,0x0000003C,20241201 # I,0x000806C2,0xC2,0x0000003E,20250724
# I,0x000806D0,0xFF,0x00000054,20210507 # I,0x000806D0,0xFF,0x00000054,20210507
# I,0x000806D1,0xC2,0x00000056,20241211 # I,0x000806D1,0xC2,0x00000058,20250724
# I,0x000806E9,0x10,0x000000F6,20240201 # I,0x000806E9,0x10,0x000000F6,20240201
# I,0x000806E9,0xC0,0x000000F6,20240201 # I,0x000806E9,0xC0,0x000000F6,20240201
# I,0x000806EA,0xC0,0x000000F6,20240201 # I,0x000806EA,0xC0,0x000000F6,20240201
@@ -7254,28 +7256,28 @@ exit 0 # ok
# I,0x000806F1,0xFF,0x800003C0,20220327 # I,0x000806F1,0xFF,0x800003C0,20220327
# I,0x000806F2,0xFF,0x8C0004E0,20211112 # I,0x000806F2,0xFF,0x8C0004E0,20211112
# I,0x000806F3,0xFF,0x8D000520,20220812 # I,0x000806F3,0xFF,0x8D000520,20220812
# I,0x000806F4,0x10,0x2C000410,20250529 # I,0x000806F4,0x10,0x2C000421,20250825
# I,0x000806F4,0x87,0x2B000650,20250529 # I,0x000806F4,0x87,0x2B000661,20250825
# I,0x000806F5,0x10,0x2C000410,20250529 # I,0x000806F5,0x10,0x2C000421,20250825
# I,0x000806F5,0x87,0x2B000650,20250529 # I,0x000806F5,0x87,0x2B000661,20250825
# I,0x000806F6,0x10,0x2C000410,20250529 # I,0x000806F6,0x10,0x2C000421,20250825
# I,0x000806F6,0x87,0x2B000650,20250529 # I,0x000806F6,0x87,0x2B000661,20250825
# I,0x000806F7,0x87,0x2B000650,20250529 # I,0x000806F7,0x87,0x2B000661,20250825
# I,0x000806F8,0x10,0x2C000410,20250529 # I,0x000806F8,0x10,0x2C000421,20250825
# I,0x000806F8,0x87,0x2B000650,20250529 # I,0x000806F8,0x87,0x2B000661,20250825
# I,0x00090660,0xFF,0x00000009,20200617 # I,0x00090660,0xFF,0x00000009,20200617
# I,0x00090661,0x01,0x0000001A,20240405 # I,0x00090661,0x01,0x0000001A,20240405
# I,0x00090670,0xFF,0x00000019,20201111 # I,0x00090670,0xFF,0x00000019,20201111
# I,0x00090671,0xFF,0x0000001C,20210614 # I,0x00090671,0xFF,0x0000001C,20210614
# I,0x00090672,0x07,0x0000003D,20251012 # I,0x00090672,0x07,0x0000003E,20251012
# I,0x00090674,0xFF,0x00000219,20210425 # I,0x00090674,0xFF,0x00000219,20210425
# I,0x00090675,0x07,0x0000003D,20251012 # I,0x00090675,0x07,0x0000003E,20251012
# I,0x000906A0,0xFF,0x0000001C,20210614 # I,0x000906A0,0xFF,0x0000001C,20210614
# I,0x000906A1,0xFF,0x0000011F,20211104 # I,0x000906A1,0xFF,0x0000011F,20211104
# I,0x000906A2,0xFF,0x00000315,20220102 # I,0x000906A2,0xFF,0x00000315,20220102
# I,0x000906A3,0x80,0x0000043A,20251012 # I,0x000906A3,0x80,0x0000043B,20251012
# I,0x000906A4,0x40,0x0000000B,20250613 # I,0x000906A4,0x40,0x0000000C,20250710
# I,0x000906A4,0x80,0x0000043A,20251012 # I,0x000906A4,0x80,0x0000043B,20251012
# I,0x000906C0,0x01,0x24000026,20230926 # I,0x000906C0,0x01,0x24000026,20230926
# I,0x000906E9,0x2A,0x000000F8,20230928 # I,0x000906E9,0x2A,0x000000F8,20230928
# I,0x000906EA,0x22,0x000000FA,20240728 # I,0x000906EA,0x22,0x000000FA,20240728
@@ -7291,40 +7293,45 @@ exit 0 # ok
# I,0x000A0660,0x80,0x00000102,20241114 # I,0x000A0660,0x80,0x00000102,20241114
# I,0x000A0661,0x80,0x00000100,20241114 # I,0x000A0661,0x80,0x00000100,20241114
# I,0x000A0670,0xFF,0x0000002C,20201124 # I,0x000A0670,0xFF,0x0000002C,20201124
# I,0x000A0671,0x02,0x00000064,20241201 # I,0x000A0671,0x02,0x00000065,20250724
# I,0x000A0680,0xFF,0x80000002,20200121 # I,0x000A0680,0xFF,0x80000002,20200121
# I,0x000A06A1,0xFF,0x00000017,20230518 # I,0x000A06A1,0xFF,0x00000017,20230518
# I,0x000A06A2,0xFF,0x00000011,20230627 # I,0x000A06A2,0xFF,0x00000011,20230627
# I,0x000A06A4,0xE6,0x00000025,20250319 # I,0x000A06A4,0xE6,0x00000028,20250924
# I,0x000A06C0,0xFF,0x00000013,20230901 # I,0x000A06C0,0xFF,0x00000013,20230901
# I,0x000A06C1,0xFF,0x00000005,20231201 # I,0x000A06C1,0xFF,0x00000005,20231201
# I,0x000A06D0,0xFF,0x10000680,20240818 # I,0x000A06D0,0xFF,0x10000680,20240818
# I,0x000A06D1,0x20,0x0A000124,20250829 # I,0x000A06D1,0x20,0x0A000133,20251009
# I,0x000A06D1,0x95,0x010003F0,20250723 # I,0x000A06D1,0x95,0x01000405,20251031
# I,0x000A06E1,0x97,0x01000273,20250627 # I,0x000A06E1,0x97,0x01000303,20251202
# I,0x000A06F0,0xFF,0x80000360,20240130 # I,0x000A06F0,0xFF,0x80000360,20240130
# I,0x000A06F3,0x01,0x03000382,20250730 # I,0x000A06F3,0x01,0x03000382,20250730
# I,0x000B0650,0x80,0x0000000A,20250318 # I,0x000B0650,0x80,0x0000000D,20250925
# I,0x000B0670,0xFF,0x0000000E,20220220 # I,0x000B0670,0xFF,0x0000000E,20220220
# I,0x000B0671,0x32,0x00000132,20251008 # I,0x000B0671,0x32,0x00000133,20251008
# I,0x000B0674,0x32,0x00000132,20251008 # I,0x000B0674,0x32,0x00000133,20251008
# I,0x000B06A2,0xE0,0x00006133,20251008 # I,0x000B06A2,0xE0,0x00006134,20251008
# I,0x000B06A3,0xE0,0x00006133,20251008 # I,0x000B06A3,0xE0,0x00006134,20251008
# I,0x000B06A8,0xE0,0x00006133,20251008 # I,0x000B06A8,0xE0,0x00006134,20251008
# I,0x000B06D0,0xFF,0x0000001A,20240610 # I,0x000B06D0,0xFF,0x0000001A,20240610
# I,0x000B06D1,0x80,0x00000125,20250828 # I,0x000B06D1,0x80,0x00000125,20250828
# I,0x000B06E0,0x19,0x0000001E,20250516 # I,0x000B06E0,0x19,0x00000021,20250912
# I,0x000B06F2,0x07,0x0000003D,20251012 # I,0x000B06F2,0x07,0x0000003E,20251012
# I,0x000B06F5,0x07,0x0000003D,20251012 # I,0x000B06F5,0x07,0x0000003E,20251012
# I,0x000B06F6,0x07,0x0000003D,20251012 # I,0x000B06F6,0x07,0x0000003E,20251012
# I,0x000B06F7,0x07,0x0000003D,20251012 # I,0x000B06F7,0x07,0x0000003E,20251012
# I,0x000C0652,0x82,0x0000011A,20250630 # I,0x000C0652,0x82,0x0000011B,20250803
# I,0x000C0660,0xFF,0x00000018,20240516 # I,0x000C0660,0xFF,0x00000018,20240516
# I,0x000C0662,0x82,0x0000011A,20250630 # I,0x000C0662,0x82,0x0000011B,20250803
# I,0x000C0664,0x82,0x0000011A,20250630 # I,0x000C0664,0x82,0x0000011B,20250803
# I,0x000C06A2,0x82,0x0000011A,20250630 # I,0x000C06A2,0x82,0x0000011B,20250803
# I,0x000C06F1,0x87,0x210002C0,20250529 # I,0x000C06C0,0xFF,0x00000012,20250325
# I,0x000C06F2,0x87,0x210002C0,20250529 # I,0x000C06C1,0xFF,0x00000115,20251203
# I,0x000C06C2,0xFF,0x00000115,20251203
# I,0x000C06C3,0xFF,0x00000115,20251203
# I,0x000C06F1,0x87,0x210002D3,20250825
# I,0x000C06F2,0x87,0x210002D3,20250825
# I,0x000D0670,0xFF,0x00000003,20250825
# I,0x000D06D0,0xFF,0x00000340,20250807 # I,0x000D06D0,0xFF,0x00000340,20250807
# I,0x00FF0671,0xFF,0x0000010E,20220907 # I,0x00FF0671,0xFF,0x0000010E,20220907
# I,0x00FF0672,0xFF,0x0000000D,20210816 # I,0x00FF0672,0xFF,0x0000000D,20210816
@@ -7459,8 +7466,8 @@ exit 0 # ok
# A,0x00A70FC0,0xFF,0x0A70C00A,20241111 # A,0x00A70FC0,0xFF,0x0A70C00A,20241111
# A,0x00A80F00,0xFF,0x0A80000B,20241122 # A,0x00A80F00,0xFF,0x0A80000B,20241122
# A,0x00A80F01,0xFF,0x0A80010A,20241119 # A,0x00A80F01,0xFF,0x0A80010A,20241119
# A,0x00A90F00,0xFF,0x0A90000B,20241122 # A,0x00A90F00,0xFF,0x0A90000C,20250710
# A,0x00A90F01,0xFF,0x0A90010A,20241113 # A,0x00A90F01,0xFF,0x0A90010D,20250612
# A,0x00AA0F00,0xFF,0x0AA00009,20221006 # A,0x00AA0F00,0xFF,0x0AA00009,20221006
# A,0x00AA0F01,0xFF,0x0AA00116,20230619 # A,0x00AA0F01,0xFF,0x0AA00116,20230619
# A,0x00AA0F02,0xFF,0x0AA0021C,20250612 # A,0x00AA0F02,0xFF,0x0AA0021C,20250612