summaryrefslogtreecommitdiff
path: root/include/net/aligned_data.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2025-08-27 15:27:30 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-09-04 16:55:43 +0200
commit390a61d284e1ced088d43928dfcf6f86fffdd780 (patch)
tree63c3a4931eb2c289664f0850a113732481a9ad4e /include/net/aligned_data.h
parent3fdc52cb8471bf75046c603f0a65e904745b7fdb (diff)
io_uring/kbuf: always use READ_ONCE() to read ring provided buffer lengths
[ Upstream commit 98b6fa62c84f2e129161e976a5b9b3cb4ccd117b ] Since the buffers are mapped from userspace, it is prudent to use READ_ONCE() to read the value into a local variable, and use that for any other actions taken. Having a stable read of the buffer length avoids worrying about it changing after checking, or being read multiple times. Similarly, the buffer may well change in between it being picked and being committed. Ensure the looping for incremental ring buffer commit stops if it hits a zero sized buffer, as no further progress can be made at that point. Fixes: ae98dbf43d75 ("io_uring/kbuf: add support for incremental buffer consumption") Link: https://lore.kernel.org/io-uring/tencent_000C02641F6250C856D0C26228DE29A3D30A@qq.com/ Reported-by: Qingyue Zhang <chunzhennn@qq.com> Reported-by: Suoxing Zhang <aftern00n@qq.com> Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/net/aligned_data.h')
0 files changed, 0 insertions, 0 deletions