]> git.kaiwu.me - haproxy.git/commit
BUG/MEDIUM: rawsock: don't take a short kTLS read for the end of data
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)
commitece67ea458f516f05ab75b4e4228ece9045bac6a
tree01eb36949eb46fa5f7d37290f640d8e1d3910859
parent035691b1abdb2adcdc7da3e13d5a4b3f034948ca
BUG/MEDIUM: rawsock: don't take a short kTLS read for the end of data

When a read returns less than requested, raw_sock_to_buf() considers
the socket buffer empty, and reports a shutdown if the poller already
saw one. But on a kTLS socket recvmsg() returns at most one record, so
the following records are never read when the peer's FIN is already
there. With "ktls on" on a server closing without a close_notify right
after its response, the response is lost and a 502 is returned.

Let's not do this for reads using a control message buffer, which are
only used for kTLS.

This was introduced in 3.3-dev7 by commit 3d685fcb7 ("MINOR: xprt: Add
recvmsg() and sendmsg() parameters to rcv_buf() and snd_buf()."). It
must be backported to 3.3.
src/raw_sock.c