Commit c64eff36 authored by Qingyue Zhang's avatar Qingyue Zhang Committed by Jens Axboe
Browse files

io_uring/kbuf: fix signedness in this_len calculation



When importing and using buffers, buf->len is considered unsigned.
However, buf->len is converted to signed int when committing. This can
lead to unexpected behavior if the buffer is large enough to be
interpreted as a negative value. Make min_t calculation unsigned.

Fixes: ae98dbf4 ("io_uring/kbuf: add support for incremental buffer consumption")
Co-developed-by: default avatarSuoxing Zhang <aftern00n@qq.com>
Signed-off-by: default avatarSuoxing Zhang <aftern00n@qq.com>
Signed-off-by: default avatarQingyue Zhang <chunzhennn@qq.com>
Link: https://lore.kernel.org/r/tencent_4DBB3674C0419BEC2C0C525949DA410CA307@qq.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e4e6aaea
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment