patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v4.19.y] netfilter: nf_queue: fix socket leak
@ 2023-08-26  6:50 Vamsi Krishna Brahmajosyula
  2023-08-27  9:16 ` Patch "netfilter: nf_queue: fix socket leak" has been added to the 4.19-stable tree gregkh
  0 siblings, 1 reply; 2+ messages in thread
From: Vamsi Krishna Brahmajosyula @ 2023-08-26  6:50 UTC (permalink / raw)
  To: stable
  Cc: gregkh, patches, pablo, kadlec, fw, davem, netfilter-devel,
	coreteam, netdev, linux-kernel, amakhalov, srinidhir, vsirnapalli,
	akaher, tkundu, keerthanak, psinghchauha, Vimal Agrawal

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/20221024112958.115275475@linuxfoundation.org/

Signed-off-by: Vimal Agrawal <vimal.agrawal@sophos.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
[vbrahmajosyula: The fix to the backport was missed in 4.19]
Signed-off-by: Vamsi Krishna Brahmajosyula <vbrahmajosyula@vmware.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 84c59de27882..b3a0385290a1 100644
--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -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;
-- 
2.39.2


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

* Patch "netfilter: nf_queue: fix socket leak" has been added to the 4.19-stable tree
  2023-08-26  6:50 [PATCH v4.19.y] netfilter: nf_queue: fix socket leak Vamsi Krishna Brahmajosyula
@ 2023-08-27  9:16 ` gregkh
  0 siblings, 0 replies; 2+ messages in thread
From: gregkh @ 2023-08-27  9:16 UTC (permalink / raw)
  To: 20221024112958.115275475, akaher, amakhalov, coreteam, davem, fw,
	gregkh, kadlec, keerthanak, pablo, patches, psinghchauha,
	srinidhir, tkundu, vbrahmajosyula, vimal.agrawal, vsirnapalli
  Cc: stable-commits


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 <stable@vger.kernel.org> know about it.


From vbrahmajosyula@vmware.com  Sun Aug 27 11:12:19 2023
From: Vamsi Krishna Brahmajosyula <vbrahmajosyula@vmware.com>
Date: Sat, 26 Aug 2023 06:50:56 +0000
Subject: netfilter: nf_queue: fix socket leak
To: stable@vger.kernel.org
Cc: gregkh@linuxfoundation.org, patches@lists.linux.dev, pablo@netfilter.org, kadlec@blackhole.kfki.hu, fw@strlen.de, davem@davemloft.net, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, amakhalov@vmware.com, srinidhir@vmware.com, vsirnapalli@vmware.com, akaher@vmware.com, tkundu@vmware.com, keerthanak@vmware.com, psinghchauha@vmware.com, Vimal Agrawal <vimal.agrawal@sophos.com>
Message-ID: <20230826065055.4691-1-vbrahmajosyula@vmware.com>

From: Vamsi Krishna Brahmajosyula <vbrahmajosyula@vmware.com>

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/20221024112958.115275475@linuxfoundation.org/

Signed-off-by: Vimal Agrawal <vimal.agrawal@sophos.com>
Reviewed-by: Florian Westphal <fw@strlen.de>
[vbrahmajosyula: The fix to the backport was missed in 4.19]
Signed-off-by: Vamsi Krishna Brahmajosyula <vbrahmajosyula@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/netfilter/nf_queue.c |    2 --
 1 file changed, 2 deletions(-)

--- a/net/netfilter/nf_queue.c
+++ b/net/netfilter/nf_queue.c
@@ -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 vbrahmajosyula@vmware.com are

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

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

end of thread, other threads:[~2023-08-27  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-26  6:50 [PATCH v4.19.y] netfilter: nf_queue: fix socket leak Vamsi Krishna Brahmajosyula
2023-08-27  9:16 ` Patch "netfilter: nf_queue: fix socket leak" has been added to the 4.19-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).