6.12-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe axboe@kernel.dk
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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/io_uring/kbuf.h +++ b/io_uring/kbuf.h @@ -143,7 +143,7 @@ static inline bool io_kbuf_commit(struct 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) {