]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2024 09:25:28 +0000 (11:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2024 09:25:28 +0000 (11:25 +0200)
added patches:
xdp-xdp_mem_allocator-can-be-null-in-trace_mem_connect.patch

queue-5.10/series
queue-5.10/xdp-xdp_mem_allocator-can-be-null-in-trace_mem_connect.patch [new file with mode: 0644]

index 8404c250aec8513effd79273c749f2d2524a8e59..1f0ed1f74302d49ca18a87cbb11872d91f10c258 100644 (file)
@@ -287,3 +287,4 @@ efi-x86-free-efi-memory-map-only-when-installing-a-new-one.patch
 kvm-arm64-vgic-v4-make-the-doorbell-request-robust-w.r.t-preemption.patch
 arm-dts-rockchip-rk3066a-add-sound-dai-cells-to-hdmi.patch
 arm64-dts-rockchip-add-sound-dai-cells-for-rk3368.patch
+xdp-xdp_mem_allocator-can-be-null-in-trace_mem_connect.patch
diff --git a/queue-5.10/xdp-xdp_mem_allocator-can-be-null-in-trace_mem_connect.patch b/queue-5.10/xdp-xdp_mem_allocator-can-be-null-in-trace_mem_connect.patch
new file mode 100644 (file)
index 0000000..f29b3e2
--- /dev/null
@@ -0,0 +1,48 @@
+From e0ae713023a9d09d6e1b454bdc8e8c1dd32c586e Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Wed, 9 Mar 2022 23:13:45 +0100
+Subject: xdp: xdp_mem_allocator can be NULL in trace_mem_connect().
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+
+commit e0ae713023a9d09d6e1b454bdc8e8c1dd32c586e upstream.
+
+Since the commit mentioned below __xdp_reg_mem_model() can return a NULL
+pointer. This pointer is dereferenced in trace_mem_connect() which leads
+to segfault.
+
+The trace points (mem_connect + mem_disconnect) were put in place to
+pair connect/disconnect using the IDs. The ID is only assigned if
+__xdp_reg_mem_model() does not return NULL. That connect trace point is
+of no use if there is no ID.
+
+Skip that connect trace point if xdp_alloc is NULL.
+
+[ Toke Høiland-Jørgensen delivered the reasoning for skipping the trace
+  point ]
+
+Fixes: 4a48ef70b93b8 ("xdp: Allow registering memory model without rxq reference")
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Acked-by: Toke Høiland-Jørgensen <toke@redhat.com>
+Link: https://lore.kernel.org/r/YikmmXsffE+QajTB@linutronix.de
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/core/xdp.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/core/xdp.c
++++ b/net/core/xdp.c
+@@ -356,7 +356,8 @@ int xdp_rxq_info_reg_mem_model(struct xd
+       if (IS_ERR(xdp_alloc))
+               return PTR_ERR(xdp_alloc);
+-      trace_mem_connect(xdp_alloc, xdp_rxq);
++      if (trace_mem_connect_enabled() && xdp_alloc)
++              trace_mem_connect(xdp_alloc, xdp_rxq);
+       return 0;
+ }