-
Notifications
You must be signed in to change notification settings - Fork 411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minor incompatibility between recvmsg multishot and kTLS #727
Comments
this is interesting. I believe that should work as the struct order is [hdr][name][control]. Since the buffer as a whole is provided to io_uring in a pool, I think it would be difficult to do this more generally. |
I have written code to try out...
I am confident that it will work fine. Once all the needed info has been extracted, there seems to be plenty of space in front of the payload to play with... Note the comment above s_msgh declaration. Before understanding that point, I was keeping track of all the inflight multishot recvmsg struct msgh in a hash table. This was an unnecessarily complicated setup. I have a similar static global struct msghdr on the sqe issuing side. For the benefit of all users, I think that a small note in the documentation about this could be helpful! |
https://github.com/openssl/openssl/blob/master/include/internal/ktls.h#L152
openssl tricks recvmsg() into writing 5 bytes into the user buffer so that it can recreate the TLS header based on the ancillary data returned to avoid recopying the whole thing.
As a side note, this is required only for TLSv1.2. This is not used with TLSv1.3...
Because of the way that recvmsg_out is packed into the provided buffer, this is not possible when doing the recvmsg call with io_uring recvmsg multishot.
I'll try to artificially increase the controllen to see if I can still do it. This is hackery but probably possible.
Not really an issue per se but this is something that I wanted to bring to your radar if this type of trickery is common enough to justify facilitating this type of operation explicitly.
The text was updated successfully, but these errors were encountered: