All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: chuck.lever@oracle.com
Cc: kernel-tls-handshake@lists.linux.dev
Subject: [PATCH] handshake: set hr_sk field earlier in handshake_req_submit
Date: Tue, 28 Mar 2023 14:10:40 -0400	[thread overview]
Message-ID: <20230328181040.292486-1-jlayton@kernel.org> (raw)

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


             reply	other threads:[~2023-03-28 18:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-28 18:10 Jeff Layton [this message]
2023-03-28 18:12 ` [PATCH] handshake: set hr_sk field earlier in handshake_req_submit Chuck Lever III
2023-03-28 20:29   ` Jeff Layton
2023-03-28 20:33     ` Chuck Lever III

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=20230328181040.292486-1-jlayton@kernel.org \
    --to=jlayton@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kernel-tls-handshake@lists.linux.dev \
    /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 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.