diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2023-07-07 21:40:41 +0100 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2023-07-15 08:02:32 +0100 |
commit | 55baec0f4c535e24a060070592b8c51d75108481 (patch) | |
tree | 6a807cbafc3928642e00e1d0c5ea1faa0d23cb17 /linux-user/user-mmap.h | |
parent | 0dd558121c41dd4578517a90668c24e7fcdd46ba (diff) | |
download | qemu-55baec0f4c535e24a060070592b8c51d75108481.zip qemu-55baec0f4c535e24a060070592b8c51d75108481.tar.gz qemu-55baec0f4c535e24a060070592b8c51d75108481.tar.bz2 |
linux-user: Widen target_mmap offset argument to off_t
We build with _FILE_OFFSET_BITS=64, so off_t = off64_t = uint64_t.
With an extra cast, this fixes emulation of mmap2, which could
overflow the computation of the full value of offset.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230707204054.8792-14-richard.henderson@linaro.org>
Diffstat (limited to 'linux-user/user-mmap.h')
-rw-r--r-- | linux-user/user-mmap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/user-mmap.h b/linux-user/user-mmap.h index 480ce1c..3fc986f 100644 --- a/linux-user/user-mmap.h +++ b/linux-user/user-mmap.h @@ -20,7 +20,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot); abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, - int flags, int fd, abi_ulong offset); + int flags, int fd, off_t offset); int target_munmap(abi_ulong start, abi_ulong len); abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, abi_ulong new_size, unsigned long flags, |