Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Denis Arefev <arefev@swemel.ru>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.10] netfilter: nft_socket: fix sk refcount leaks
Date: Mon,  2 Jun 2025 12:14:29 -0400	[thread overview]
Message-ID: <20250602092354-c959a829b6d0673f@stable.kernel.org> (raw)
In-Reply-To: <20250602123948.40610-1-arefev@swemel.ru>

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: 8b26ff7af8c32cb4148b3e147c52f9e4c695209c

WARNING: Author mismatch between patch and upstream commit:
Backport author: Denis Arefev<arefev@swemel.ru>
Commit author: Florian Westphal<fw@strlen.de>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)
6.14.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: 83e6fb59040e)
6.1.y | Present (different SHA1: 33c2258bf8cb)
5.15.y | Present (different SHA1: ddc7c423c4a5)

Note: The patch differs from the upstream commit:
---
1:  8b26ff7af8c32 ! 1:  a2677efdc7b71 netfilter: nft_socket: fix sk refcount leaks
    @@ Metadata
      ## Commit message ##
         netfilter: nft_socket: fix sk refcount leaks
     
    +    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>
    +    [Denis: minor fix to resolve merge conflict.]
    +    Signed-off-by: Denis Arefev <arefev@swemel.ru>
     
      ## net/netfilter/nft_socket.c ##
     @@ net/netfilter/nft_socket.c: static void nft_socket_eval(const struct nft_expr *expr,
    - 			*dest = READ_ONCE(sk->sk_mark);
    + 			*dest = sk->sk_mark;
      		} else {
      			regs->verdict.code = NFT_BREAK;
     -			return;
    @@ net/netfilter/nft_socket.c: static void nft_socket_eval(const struct nft_expr *e
      		}
      		nft_socket_wildcard(pkt, regs, sk, dest);
      		break;
    -@@ net/netfilter/nft_socket.c: static void nft_socket_eval(const struct nft_expr *expr,
    - 	case NFT_SOCKET_CGROUPV2:
    - 		if (!nft_sock_get_eval_cgroupv2(dest, sk, pkt, priv->level)) {
    - 			regs->verdict.code = NFT_BREAK;
    --			return;
    -+			goto out_put_sk;
    - 		}
    - 		break;
    - #endif
     @@ net/netfilter/nft_socket.c: static void nft_socket_eval(const struct nft_expr *expr,
      		regs->verdict.code = NFT_BREAK;
      	}
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.10.y       |  Success    |  Success   |

  reply	other threads:[~2025-06-02 16:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02 12:39 [PATCH 5.10] netfilter: nft_socket: fix sk refcount leaks Denis Arefev
2025-06-02 16:14 ` Sasha Levin [this message]
2025-06-02 18:51 ` Pablo Neira Ayuso

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=20250602092354-c959a829b6d0673f@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=arefev@swemel.ru \
    --cc=stable@vger.kernel.org \
    /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