[gnutls-devel] GnuTLS | kTLS gets desynchronised when sending (in gnutls_record_send) (#1470)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Fri Mar 10 12:02:39 CET 2023




Richard W_M_ Jones commented:


Looking at https://gitlab.com/gnutls/gnutls/-/blob/3a812ae1bb684a754f5988c6dd3e7b8f861a974f/lib/system/ktls.c#L565 I think the problem seems likely to be in the implementation of kTLS inside GnuTLS.

I think what we are seeing is the first iteration of the while loop, `data_to_send` is 262144.  We successfully do a short `sendmsg`, so `data_to_send` will be 16384.  Then `sendmsg` returns `EAGAIN`.  We return to the caller, but now we've "forgotten" that we already sent the first 245760 bytes.

I'm pretty sure that loop cannot work in the case where `sendmsg` could ever return a short write.

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1470#note_1308857894
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20230310/b57c3a16/attachment.html>


More information about the Gnutls-devel mailing list