]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: ssl: trim dropped kTLS records from the end of the buffer
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 24 Nov 2026 17:33:04 +0000 (18:33 +0100)
committerOlivier Houchard <cognet@ci0.org>
Wed, 25 Nov 2026 14:04:54 +0000 (15:04 +0100)
commit035691b1abdb2adcdc7da3e13d5a4b3f034948ca
tree12b0dde228e5a08e6978af95dec5c023763af5be
parent60904f86938435af8d8d129dd1f02606ac074b4e
BUG/MEDIUM: ssl: trim dropped kTLS records from the end of the buffer

With AWS-LC and kTLS, ssl_sock_to_buf() reads the records itself, and
drops the NewSessionTicket and close_notify ones it has just received
using b_del(). But this removes data from the head of the buffer, while
the record was appended at its tail. When the buffer already contains
data, their beginning is lost and the record stays in the buffer,
resulting in a corrupted stream, typically an invalid HTTP response
when a server sends a close_notify right after its response. This
rarely shows up for now, because a kTLS read is almost always the last
one of a call.

Let's use b_sub() to remove the record from the tail.

This was introduced in 3.3-dev7 by commit 5da354098 ("MEDIUM: ssl:
Handle non-Application data record with AWS-LC"). It must be backported
to 3.3.
src/ssl_sock.c