summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-09-18 15:45:41 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-25 11:13:48 +0200
commit695673eb5711ee5eb1769481cf1503714716a7d1 (patch)
tree914bc2af72345218ba9c2c1e75faf6e0375a6d90
parent93e9d0293d3b4c247873c19ffe9426154bb82b9e (diff)
io_uring/kbuf: drop WARN_ON_ONCE() from incremental length check
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>
-rw-r--r--io_uring/kbuf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/kbuf.h b/io_uring/kbuf.h
index 2586a292dfb9..a3ad8aea45c8 100644
--- a/io_uring/kbuf.h
+++ b/io_uring/kbuf.h
@@ -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) {