]> www.infradead.org Git - users/hch/misc.git/commit
io_uring/zcrx: fix overshooting recv limit
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 8 Oct 2025 12:38:06 +0000 (13:38 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 8 Oct 2025 13:26:08 +0000 (07:26 -0600)
commit09cfd3c52ea76f43b3cb15e570aeddf633d65e80
tree1b88c8144d720d4c351e690a3b2d15ba72c3ae91
parentbeb97995b97532e1f215e3295e6843e59862f94b
io_uring/zcrx: fix overshooting recv limit

It's reported that sometimes a zcrx request can receive more than was
requested. It's caused by io_zcrx_recv_skb() adjusting desc->count for
all received buffers including frag lists, but then doing recursive
calls to process frag list skbs, which leads to desc->count double
accounting and underflow.

Reported-and-tested-by: Matthias Jasny <matthiasjasny@gmail.com>
Fixes: 6699ec9a23f85 ("io_uring/zcrx: add a read limit to recvzc requests")
Cc: stable@vger.kernel.org
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/zcrx.c