Closed SUPERCILEX closed 7 months ago
This looks good, is there a regression test possible?
I added a test, but it's pretty terrible as I didn't want to deal with cancelling the recvmulti to change its header length or add ancillary data. That said, it does at least test for payload and namelen truncation.
@quininer any chance you can run the test on your machine? It works fine on mine, so I'm not sure what's going on in CI. Maybe old kernels didn't set the trunc flag?
You can try check some flag to skip it on ci.
Sounds good, I added a kernel version check for 6.6 (which is what I'm running), but it might work on earlier kernels.
maybe you are interested review this @lucab :)
Ok, I think I addressed all the feedback, so should be ready for another round!
Thank you!
The current parsing doesn't actually let the buffer ever be truncated and instead errors out immediately. This PR fixes it to only ever out when the buffer is smaller than the header. This implementation matches liburing's validation: https://github.com/axboe/liburing/blob/c44319a6bfb9953b430325227a94136690c19c33/src/include/liburing.h#L831-L834