]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2025 10:01:11 +0000 (12:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 7 Jun 2025 10:01:11 +0000 (12:01 +0200)
added patches:
netfilter-nft_socket-fix-sk-refcount-leaks.patch

queue-5.4/netfilter-nft_socket-fix-sk-refcount-leaks.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/netfilter-nft_socket-fix-sk-refcount-leaks.patch b/queue-5.4/netfilter-nft_socket-fix-sk-refcount-leaks.patch
new file mode 100644 (file)
index 0000000..026003a
--- /dev/null
@@ -0,0 +1,38 @@
+From 8b26ff7af8c32cb4148b3e147c52f9e4c695209c Mon Sep 17 00:00:00 2001
+From: Florian Westphal <fw@strlen.de>
+Date: Thu, 5 Sep 2024 12:54:46 +0200
+Subject: netfilter: nft_socket: fix sk refcount leaks
+
+From: Florian Westphal <fw@strlen.de>
+
+commit 8b26ff7af8c32cb4148b3e147c52f9e4c695209c upstream.
+
+We must put 'sk' reference before returning.
+
+Fixes: 039b1f4f24ec ("netfilter: nft_socket: fix erroneous socket assignment")
+Signed-off-by: Florian Westphal <fw@strlen.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/netfilter/nft_socket.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/net/netfilter/nft_socket.c
++++ b/net/netfilter/nft_socket.c
+@@ -69,7 +69,7 @@ static void nft_socket_eval(const struct
+                       *dest = sk->sk_mark;
+               } else {
+                       regs->verdict.code = NFT_BREAK;
+-                      return;
++                      goto out_put_sk;
+               }
+               break;
+       default:
+@@ -77,6 +77,7 @@ static void nft_socket_eval(const struct
+               regs->verdict.code = NFT_BREAK;
+       }
++out_put_sk:
+       if (sk != skb->sk)
+               sock_gen_put(sk);
+ }
index 6443f9016646fdf756ed1afd2d0c78e5a61d541c..c9c83e30146e5f2c8da74f5d146ddf9395ba912a 100644 (file)
@@ -5,3 +5,4 @@ usb-quirks-add-no_lpm-quirk-for-sandisk-extreme-55ae.patch
 usb-storage-ignore-uas-driver-for-sandisk-3.2-gen2-storage-device.patch
 usb-usbtmc-fix-timeout-value-in-get_stb.patch
 thunderbolt-do-not-double-dequeue-a-configuration-request.patch
+netfilter-nft_socket-fix-sk-refcount-leaks.patch