ras-events:quitloopread_ras_eventwhenkbufdataisbroken
This commit is contained in:
parent
20a3c5acca
commit
9673ae5fce
@ -0,0 +1,41 @@
|
||||
From d439975850f947ced01423dc4bb4d6406022b4e1 Mon Sep 17 00:00:00 2001
|
||||
From: hubin <hubin73@huawei.com>
|
||||
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 <hubin73@huawei.com>
|
||||
---
|
||||
ras-events.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/ras-events.c b/ras-events.c
|
||||
index 1479732..11ecb4d 100644
|
||||
--- a/ras-events.c
|
||||
+++ b/ras-events.c
|
||||
@@ -498,6 +498,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);
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: rasdaemon
|
||||
Version: 0.6.7
|
||||
Release: 12
|
||||
Release: 13
|
||||
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
|
||||
@ -52,7 +52,7 @@ Patch9003: 0001-rasdaemon-fix-return-value-type-issue-of-read-write-.patch
|
||||
Patch9004: 0002-rasdaemon-fix-issue-of-signed-and-unsigned-integer-c.patch
|
||||
Patch9005: 0003-rasdaemon-Add-support-for-creating-the-vendor-error-.patch
|
||||
Patch9006: 0004-rasdaemon-Add-four-modules-supported-by-HiSilicon-co.patch
|
||||
|
||||
Patch9007: fix-ras-events-quit-loop-in-read_ras_event-when-kbuf-dat.patch
|
||||
|
||||
%description
|
||||
The rasdaemon program is a daemon which monitors the platform
|
||||
@ -98,6 +98,12 @@ rm INSTALL %{buildroot}/usr/include/*.h
|
||||
/usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || :
|
||||
|
||||
%changelog
|
||||
* Tue Jun 20 2023 zhangnan <zhangnan134@huawei.com> - 0.6.7-13
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:ras-events:quit loop read_ras_event when kbuf data is broken
|
||||
|
||||
* Fri Jun 2 2023 Shiju Jose<shiju.jose@huawei.com> - 0.6.7-12
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user