Commit d7357296 authored by Jens Axboe's avatar Jens Axboe Committed by sanglipeng
Browse files

io_uring: ensure recv and recvmsg handle MSG_WAITALL correctly

stable inclusion
from stable-v5.10.165
commit aadd9b093018183c7895aa07395b786bc71c3d31
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=aadd9b093018183c7895aa07395b786bc71c3d31



--------------------------------

commit 7ba89d2a upstream.

We currently don't attempt to get the full asked for length even if
MSG_WAITALL is set, if we get a partial receive. If we do see a partial
receive, then just note how many bytes we did and return -EAGAIN to
get it retried.

The iov is advanced appropriately for the vector based case, and we
manually bump the buffer and remainder for the non-vector case.

Cc: stable@vger.kernel.org
Reported-by: default avatarConstantine Gavrilov <constantine.gavrilov@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 1f5d5842
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment