patches.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Vamsi Krishna Brahmajosyula <vbrahmajosyula@vmware.com>
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>
Subject: [PATCH v4.19.y] netfilter: nf_queue: fix socket leak
Date: Sat, 26 Aug 2023 06:50:56 +0000	[thread overview]
Message-ID: <20230826065055.4691-1-vbrahmajosyula@vmware.com> (raw)

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


             reply	other threads:[~2023-08-26  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-26  6:50 Vamsi Krishna Brahmajosyula [this message]
2023-08-27  9:16 ` Patch "netfilter: nf_queue: fix socket leak" has been added to the 4.19-stable tree gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230826065055.4691-1-vbrahmajosyula@vmware.com \
    --to=vbrahmajosyula@vmware.com \
    --cc=akaher@vmware.com \
    --cc=amakhalov@vmware.com \
    --cc=coreteam@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kadlec@blackhole.kfki.hu \
    --cc=keerthanak@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=patches@lists.linux.dev \
    --cc=psinghchauha@vmware.com \
    --cc=srinidhir@vmware.com \
    --cc=stable@vger.kernel.org \
    --cc=tkundu@vmware.com \
    --cc=vimal.agrawal@sophos.com \
    --cc=vsirnapalli@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).