All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.14.y] netfilter: nf_queue: fix socket leak
@ 2022-10-11 17:22 Vimal Agrawal
  2022-10-11 17:29 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: Vimal Agrawal @ 2022-10-11 17:22 UTC (permalink / raw)
  To: stable; +Cc: fw, avimalin, Vimal Agrawal

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

This was causing a socket leak and was caught by kmemleak.
Tested by running kmemleak again with this fix.

Fixes: ef97921ccdc2 ("netfilter: nf_queue: fix possible use-after-free")
in 4.14
Signed-off-by: Vimal Agrawal <vimal.agrawal@sophos.com>
---
 net/netfilter/nf_queue.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/netfilter/nf_queue.c b/net/netfilter/nf_queue.c
index dbc45165c533..46984cdee658 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -91,8 +91,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;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-11 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-11 17:22 [PATCH 4.14.y] netfilter: nf_queue: fix socket leak Vimal Agrawal
2022-10-11 17:29 ` Florian Westphal
2022-10-11 18:35   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.