fix io_uring_recvmsg_cmsg_nexthdr logic
PATCH 1/1 fix io_uring_recvmsg_cmsg_nexthdr logic
io_uring_recvmsg_cmsg_nexthdr was using the payload to delineate the end of the cmsg list, but really it needs to use whatever was returned by the kernel.
--- src/include/liburing.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/include/liburing.h +2 -1
@@ -745,7 +745,8 @@ io_uring_recvmsg_cmsg_nexthdr(struct io_uring_recvmsg_out *o, struct msghdr *m,if (cmsg->cmsg_len <sizeof (struct cmsghdr ))return NULL ; - end = (unsigned char *)io_uring_recvmsg_payload (o, m); + end = (unsigned char *)io_uring_recvmsg_cmsg_firsthdr (o, m) + + o->controllen; cmsg = (struct cmsghdr *)((unsigned char *) cmsg +CMSG_ALIGN (cmsg->cmsg_len));
Signature · 1 line
2.30.2
Jens Axboe
maintainerQuoted 3 lines · Dylan Yudaken
io_uring_recvmsg_cmsg_nexthdrwas using the payload to delineate the end of the cmsg list, but really it needs to use whatever was returned by the kernel.
Thanks, this works for me. I'll add it with a tested-by as well.
Signature · 1 line
Jens Axboe
Quoted 5 lines · Dylan Yudaken
io_uring_recvmsg_cmsg_nexthdrwas using the payload to delineate the end of the cmsg list, but really it needs to use whatever was returned by the kernel.
Applied, thanks!
[1/1] fix io_uring_recvmsg_cmsg_nexthdr logic
commit: 4e6eec8bdea906fe5341c97aef96986d605004e9
Best regards,
Signature · 1 line
Jens Axboe
Quoted 7 lines · Dylan Yudaken
io_uring_recvmsg_cmsg_nexthdrwas using the payload to delineate the end of the cmsg list, but really it needs to use whatever was returned by the kernel.Reported-by Jens Axboe <[email protected]>Fixes 874406f ("add multishot recvmsg API")Signed-off-by Dylan Yudaken <[email protected]>
The Fixes tag must be at least 12 chars.
Signature · 1 line
Ammar Faizi
Jens Axboe
maintainerQuoted 10 lines · Ammar Faizi
Quoted 7 lines · Dylan Yudaken
io_uring_recvmsg_cmsg_nexthdrwas using the payload to delineate the end of the cmsg list, but really it needs to use whatever was returned by the kernel.Reported-by Jens Axboe <[email protected]>Fixes 874406f ("add multishot recvmsg API")Signed-off-by Dylan Yudaken <[email protected]>The Fixes tag must be at least 12 chars.
It was fixed up while applying.
Signature · 1 line
Jens Axboe