Re: [PATCH] io_uring/kbuf: use READ_ONCE() for userspace-mapped memory
From: Jens Axboe
Date: Thu Dec 04 2025 - 17:47:13 EST
On Thu, 04 Dec 2025 15:43:31 -0700, Caleb Sander Mateos wrote:
> The struct io_uring_buf elements in a buffer ring are in a memory region
> accessible from userspace. A malicious/buggy userspace program could
> therefore write to them at any time, so they should be accessed with
> READ_ONCE() in the kernel. Commit 98b6fa62c84f ("io_uring/kbuf: always
> use READ_ONCE() to read ring provided buffer lengths") already switched
> the reads of the len field to READ_ONCE(). Do the same for bid and addr.
>
> [...]
Applied, thanks!
[1/1] io_uring/kbuf: use READ_ONCE() for userspace-mapped memory
commit: 78385c7299f7514697d196b3233a91bd5e485591
Best regards,
--
Jens Axboe