Re: [PATCH] io_uring/net: keep recvmsg buffer select length within MAX_RW_COUNT
From: Jens Axboe
Date: Fri Oct 23 2026 - 11:35:20 EST
On 10/23/26 5:22 AM, Yichong Chen wrote:
> io_recvmsg() takes the transfer length from the ring provided buffer when
> sqe->len is 0, and such a buffer can be up to 4G. min_ret is an int, so 2G
> or more makes it negative and the (ret < min_ret) block is skipped, and the
> oversized length reaches the socket layer unchanged: an empty socket then
> completes with 0 instead of arming poll, and a short read is reported as
> complete. Clamp the length to MAX_RW_COUNT, as io_recv() does.
>
> Fixes: 78d0d2063bab ("io_uring/net: disable partial retries for recvmsg with cmsg")
Don't think that's correct, it just moved the check. Should be:
c7fb19428d67 ("io_uring: add support for ring mapped supplied buffers")
instead. I will fix that up. Waiting on Linus pulling the
previous bits, then I will queue this up for 7.4.
--
Jens Axboe