Skip to contentSkip to conversation

netfilter: nf_queue: fix socket leak

PATCH Applied Vamsi Krishna Brahmajosyula 2 participants 2 messages Aug 26, 2023 – Aug 27, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nf_queue: fix socket leak

Removal of the sock_hold got lost when backporting commit c3873070247d ("netfilter: nf_queue: fix possible use-after-free") to 4.19

Fixes 34dc4a6a7f26 ("netfilter: nf_queue: fix possible use-after-free") in 4.19

Fixed in 4.14 with
https://lore.kernel.org/all/[email protected]/

[vbrahmajosyula: The fix to the backport was missed in 4.19]
---
 net/netfilter/nf_queue.c | 2 --
 1 file changed, 2 deletions(-)
net/netfilter/nf_queue.c +0 -2
index 84c59de27882..b3a0385290a1 100644
@@ -93,8 +93,6 @@ bool nf_queue_entry_get_refs(struct nf_queue_entry *entry)
 		dev_hold(state->in);
 	if (state->out)
 		dev_hold(state->out);
-	if (state->sk)
-		sock_hold(state->sk);
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 	if (entry->skb->nf_bridge) {
 		struct net_device *physdev;
Signature · 1 line
2.39.2
maintainer Applied
#1 lore raw

Patch "netfilter: nf_queue: fix socket leak" has been added to the 4.19-stable tree

This is a note to let you know that I've just added the patch titled

netfilter: nf_queue: fix socket leak

to the 4.19-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
netfilter-nf_queue-fix-socket-leak.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Sun Aug 27 11:12:19 2023
From: Vamsi Krishna Brahmajosyula <[email protected]>
Date: Sat, 26 Aug 2023 06:50:56 +0000
Subject: netfilter: nf_queue: fix socket leak
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], Vimal Agrawal <[email protected]>
Message-ID: <[email protected]>

From: Vamsi Krishna Brahmajosyula <[email protected]>

Removal of the sock_hold got lost when backporting commit c3873070247d ("netfilter: nf_queue: fix possible use-after-free") to 4.19

Fixes 34dc4a6a7f26 ("netfilter: nf_queue: fix possible use-after-free") in 4.19

Fixed in 4.14 with
https://lore.kernel.org/all/[email protected]/

[vbrahmajosyula: The fix to the backport was missed in 4.19]
---
 net/netfilter/nf_queue.c |    2 --
 1 file changed, 2 deletions(-)
net/netfilter/nf_queue.c +0 -2
@@ -93,8 +93,6 @@ bool nf_queue_entry_get_refs(struct nf_q
 		dev_hold(state->in);
 	if (state->out)
 		dev_hold(state->out);
-	if (state->sk)
-		sock_hold(state->sk);
 #if IS_ENABLED(CONFIG_BRIDGE_NETFILTER)
 	if (entry->skb->nf_bridge) {
 		struct net_device *physdev;

Patches currently in stable-queue which might be from [email protected] are

queue-4.19/netfilter-nf_queue-fix-socket-leak.patch