diff options
| author | Martin Belanger <martin.belanger@dell.com> | 2026-11-12 16:13:36 -0500 |
|---|---|---|
| committer | Keith Busch <kbusch@kernel.org> | 2026-11-16 07:42:46 -0800 |
| commit | 687e743e4089b2a854982b321cb2d681ae5d6136 (patch) | |
| tree | ee3f361d48a91de4a71be633a45a305974293486 /tools/perf/scripts/python | |
| parent | 76afef5e29221e68f9a19df767f94b092c31e974 (diff) | |
nvme-tcp: consume TLS records without application data
A peer may send a TLS record without application data at any time
after the handshake: a NewSessionTicket, a KeyUpdate or an alert.
tls_sw_read_sock() cannot pass such a record to nvme_tcp_recv_skb().
It returns -EINVAL and leaves the record at the head of the receive
queue. nvme_tcp_try_recv() then starts error recovery, and the
controller reconnects.
TLS 1.3 allows a server to send a NewSessionTicket at any time after
the handshake (RFC 8446, section 4.6.1). Alerts can also arrive at any
time.
On -EINVAL, read the record with recvmsg(), which reports the record
type. Discard handshake messages other than KeyUpdate. Log alerts, and
fail the queue on a fatal alert. Fail the queue on a KeyUpdate, which
nvme-tcp cannot answer, and on any other record type. recvmsg() takes
the socket lock, so release it around the read.
Handle these records in one helper, also for the records that arrive
ahead of the ICResp. A warning alert ahead of the ICResp no longer fails
the connection.
On a poll queue, nvme_tcp_poll() and nvme_tcp_io_work() can both see
the record while the socket lock is released. A queue flag makes sure
that only one of them reads it.
svc_tcp_recvfrom() in sunrpc handles -EINVAL from read_sock() the same
way.
Fixes: be8e82caa685 ("nvme-tcp: enable TLS handshake upcall")
Cc: stable@vger.kernel.org
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
Reviewed-by: Hannes Reinecke <hare@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
