]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/kbuf: drop WARN_ON_ONCE() from incremental length check
authorJens Axboe <axboe@kernel.dk>
Thu, 18 Sep 2025 21:45:41 +0000 (15:45 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Sep 2025 09:13:48 +0000 (11:13 +0200)
Partially based on commit 98b6fa62c84f2e129161e976a5b9b3cb4ccd117b upstream.

This can be triggered by userspace, so just drop it. The condition
is appropriately handled.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
io_uring/kbuf.h

index 2586a292dfb91407dc580cacb5061a1b3abdb884..a3ad8aea45c8a8633a8f97d7ca3075593b7e9975 100644 (file)
@@ -143,7 +143,7 @@ static inline bool io_kbuf_commit(struct io_kiocb *req,
                struct io_uring_buf *buf;
 
                buf = io_ring_head_to_buf(bl->buf_ring, bl->head, bl->mask);
-               if (WARN_ON_ONCE(len > buf->len))
+               if (len > buf->len)
                        len = buf->len;
                buf->len -= len;
                if (buf->len) {