From: Chuck Lever <cel@kernel.org>
To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com
Cc: netdev@vger.kernel.org, kernel-tls-handshake@lists.linux.dev
Subject: [PATCH net-next v2 4/7] SUNRPC: Send TLS Closure alerts before closing a TCP socket
Date: Tue, 25 Jul 2023 16:37:11 -0400 [thread overview]
Message-ID: <169031742144.15386.15256038720613330342.stgit@oracle-102.nfsv4bat.org> (raw)
In-Reply-To: <169031700320.15386.6923217931442885226.stgit@oracle-102.nfsv4bat.org>
From: Chuck Lever <chuck.lever@oracle.com>
Before closing a TCP connection, the TLS protocol wants peers to
send session close Alert notifications. Add those in both the RPC
client and server.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
net/sunrpc/svcsock.c | 2 ++
net/sunrpc/xprtsock.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index e43f26382411..87bf685f2957 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -1621,6 +1621,8 @@ static void svc_tcp_sock_detach(struct svc_xprt *xprt)
{
struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt);
+ tls_handshake_close(svsk->sk_sock);
+
svc_sock_detach(xprt);
if (!test_bit(XPT_LISTENER, &xprt->xpt_flags)) {
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 9f010369100a..871f141be96f 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1292,6 +1292,8 @@ static void xs_close(struct rpc_xprt *xprt)
dprintk("RPC: xs_close xprt %p\n", xprt);
+ if (transport->sock)
+ tls_handshake_close(transport->sock);
xs_reset_transport(transport);
xprt->reestablish_timeout = 0;
}
next prev parent reply other threads:[~2023-07-25 20:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-25 20:35 [PATCH net-next v2 0/7] In-kernel support for the TLS Alert protocol Chuck Lever
2023-07-25 20:35 ` [PATCH net-next v2 1/7] net/tls: Move TLS protocol elements to a separate header Chuck Lever
2023-07-27 4:36 ` Jakub Kicinski
2023-07-27 13:05 ` Chuck Lever III
2023-07-25 20:36 ` [PATCH net-next v2 2/7] net/tls: Add TLS Alert definitions Chuck Lever
2023-07-25 20:36 ` [PATCH net-next v2 3/7] net/handshake: Add API for sending TLS Closure alerts Chuck Lever
2023-07-27 4:38 ` Jakub Kicinski
2023-07-27 13:08 ` Chuck Lever III
2023-07-25 20:37 ` Chuck Lever [this message]
2023-07-25 20:37 ` [PATCH net-next v2 5/7] net/handshake: Add helpers for parsing incoming TLS Alerts Chuck Lever
2023-07-25 20:37 ` [PATCH net-next v2 6/7] SUNRPC: Use new helpers to handle " Chuck Lever
2023-07-25 20:38 ` [PATCH net-next v2 7/7] net/handshake: Trace events for TLS Alert helpers Chuck Lever
2023-07-27 4:40 ` [PATCH net-next v2 0/7] In-kernel support for the TLS Alert protocol Jakub Kicinski
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=169031742144.15386.15256038720613330342.stgit@oracle-102.nfsv4bat.org \
--to=cel@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kernel-tls-handshake@lists.linux.dev \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).