2 Commits

9 changed files with 103 additions and 110 deletions

View File

@@ -1,39 +0,0 @@
From: Thomas Renninger <trenn@suse.de>
Subject: Fix buffer overflow in add_event_handler read
References: bsc#1241567
Patch-Mainline: not yet
Git-commit: 46bed1b6845bcb560d760b4cacea7df67cd6d1fd
If the first read in ras-events.c:862 is successful, it will be tried
to read more out of the fd, without re-allocating more memory.
Submitted mainline:
https://github.com/mchehab/rasdaemon/pull/212
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: <trenn@suse.de>
diff --git a/ras-events.c b/ras-events.c
index 6692a31..c7ee801 100644
--- a/ras-events.c
+++ b/ras-events.c
@@ -859,6 +859,17 @@ static int add_event_handler(struct ras_events *ras, struct tep_handle *pevent,
}
do {
+ if (size > 0) {
+ page = realloc(page, page_size + size);
+ if (!page) {
+ rc = -errno;
+ log(TERM, LOG_ERR,
+ "Can't reallocate page to read %s:%s"
+ " format\n", group, event);
+ close(fd);
+ return rc;
+ }
+ }
rc = read(fd, page + size, page_size);
if (rc < 0) {
log(TERM, LOG_ERR, "Can't get arch page size\n");

View File

@@ -1,14 +1,14 @@
<services>
<service name="obs_scm" mode="localonly">
<service name="obs_scm" mode="manual">
<param name="url">git://git.infradead.org/users/mchehab/rasdaemon.git</param>
<param name="scm">git</param>
<param name="changesgenerate">enable</param>
<param name="filename">rasdaemon</param>
<param name="revision">master</param>
<param name="versionformat">@PARENT_TAG@.@TAG_OFFSET@.git+%h</param>
<param name="versionformat">@PARENT_TAG@+git@TAG_OFFSET@.%h</param>
<param name="versionrewrite-pattern">v(.*)</param>
</service>
<service name="set_version" mode="localonly"/>
<service name="set_version" mode="manual"/>
<service name="tar" mode="buildtime"/>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>

View File

@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://git.infradead.org/users/mchehab/rasdaemon.git</param>
<param name="changesrevision">db0870edd2919f4f4d0101843136bcae92ab0743</param></service></servicedata>
<param name="changesrevision">485d0a6f81c9e80a40bea5d0745fb65c209a0a1c</param></service></servicedata>

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:76f95888c2a907fef93063d430df4b7a2332f47466e70a9910141bbaada75c0f
size 1147916

View File

@@ -1,54 +0,0 @@
From: Ruidong Tian <tianruidong@linux.alibaba.com>
Subject: rasdaemon: skip doesn't exist event
References: jsc#1241567
Patch-Mainline:
Git-commit: 3615602544e47240ddb5784342ed51ea14213ca9
When compiling rasdaemon with the --enable-all configuration flag,
the system may detect unsupported hardware events - for instance,
ARM-specific events on x86 architectures. This causes the program
to enter a busy-wait loop in the wait_access function. A better
approach would be to explicitly skip these architecture-mismatched
events during initialization.
Signed-off-by: Ruidong Tian <tianruidong@linux.alibaba.com>
Signed-off-by: <trenn@suse.de>
diff --git a/ras-events.c b/ras-events.c
index c7ee801..46ae519 100644
--- a/ras-events.c
+++ b/ras-events.c
@@ -821,6 +821,18 @@ static int select_tracing_timestamp(struct ras_events *ras)
return 0;
}
+static bool check_event_exist(struct ras_events *ras, char *group, char *event)
+{
+ char fname[MAX_PATH + 256];
+
+ snprintf(fname, sizeof(fname), "%s/tracing/events/%s/%s",
+ ras->debugfs, group, event);
+ if (access(fname, F_OK) == 0)
+ return true;
+
+ return false;
+}
+
#define EVENT_DISABLED 1
static int add_event_handler(struct ras_events *ras, struct tep_handle *pevent,
@@ -832,6 +844,12 @@ static int add_event_handler(struct ras_events *ras, struct tep_handle *pevent,
char *page, fname[MAX_PATH + 1];
struct tep_event_filter *filter = NULL;
+ if (!check_event_exist(ras, group, event)) {
+ log(ALL, LOG_WARNING, "%s:%s event not exist\n",
+ group, event);
+ return -EINVAL;
+ }
+
snprintf(fname, sizeof(fname), "events/%s/%s/format", group, event);
fd = open_trace(ras, fname, O_RDONLY);

View File

@@ -1,3 +1,65 @@
-------------------------------------------------------------------
Thu Jan 8 23:53:40 UTC 2026 - Marcus Rueckert <mrueckert@suse.de>
- do not use enable-all. it enables signal mode which causes errors
as the needed columns are not created in the table.
-------------------------------------------------------------------
Thu Jan 8 23:10:35 UTC 2026 - Marcus Rueckert <mrueckert@suse.de>
- Update to version 0.8.4+git11.485d0a6:
* rasdaemon: Add support for the CXL memory sparing events
* Revert "rasdaemon: Add support for the CXL memory sparing events"
* Add labels for ASRock X570 Pro4
* rasdaemon: ras-aer-handlder: Add support for AER triggers
* rasdaemon: ras-events: Fix event's file endianness
* rasdaemon: ras-events: Don't hardcode long size
* ci.yml: add a second config to Ubuntu variations
* ci.yml: add a Fedora target
* cy.yml: ignore false-positives
* types.c: add a missing new line at the end of the file
* .github/workflows/ci.yml: add libpci-dev
* rasdaemon: bump to version 0.8.4
* misc/rasdaemon.spec.in: add install rules for completions file
* Makefile.am: package completions at the source tarball
* ras-events.c: do some coding style fixes
* unified-sel.c: use tabs instead of spaces for indent
* Makefile.am: sort if groups
* Makefile.am: use one file per line, in alphabetic order
* INSTALL: update it with the autogenerated one from new autotools
* rasdaemon: Fix CPU isolate errors with limited CPUs at startup
* rasdaemon: Update the supported modules in the HiSilicon common section
* rasdaemon: Add support for the CXL memory sparing events
* rasdaemon: cxl: Add validity check for parsing and logging the corrected memory error threshold event flags and error count
* rasdaemon: cxl: Update handling of Common Event Record to CXL spec rev3.2
* rasdaemon: fix post-processing options
* rasdaemon: cxl: Add validity check for parse and log hdr_maint_op_sub_class field
* rasdaemon: cxl: Update ras-report.c with missing maintenance operation subclass information
* rasdaemon: cxl: Add parse and log linear cache address alias emission for cxl events
* Makefile.am: install completions files
* add completions files for zsh and bash
* ras-events: Revert page_size to 4096 in get_pagesize()
* ras-events: fix for return error code in add_event_handler()
* ras-events: fix buffer overflow in add_event_handler read
* unified-sel: added AER Uncorrectable Error reporting to SEL on OpenBMC
* Fix spelling and grammar errors in README.md
* Fix a couple of coding style issues
* rasdaemon: add event level for event record
* aer: print pci device name and vendor/device id
* rasdaemon: erst: decode panic mce through erst
* rasdaemon: introduce poison page statistics
* rasdaemon: support memory corrected error statistics
* add dmidecode Requires on riscv64 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* rasdaemon: skip doesn't exist event
* config: add rsyslog config
* config: add syslog-ng and logrotate config
* rasdaemon: trace SIGBUS event for hardware error
- drop patches:
- Fix-buffer-overflow-in-add_event_handler-read.patch
- rasdaemon-skip-doesn-t-exist-event.patch
- switch to a more common format for the version string
- switch service to more common manual mode. use osc service mr
-------------------------------------------------------------------
Wed Apr 30 09:17:13 UTC 2025 - Thomas Renninger <trenn@suse.de>

View File

@@ -1,4 +1,4 @@
name: rasdaemon
version: 0.8.3.0.git+db0870e
mtime: 1741604456
commit: db0870edd2919f4f4d0101843136bcae92ab0743
version: 0.8.4+git11.485d0a6
mtime: 1765199728
commit: 485d0a6f81c9e80a40bea5d0745fb65c209a0a1c

View File

@@ -1,7 +1,7 @@
#
# spec file for package rasdaemon
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2026 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,21 +17,20 @@
Name: rasdaemon
Version: 0.8.3.0.git+db0870e
Version: 0.8.4+git11.485d0a6
Release: 0
Summary: Utility to receive RAS error tracings
License: GPL-2.0-only
Group: Hardware/Other
URL: http://git.infradead.org/users/mchehab/rasdaemon.git
Source: %{name}-%{version}.tar.xz
Patch1: Fix-buffer-overflow-in-add_event_handler-read.patch
Patch2: rasdaemon-skip-doesn-t-exist-event.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gettext-devel
BuildRequires: libtool
BuildRequires: libtraceevent-devel
BuildRequires: sqlite3-devel
BuildRequires: pkgconfig(libpci)
Requires: perl-DBD-SQLite
Requires(pre): %fillup_prereq
%{?systemd_ordering}
@@ -60,9 +59,30 @@ an utility for reporting current error counts from the EDAC sysfs files.
# on old autoconf versions
ln -s README.md README
autoreconf -fvi
%configure --enable-all \
--with-sysconfdefdir=%{_sysconfdir}/sysconfig
CFLAGS="%{optflags}" make %{?_smp_mflags} V=1
%configure \
--enable-sqlite3 \
--enable-aer \
--enable-non-standard \
--enable-arm \
--enable-mce \
--enable-extlog \
--enable-devlink \
--enable-diskerror \
--enable-memory-failure \
--enable-cxl \
--enable-abrt-report \
--enable-hisi-ns-decode \
--enable-memory-ce-pfa \
--enable-memory-row-ce-pfa \
--enable-amp-ns-decode \
--enable-openbmc-unified-sel \
--enable-jaguar-ns-decode \
--enable-cpu-fault-isolation \
--enable-yitian-ns-decode \
--disable-signal \
--enable-erst \
--with-sysconfdefdir=%{_sysconfdir}/sysconfig
make %{?_smp_mflags} V=1
%install
%make_install
@@ -106,5 +126,9 @@ mv %{buildroot}%{_sysconfdir}/sysconfig/rasdaemon %{buildroot}/%{_fillupdir}/sys
%dir %{_localstatedir}/lib/rasdaemon
%ghost %{_localstatedir}/lib/rasdaemon/ras-mc_event.db
%attr (644,root,root) %{_fillupdir}/sysconfig.rasdaemon
%{_datadir}/bash-completion/completions/ras-mc-ctl
%dir %{_datadir}/zsh/
%dir %{_datadir}/zsh/site-functions/
%{_datadir}/zsh/site-functions/_ras-mc-ctl
%changelog