Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: mctp: Set SOCK_RCU_FREE

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>
Link: https://patch.msgid.link/20250410-mctp-rcu-sock-v1-1-872de9fdc877@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Matt Johnston and committed by
Jakub Kicinski
52024cd6 f3fdd4fb

+3
+3
net/mctp/af_mctp.c
··· 630 630 { 631 631 struct net *net = sock_net(sk); 632 632 633 + /* Bind lookup runs under RCU, remain live during that. */ 634 + sock_set_flag(sk, SOCK_RCU_FREE); 635 + 633 636 mutex_lock(&net->mctp.bind_lock); 634 637 sk_add_node_rcu(sk, &net->mctp.binds); 635 638 mutex_unlock(&net->mctp.bind_lock);