diff --git a/backport-Rasdaemon-Fix-autoreconf-build-error.patch b/backport-Rasdaemon-Fix-autoreconf-build-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..b04467e8300a17bf822e836d5f940d2597a924b0 --- /dev/null +++ b/backport-Rasdaemon-Fix-autoreconf-build-error.patch @@ -0,0 +1,30 @@ +From 2ee6734e95a56dd15879a88e08080db53d6af486 Mon Sep 17 00:00:00 2001 +From: Ayush Jain +Date: Tue, 23 May 2023 12:25:36 +0530 +Subject: [PATCH] Rasdaemon: Fix autoreconf build error + +When building rasdaemon with autoreconf, on certain distros +we see the following error message. +Makefile.am: error: required file './README' not found +Autoreconf looks for README file instead of README.md +Fix this by passing 'foreign' to AM_INIT_AUTOMAKE. + +Signed-off-by: Ayush Jain +Signed-off-by: Mauro Carvalho Chehab +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index ab5697d..7b39f59 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -3,7 +3,7 @@ AM_SILENT_RULES([yes]) + AC_CANONICAL_TARGET + AC_CONFIG_MACRO_DIR([m4]) + AC_CONFIG_HEADERS([config.h]) +-AM_INIT_AUTOMAKE ++AM_INIT_AUTOMAKE([foreign]) + AC_PROG_CC + AC_PROG_INSTALL + LT_INIT diff --git a/backport-ras-events-quit-loop-in-read_ras_event-when-kbuf-data-is-broken.patch b/backport-ras-events-quit-loop-in-read_ras_event-when-kbuf-data-is-broken.patch new file mode 100644 index 0000000000000000000000000000000000000000..e32251bce7ce46e7aeb23adb33a3ffd208c49462 --- /dev/null +++ b/backport-ras-events-quit-loop-in-read_ras_event-when-kbuf-data-is-broken.patch @@ -0,0 +1,38 @@ +From 794530fbf270eae9f6f43c6d0bbd3ec6f2b210f3 Mon Sep 17 00:00:00 2001 +From: hubin +Date: Thu, 18 May 2023 16:14:41 +0800 +Subject: [PATCH] ras-events: quit loop in read_ras_event when kbuf data is + broken + +when kbuf data is broken, kbuffer_next_event() may move kbuf->index back to +the current kbuf->index position, causing dead loop. + +In this situation, rasdaemon will repeatedly parse an invalid event, and +print warning like "ug! negative record size -8!", pushing cpu utilization +rate to 100%. + +when kbuf data is broken, discard current page and continue reading next page +kbuf. + +Signed-off-by: hubin +Signed-off-by: Mauro Carvalho Chehab +--- + ras-events.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/ras-events.c b/ras-events.c +index 2662467..fced7ab 100644 +--- a/ras-events.c ++++ b/ras-events.c +@@ -512,6 +512,11 @@ static int read_ras_event_all_cpus(struct pthread_data *pdata, + kbuffer_load_subbuffer(kbuf, page); + + while ((data = kbuffer_read_event(kbuf, &time_stamp))) { ++ if (kbuffer_curr_size(kbuf) < 0) { ++ log(TERM, LOG_ERR, "invalid kbuf data, discard\n"); ++ break; ++ } ++ + parse_ras_data(&pdata[i], + kbuf, data, time_stamp); + diff --git a/rasdaemon.spec b/rasdaemon.spec index 636050fe6dcd172b7e2a2cf97d1422db0291f93e..93f90ec857369340a3f359a1237f98a3b177eb09 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.8.0 -Release: 5 +Release: 6 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 @@ -34,6 +34,8 @@ Patch9007: backport-Check-CPUs-online-not-configured.patch Patch9008: backport-rasdaemon-diskerror-fix-incomplete-diskerror-log.patch 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 %description The rasdaemon program is a daemon which monitors the platform @@ -85,6 +87,12 @@ fi /usr/bin/systemctl disable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Thu Jul 11 2024 zhangxingrong- - 0.8.0-6 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:ras-events: quit loop in read_ras_event when kbuf data is broken and Rasdaemon: Fix autoreconf build error + * Thu Apr 25 2024 yangjunshuo - 0.8.0-5 - Type:bugfix - ID:NA