From 4307cad8a9b1cd66e27f58ae92f93986f9a87dbe Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 16 May 2023 06:17:54 +0000 Subject: [PATCH] import rasdaemon-0.6.1-13.el8 --- ...cc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch | 71 +++++++++++++++++++ ...041e0abfa20054ff5d6874ffbd1ab592558d.patch | 28 ++++++++ ...7ec14a11764fedfea50bd4d96ddda43c7fc1.patch | 24 +++++++ SPECS/rasdaemon.spec | 11 ++- 4 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 SOURCES/899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch create mode 100644 SOURCES/ce33041e0abfa20054ff5d6874ffbd1ab592558d.patch create mode 100644 SOURCES/e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch diff --git a/SOURCES/899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch b/SOURCES/899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch new file mode 100644 index 0000000..8f26b51 --- /dev/null +++ b/SOURCES/899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch @@ -0,0 +1,71 @@ +commit 899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d +Author: Aristeu Rozanski +Date: Thu Jan 19 08:45:57 2023 -0500 + + rasdaemon: ras-report: fix possible but unlikely file descriptor leak + + Found with covscan. + + Signed-off-by: Aristeu Rozanski + Signed-off-by: Mauro Carvalho Chehab + +--- + ras-report.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- rasdaemon-0.6.1.orig/ras-report.c 2023-01-23 11:36:20.972368760 -0500 ++++ rasdaemon-0.6.1/ras-report.c 2023-01-23 11:36:23.236343267 -0500 +@@ -374,7 +374,7 @@ if(rc < 0){ + + mc_fail: + +- if(sockfd > 0){ ++ if(sockfd >= 0){ + close(sockfd); + } + +@@ -424,7 +424,7 @@ if(rc < 0){ + + aer_fail: + +- if(sockfd > 0){ ++ if(sockfd >= 0){ + close(sockfd); + } + +@@ -473,7 +473,7 @@ rc = 0; + + non_standard_fail: + +- if(sockfd > 0){ ++ if(sockfd >= 0){ + close(sockfd); + } + +@@ -518,7 +518,7 @@ rc = 0; + + arm_fail: + +- if(sockfd > 0){ ++ if(sockfd >= 0){ + close(sockfd); + } + +@@ -564,7 +564,7 @@ if(rc < 0){ + + mce_fail: + +- if(sockfd > 0){ ++ if(sockfd >= 0){ + close(sockfd); + } + +@@ -609,7 +609,7 @@ if (rc < 0) + done = 1; + + mf_fail: +- if (sockfd > 0) ++ if (sockfd >= 0) + close(sockfd); + + if (done) diff --git a/SOURCES/ce33041e0abfa20054ff5d6874ffbd1ab592558d.patch b/SOURCES/ce33041e0abfa20054ff5d6874ffbd1ab592558d.patch new file mode 100644 index 0000000..49b4ee1 --- /dev/null +++ b/SOURCES/ce33041e0abfa20054ff5d6874ffbd1ab592558d.patch @@ -0,0 +1,28 @@ +commit ce33041e0abfa20054ff5d6874ffbd1ab592558d +Author: Aristeu Rozanski +Date: Thu Jan 19 08:45:57 2023 -0500 + + rasdaemon: ras-memory-failure-handler: handle localtime() failure correctly + + We could just have an empty string but keeping the format could prevent + issues if someone is actually parsing this. + Found with covscan. + + v2: fixed the timestamp as pointed by Robert Elliott + + Signed-off-by: Aristeu Rozanski + Signed-off-by: Mauro Carvalho Chehab + +diff --git a/ras-memory-failure-handler.c b/ras-memory-failure-handler.c +index 9941e68..1951456 100644 +--- a/ras-memory-failure-handler.c ++++ b/ras-memory-failure-handler.c +@@ -148,6 +148,8 @@ int ras_memory_failure_event_handler(struct trace_seq *s, + if (tm) + strftime(ev.timestamp, sizeof(ev.timestamp), + "%Y-%m-%d %H:%M:%S %z", tm); ++ else ++ strncpy(ev.timestamp, "1970-01-01 00:00:00 +0000", sizeof(ev.timestamp)); + trace_seq_printf(s, "%s ", ev.timestamp); + + if (pevent_get_field_val(s, event, "pfn", record, &val, 1) < 0) diff --git a/SOURCES/e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch b/SOURCES/e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch new file mode 100644 index 0000000..9135e08 --- /dev/null +++ b/SOURCES/e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch @@ -0,0 +1,24 @@ +commit e8b97ec14a11764fedfea50bd4d96ddda43c7fc1 +Author: Aristeu Rozanski +Date: Thu Jan 19 08:45:57 2023 -0500 + + rasdaemon: mce-amd-smca: properly limit bank types + + Found with covscan. + + Signed-off-by: Aristeu Rozanski + Signed-off-by: Mauro Carvalho Chehab + +diff --git a/mce-amd-smca.c b/mce-amd-smca.c +index f3379fc..27ca8aa 100644 +--- a/mce-amd-smca.c ++++ b/mce-amd-smca.c +@@ -584,7 +584,7 @@ static void decode_smca_error(struct mce_event *e) + return; + } + +- if (bank_type >= MAX_NR_BANKS) { ++ if (bank_type >= N_SMCA_BANK_TYPES) { + strcpy(e->mcastatus_msg, "Don't know how to decode this bank"); + return; + } diff --git a/SPECS/rasdaemon.spec b/SPECS/rasdaemon.spec index d4cf19d..0875add 100644 --- a/SPECS/rasdaemon.spec +++ b/SPECS/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.6.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: Utility to receive RAS error tracings Group: Applications/System License: GPLv2 @@ -44,6 +44,9 @@ Patch17: 16d929b024c31d54a7f8a72eab094376c7be27f5.patch Patch18: b497a3d6a39d402c41065e9284d49114b97e3bfe.patch Patch19: ce6e7864f11f709c4f803828fbc8e507d115d03b.patch Patch20: a8c776ed94f68ae31d7b5f74e19545698898c13c.patch +Patch21: 899fcc2cf21c86b5462c8f4441cd9c92b3d75f7d.patch +Patch22: e8b97ec14a11764fedfea50bd4d96ddda43c7fc1.patch +Patch23: ce33041e0abfa20054ff5d6874ffbd1ab592558d.patch %description %{name} is a RAS (Reliability, Availability and Serviceability) logging tool. @@ -77,6 +80,9 @@ an utility for reporting current error counts from the EDAC sysfs files. %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 +%patch22 -p1 +%patch23 -p1 # The tarball is locked in time the first time aclocal was ran and will keep # requiring an older version of automake @@ -107,6 +113,9 @@ rm INSTALL %{buildroot}/usr/include/*.h %{_sysconfdir}/ras/dimm_labels.d %changelog +* Mon Jan 23 2023 Aristeu Rozanski 0.6.1-13 +- Fixing covscan issues [2073516] + * Tue Oct 12 2021 Aristeu Rozanski 0.6.1-12 - Adding missing bits from b497a3d6a39d402c41065e9284d49114b97e3bfe [1923254]