[gnutls-devel] GnuTLS | Doesn't handle short returns from recvmsg() on FreeBSD using KTLS (#1909)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Jun 19 17:05:19 CEST 2026



Issue created by -bat_: https://gitlab.com/gnutls/gnutls/-/work_items/1909



[ Should say upfront I used Claude to find this, but the bug appears genuine, and there is a file attached which demonstrates it. This PR was written by a human :-) ]

When using KTLS the library appears to expect that recvmsg() will either return the whole record, or EMSGSIZE if the buffer is too short. But on FreeBSD if you pass in a small buffer then it will quite happily pass you back out a partial record, and you get the rest on subsequent calls. But those calls are just returning the rest of the original message, and dont have control headers.

I found this by trying to read 5 bytes, to look for 'HTTP/' in the response from a web server. Works fine normally, but when I enable KTLS, it breaks.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/work_items/1909
You're receiving this email because of your account on gitlab.com. Unsubscribe from this thread: https://gitlab.com/-/namespace/17175643/sent_notifications/5-2li04lgmlzgy8u98jmmixu8vc-a84t7/unsubscribe | Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20260619/8adc3b83/attachment-0001.html>


More information about the Gnutls-devel mailing list