Projects
Eulaceura:Mainline:GA
rasdaemon
_service:obs_scm:backport-ras-events-quit-loop-...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:backport-ras-events-quit-loop-in-read_ras_event-when-kbuf-data-is-broken.patch of Package rasdaemon
From 794530fbf270eae9f6f43c6d0bbd3ec6f2b210f3 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> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> --- 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);
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2