]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jul 2024 10:51:58 +0000 (12:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Jul 2024 10:51:58 +0000 (12:51 +0200)
added patches:
libbpf-don-t-close-1-in-multi-uprobe-feature-detector.patch

queue-6.9/libbpf-don-t-close-1-in-multi-uprobe-feature-detector.patch [new file with mode: 0644]
queue-6.9/series

diff --git a/queue-6.9/libbpf-don-t-close-1-in-multi-uprobe-feature-detector.patch b/queue-6.9/libbpf-don-t-close-1-in-multi-uprobe-feature-detector.patch
new file mode 100644 (file)
index 0000000..7d9da6f
--- /dev/null
@@ -0,0 +1,35 @@
+From 7d0b3953f6d832daec10a0d76e2d4db405768a8b Mon Sep 17 00:00:00 2001
+From: Andrii Nakryiko <andrii@kernel.org>
+Date: Wed, 29 May 2024 16:12:12 -0700
+Subject: libbpf: don't close(-1) in multi-uprobe feature detector
+
+From: Andrii Nakryiko <andrii@kernel.org>
+
+commit 7d0b3953f6d832daec10a0d76e2d4db405768a8b upstream.
+
+Guard close(link_fd) with extra link_fd >= 0 check to prevent close(-1).
+
+Detected by Coverity static analysis.
+
+Fixes: 04d939a2ab22 ("libbpf: detect broken PID filtering logic for multi-uprobe")
+Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
+Acked-by: Jiri Olsa <jolsa@kernel.org>
+Link: https://lore.kernel.org/r/20240529231212.768828-1-andrii@kernel.org
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ tools/lib/bpf/features.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/tools/lib/bpf/features.c
++++ b/tools/lib/bpf/features.c
+@@ -393,7 +393,8 @@ static int probe_uprobe_multi_link(int t
+       err = -errno; /* close() can clobber errno */
+       if (link_fd >= 0 || err != -EBADF) {
+-              close(link_fd);
++              if (link_fd >= 0)
++                      close(link_fd);
+               close(prog_fd);
+               return 0;
+       }
index 21b4ee8bbe498ee780216902f64a052ec2d6badc..e3e34f8cef979d8e1e230235b8bb04fa4e4a8837 100644 (file)
@@ -194,3 +194,4 @@ alsa-ump-set-default-protocol-when-not-given-explici.patch
 drm-amdgpu-silence-ubsan-warning.patch
 hwmon-dell-smm-add-dell-g15-5511-to-fan-control-whit.patch
 null_blk-do-not-allow-runt-zone-with-zone-capacity-s.patch
+libbpf-don-t-close-1-in-multi-uprobe-feature-detector.patch