All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] handshake: set hr_sk field earlier in handshake_req_submit
@ 2023-03-28 18:10 Jeff Layton
  2023-03-28 18:12 ` Chuck Lever III
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Layton @ 2023-03-28 18:10 UTC (permalink / raw)
  To: chuck.lever; +Cc: kernel-tls-handshake

Otherwise, the request is always hashed with the socket set to a NULL
pointer.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 net/handshake/request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I think this is the problem I was hitting earlier. Chuck, feel free to
fold this into the original patch that adds this code.

diff --git a/net/handshake/request.c b/net/handshake/request.c
index 54ba304b5bef..44a097210e59 100644
--- a/net/handshake/request.c
+++ b/net/handshake/request.c
@@ -207,6 +207,7 @@ int handshake_req_submit(struct socket *sock, struct handshake_req *req,
 	if (READ_ONCE(hn->hn_pending) >= hn->hn_pending_max)
 		goto out_err;
 
+	req->hr_sk = sk;
 	req->hr_odestruct = sk->sk_destruct;
 	sk->sk_destruct = handshake_sk_destruct;
 	spin_lock(&hn->hn_lock);
@@ -230,7 +231,6 @@ int handshake_req_submit(struct socket *sock, struct handshake_req *req,
 
 	/* Prevent socket release while a handshake request is pending */
 	sock_hold(sk);
-	req->hr_sk = sk;
 
 	trace_handshake_submit(net, req, sk);
 	return 0;
-- 
2.39.2


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

end of thread, other threads:[~2023-03-28 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 18:10 [PATCH] handshake: set hr_sk field earlier in handshake_req_submit Jeff Layton
2023-03-28 18:12 ` Chuck Lever III
2023-03-28 20:29   ` Jeff Layton
2023-03-28 20:33     ` Chuck Lever III

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.