diff mbox series

[net] net: mctp: Set SOCK_RCU_FREE

Message ID 20250410-mctp-rcu-sock-v1-1-872de9fdc877@codeconstruct.com.au (mailing list archive)
State Accepted
Commit 52024cd6ec71a6ca934d0cc12452bd8d49850679
Delegated to: Netdev Maintainers
Headers show
Series [net] net: mctp: Set SOCK_RCU_FREE | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2025-04-11--03-00 (tests: 900)

Commit Message

Matt Johnston April 10, 2025, 3:53 a.m. UTC
Bind lookup runs under RCU, so ensure that a socket doesn't go away in
the middle of a lookup.

Fixes: 833ef3b91de6 ("mctp: Populate socket implementation")
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
---
 net/mctp/af_mctp.c | 3 +++
 1 file changed, 3 insertions(+)


---
base-commit: 0bb2f7a1ad1f11d861f58e5ee5051c8974ff9569
change-id: 20250410-mctp-rcu-sock-0f175bd94978

Best regards,

Comments

patchwork-bot+netdevbpf@kernel.org April 12, 2025, 2:01 a.m. UTC | #1
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 10 Apr 2025 11:53:19 +0800 you wrote:
> Bind lookup runs under RCU, so ensure that a socket doesn't go away in
> the middle of a lookup.
> 
> Fixes: 833ef3b91de6 ("mctp: Populate socket implementation")
> Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
> ---
>  net/mctp/af_mctp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> [...]

Here is the summary with links:
  - [net] net: mctp: Set SOCK_RCU_FREE
    https://git.kernel.org/netdev/net/c/52024cd6ec71

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index f6de136008f6f9b029e7dacc2e75dce1cd7fd075..57850d4dac5db946420120f8b15c82704c1044e7 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -630,6 +630,9 @@  static int mctp_sk_hash(struct sock *sk)
 {
 	struct net *net = sock_net(sk);
 
+	/* Bind lookup runs under RCU, remain live during that. */
+	sock_set_flag(sk, SOCK_RCU_FREE);
+
 	mutex_lock(&net->mctp.bind_lock);
 	sk_add_node_rcu(sk, &net->mctp.binds);
 	mutex_unlock(&net->mctp.bind_lock);