]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: mmap(): use unsigned offset type in riscv_sys_mmap
authorJessica Liu <liu.xuemei1@zte.com.cn>
Fri, 1 Aug 2025 02:49:48 +0000 (10:49 +0800)
committerPaul Walmsley <pjw@kernel.org>
Thu, 18 Sep 2025 14:19:47 +0000 (08:19 -0600)
commit316b60b984d5be9b86047cdf3bf16d51c7c70cc5
tree71d1d2b34aef83033e09953b4c4f0604d4fb9495
parent01dc937ac18dd0bc0fc77c24030639553f977ffe
riscv: mmap(): use unsigned offset type in riscv_sys_mmap

The variable type of offset should be consistent with the relevant
interfaces of mmap which described in commit 295f10061af0 ("syscalls:
mmap(): use unsigned offset type consistently"). Otherwise, a user input
with the top bit set would result in a negative page offset rather than a
large one.

Signed-off-by: Jessica Liu <liu.xuemei1@zte.com.cn>
Tested-by: Han Gao <rabenda.cn@gmail.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Nutty Liu <liujingqi@lanxincomputing.com>
Link: https://lore.kernel.org/r/20250801104948133AaMr5S6E382PbNNhoJgHA@zte.com.cn
[pjw@kernel.org: hand-applied mangled patch; fixed checkpatch error]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/kernel/sys_riscv.c