From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: jianqi.ren.cn@windriver.com, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 5.10.y] net: defer final 'struct net' free in netns dismantle
Date: Fri, 18 Apr 2025 11:57:45 -0400 [thread overview]
Message-ID: <20250418085224-47ce831a17b6f93e@stable.kernel.org> (raw)
In-Reply-To: <20250417075740.1747626-1-jianqi.ren.cn@windriver.com>
[ 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: 0f6ede9fbc747e2553612271bce108f7517e7a45
WARNING: Author mismatch between patch and upstream commit:
Backport author: <jianqi.ren.cn@windriver.com>
Commit author: Eric Dumazet<edumazet@google.com>
Status in newer kernel trees:
6.14.y | Present (exact SHA1)
6.13.y | Present (exact SHA1)
6.12.y | Present (different SHA1: 6610c7f8a8d4)
6.6.y | Present (different SHA1: b7a79e51297f)
6.1.y | Present (different SHA1: 3267b254dc0a)
5.15.y | Not found
Note: The patch differs from the upstream commit:
---
1: 0f6ede9fbc747 ! 1: e37924b352d9b net: defer final 'struct net' free in netns dismantle
@@ Metadata
## Commit message ##
net: defer final 'struct net' free in netns dismantle
+ [ Upstream commit 0f6ede9fbc747e2553612271bce108f7517e7a45 ]
+
Ilya reported a slab-use-after-free in dst_destroy [1]
Issue is in xfrm6_net_init() and xfrm4_net_init() :
@@ Commit message
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20241204125455.3871859-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+ [Minor conflict resolved due to code context change.]
+ Signed-off-by: Jianqi Ren <jianqi.ren.cn@windriver.com>
+ Signed-off-by: He Zhe <zhe.he@windriver.com>
## include/net/net_namespace.h ##
@@ include/net/net_namespace.h: struct net {
@@ net/core/net_namespace.c: static struct net *net_alloc(void)
static void net_free(struct net *net)
{
if (refcount_dec_and_test(&net->passive)) {
-@@ net/core/net_namespace.c: static void net_free(struct net *net)
- /* There should not be any trackers left there. */
- ref_tracker_dir_exit(&net->notrefcnt_tracker);
-
+ kfree(rcu_access_pointer(net->gen));
- kmem_cache_free(net_cachep, net);
++
+ /* Wait for an extra rcu_barrier() before final free. */
+ llist_add(&net->defer_free_list, &defer_free_list);
}
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.10.y | Success | Success |
prev parent reply other threads:[~2025-04-18 15:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 7:57 [PATCH 5.10.y] net: defer final 'struct net' free in netns dismantle jianqi.ren.cn
2025-04-17 10:14 ` Thadeu Lima de Souza Cascardo
2025-04-18 15:57 ` Sasha Levin [this message]
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=20250418085224-47ce831a17b6f93e@stable.kernel.org \
--to=sashal@kernel.org \
--cc=jianqi.ren.cn@windriver.com \
--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