diff --git a/libtracefs-Fix-the-read-file-failure-code-checking.patch b/libtracefs-Fix-the-read-file-failure-code-checking.patch new file mode 100644 index 0000000..e101589 --- /dev/null +++ b/libtracefs-Fix-the-read-file-failure-code-checking.patch @@ -0,0 +1,31 @@ +From 3f5dc533a8306527b77bcf9187768ba0eaf910b6 Mon Sep 17 00:00:00 2001 +From: Haiyue Wang +Date: Fri, 14 Feb 2025 20:35:17 +0800 +Subject: [PATCH] libtracefs: Fix the read file failure code checking + +The failure error code '-1' will be treated as 'true'. Only nonzero +number has buffer data returned successfully. + +Link: https://lore.kernel.org/20250214123531.13883-1-haiyuewa@163.com +Signed-off-by: Haiyue Wang +Signed-off-by: Steven Rostedt (Google) +--- + src/tracefs-record.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tracefs-record.c b/src/tracefs-record.c +index 932e8b4..1a4a16c 100644 +--- a/src/tracefs-record.c ++++ b/src/tracefs-record.c +@@ -550,7 +550,7 @@ static int init_splice(struct tracefs_cpu *tcpu) + if (ret < 0) + return ret; + +- if (str_read_file("/proc/sys/fs/pipe-max-size", &buf, false)) { ++ if (str_read_file("/proc/sys/fs/pipe-max-size", &buf, false) > 0) { + int size = atoi(buf); + fcntl(tcpu->splice_pipe[0], F_SETPIPE_SZ, &size); + free(buf); +-- +2.49.0 + diff --git a/libtracefs.spec b/libtracefs.spec index d1328d4..590bdc9 100644 --- a/libtracefs.spec +++ b/libtracefs.spec @@ -1,6 +1,6 @@ Name: libtracefs Version: 1.8.0 -Release: 6%{?dist} +Release: 7%{?dist} License: LGPL-2.1-or-later AND GPL-2.0-or-later AND GPL-2.0-only Summary: Library for access kernel tracefs @@ -21,6 +21,7 @@ Patch11: libtracefs-Prevent-memory-leak-in-tracefs_dynevent_g.patch Patch12: libtracefs-Close-dir-in-the-error-path-in-tracefs_sy.patch Patch13: libtracefs-Close-dir-in-the-error-path-in-tracefs_ev.patch Patch14: libtracefs-Initialize-val-in-build_filter.patch +Patch15: libtracefs-Fix-the-read-file-failure-code-checking.patch BuildRequires: gcc BuildRequires: make @@ -62,6 +63,10 @@ rm -rf %{buildroot}/%{_libdir}/libtracefs.a %{_libdir}/%{name}.so %changelog +* Wed May 28 2025 Tomas Glozar - 1.8.0-7 +- Fix read file failure code checking + Resolves: RHEL-93863 + * Tue Oct 29 2024 Troy Dawson - 1.8.0-6 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018