public inbox for kernel-tls-handshake@lists.linux.dev
 help / color / mirror / Atom feed
From: Chuck Lever <cel@kernel.org>
To: Hannes Reinecke <hare@suse.de>, Olga Kornievskaia <okorniev@redhat.com>
Cc: kernel-tls-handshake@lists.linux.dev,
	Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 1/4] net: Introduce read_sock_cmsg proto_ops for control message delivery
Date: Tue, 17 Feb 2026 17:20:30 -0500	[thread overview]
Message-ID: <20260217222033.1929211-2-cel@kernel.org> (raw)
In-Reply-To: <20260217222033.1929211-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

Kernel TCP consumers that use the read_sock interface
(proto_ops.read_sock) cannot receive TLS control messages (Alerts,
Handshake records) when kTLS is active. The current
tls_sw_read_sock() method rejects non-data records with -EINVAL, and
the sk_read_actor_t callback has no channel for delivering record-
type metadata.

Four kernel subsystems are affected: NFSD (sunrpc svcsock), NFS
client (sunrpc xprtsock), NVMe target (nvmet-tcp), and NVMe host
(nvme-tcp). Each of these either falls back to the slower
sock_recvmsg() API or lacks TLS alert handling entirely.

A new read_sock_cmsg method in struct proto_ops provides a separate
code path that delivers non-data TLS records to a callback, without
changing the existing read_sock behavior used by consumers of the
existing read_sock method.

The new sk_read_cmsg_actor_t callback type extends the
sk_read_actor_t signature with a content_type parameter carrying the
protocol-layer record type (for example, TLS_RECORD_TYPE_ALERT).

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 include/linux/net.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/net.h b/include/linux/net.h
index f58b38ab37f8..94eb1c3c1cb6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -154,6 +154,10 @@ struct sk_buff;
 struct proto_accept_arg;
 typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
 			       unsigned int, size_t);
+typedef int (*sk_read_cmsg_actor_t)(read_descriptor_t *,
+				    struct sk_buff *,
+				    unsigned int, size_t,
+				    u8 content_type);
 typedef int (*skb_read_actor_t)(struct sock *, struct sk_buff *);
 
 
@@ -218,6 +222,10 @@ struct proto_ops {
 	 */
 	int		(*read_sock)(struct sock *sk, read_descriptor_t *desc,
 				     sk_read_actor_t recv_actor);
+	int		(*read_sock_cmsg)(struct sock *sk,
+					  read_descriptor_t *desc,
+					  sk_read_actor_t recv_actor,
+					  sk_read_cmsg_actor_t cmsg_actor);
 	/* This is different from read_sock(), it reads an entire skb at a time. */
 	int		(*read_skb)(struct sock *sk, skb_read_actor_t recv_actor);
 	int		(*sendmsg_locked)(struct sock *sk, struct msghdr *msg,
-- 
2.53.0


  reply	other threads:[~2026-02-17 22:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17 22:20 [RFC PATCH 0/4] ->read_sock with cmsg Chuck Lever
2026-02-17 22:20 ` Chuck Lever [this message]
2026-02-18  7:29   ` [RFC PATCH 1/4] net: Introduce read_sock_cmsg proto_ops for control message delivery Hannes Reinecke
2026-02-18 14:33     ` Chuck Lever
2026-02-18 15:52       ` Hannes Reinecke
2026-02-18 16:12         ` Chuck Lever
2026-02-19  4:06           ` Alistair Francis
2026-02-19  8:05             ` Hannes Reinecke
2026-02-19  8:10           ` Hannes Reinecke
2026-02-19 13:59             ` Chuck Lever
2026-02-28 11:09             ` Alistair Francis
2026-02-17 22:20 ` [RFC PATCH 2/4] tls: Implement read_sock_cmsg for kTLS software path Chuck Lever
2026-02-17 22:20 ` [RFC PATCH 3/4] sunrpc: Use read_sock_cmsg for svcsock TCP receives Chuck Lever
2026-02-17 22:20 ` [RFC PATCH 4/4] sunrpc: Remove sock_recvmsg path from " Chuck Lever

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=20260217222033.1929211-2-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=hare@suse.de \
    --cc=kernel-tls-handshake@lists.linux.dev \
    --cc=okorniev@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