diff --git a/backport-mce-amd-smca-update-smca_hwid-to-use-smca_bank_types.patch b/backport-mce-amd-smca-update-smca_hwid-to-use-smca_bank_types.patch new file mode 100644 index 0000000000000000000000000000000000000000..8dbcc413fe1458d376037ebf7a19ec35d6947757 --- /dev/null +++ b/backport-mce-amd-smca-update-smca_hwid-to-use-smca_bank_types.patch @@ -0,0 +1,43 @@ +From 7ed2da7aedf8bc8ad4c4efe7acbda60ba061be6e Mon Sep 17 00:00:00 2001 +From: Aristeu Rozanski +Date: Tue, 9 Apr 2024 10:06:30 -0400 +Subject: [PATCH] mce-amd-smca: update smca_hwid to use smca_bank_types + +bank_type is used as smca_bank_types everywhere, there's no point in +declaring it as unsigned int. It also upsets covscan: + + 3. rasdaemon-0.6.7/mce-amd-smca.c:914: assignment: Assigning: "bank_type" = "s_hwid->bank_type". + 7. rasdaemon-0.6.7/mce-amd-smca.c:926: cond_at_most: Checking "bank_type >= 64U" implies that "bank_type" and "s_hwid->bank_type" may be up to 63 on the false branch. + 14. rasdaemon-0.6.7/mce-amd-smca.c:942: overrun-local: Overrunning array "smca_mce_descs" of 38 16-byte elements at element index 63 (byte offset 1023) using index "bank_type" (which evaluates to 63). + # 940| /* Only print the descriptor of valid extended error code */ + # 941| if (xec < smca_mce_descs[bank_type].num_descs) + # 942|-> mce_snprintf(e->mcastatus_msg, + # 943| "%s. Ext Err Code: %d", + # 944| smca_mce_descs[bank_type].descs[xec], + +Signed-off-by: Aristeu Rozanski +Signed-off-by: Mauro Carvalho Chehab + +Conflict: N/A +Reference: https://github.com/mchehab/rasdaemon/commit/7ed2da7aedf8bc8ad4c4efe7acbda60ba061be6e + +--- + mce-amd-smca.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mce-amd-smca.c b/mce-amd-smca.c +index 7521ff7..6632663 100644 +--- a/mce-amd-smca.c ++++ b/mce-amd-smca.c +@@ -706,7 +706,7 @@ static struct smca_mce_desc smca_mce_descs[] = { + }; + + struct smca_hwid { +- unsigned int bank_type; /* Use with smca_bank_types for easy indexing.*/ ++ enum smca_bank_types bank_type; + uint32_t mcatype_hwid; /* mcatype,hwid bit 63-32 in MCx_IPID Register*/ + }; + +-- +2.33.0 + diff --git a/rasdaemon.spec b/rasdaemon.spec index 93f90ec857369340a3f359a1237f98a3b177eb09..a28b98d12ffe4c70b11b01c3cc3124c603e19845 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.8.0 -Release: 6 +Release: 7 License: GPLv2 Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events URL: https://github.com/mchehab/rasdaemon.git @@ -36,6 +36,7 @@ Patch9009: 0001-rasdaemon-Fix-for-vendor-errors-are-not-recorded-in-.patch Patch9010: bugfix-fix-cpu-isolate-errors-when-some-cpus-are-.patch Patch9011: backport-ras-events-quit-loop-in-read_ras_event-when-kbuf-data-is-broken.patch Patch9012: backport-Rasdaemon-Fix-autoreconf-build-error.patch +Patch9013: backport-mce-amd-smca-update-smca_hwid-to-use-smca_bank_types.patch %description The rasdaemon program is a daemon which monitors the platform @@ -87,6 +88,12 @@ fi /usr/bin/systemctl disable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Tue Jul 16 2024 wangziliang - 0.8.0-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: backport patches from upstream + * Thu Jul 11 2024 zhangxingrong- - 0.8.0-6 - Type:bugfix - ID:NA