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.

Reported-and-tested-by: Jens Axboe <axboe@kernel.dk>
Fixes: df4f819eaf ("add multishot recvmsg API")
Signed-off-by: Dylan Yudaken <dylany@fb.com>
Link: https://lore.kernel.org/r/20220718133429.726628-1-dylany@fb.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Dylan Yudaken
2022-07-18 06:34:29 -07:00
committed by Jens Axboe
parent 0b350e9af9
commit 1eecbb527d
+2 -1
View File
@@ -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));