public inbox for mptcp@lists.linux.dev
 help / color / mirror / Atom feed
* [RFC mptcp-next v2] Squash to "tls: add ops in tls_context"
@ 2026-01-13  8:07 Geliang Tang
  2026-01-13  8:43 ` MPTCP CI
  2026-01-13 10:07 ` MPTCP CI
  0 siblings, 2 replies; 3+ messages in thread
From: Geliang Tang @ 2026-01-13  8:07 UTC (permalink / raw)
  To: mptcp; +Cc: Geliang Tang

From: Geliang Tang <tanggeliang@kylinos.cn>

Oops, sorry. spin_lock(&tls_prot_ops_lock) shouldn't be called after
write_lock_bh(&sk->sk_callback_lock); otherwise, a deadlock occurs.

When calling tls_prot_ops_find() here, it's unnecessary to hold
tls_prot_ops_lock; holding sk->sk_callback_lock is sufficient.

Based-on: <cover.1768284047.git.tanggeliang@kylinos.cn>

Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 v2:
 - do not hold tls_prot_ops_lock in tls_init().
---
 net/tls/tls_main.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index 75e01f2dde26..1051cb53bc5a 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -1097,9 +1097,7 @@ static int tls_init(struct sock *sk)
 	ctx->tx_conf = TLS_BASE;
 	ctx->rx_conf = TLS_BASE;
 	ctx->tx_max_payload_len = TLS_MAX_PAYLOAD_SIZE;
-	spin_lock(&tls_prot_ops_lock);
 	ctx->ops = tls_prot_ops_find(sk->sk_protocol);
-	spin_unlock(&tls_prot_ops_lock);
 	if (!ctx->ops) {
 		rc = -EINVAL;
 		goto out;
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-13 10:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13  8:07 [RFC mptcp-next v2] Squash to "tls: add ops in tls_context" Geliang Tang
2026-01-13  8:43 ` MPTCP CI
2026-01-13 10:07 ` MPTCP CI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox