diff options
author | Giuseppe Musacchio | 2021-05-03 19:41:59 +0200 |
---|---|---|
committer | Laurent Vivier | 2021-05-18 07:09:58 +0200 |
commit | 0fa259dd7986d152294f31a6483272a4cb627b6d (patch) | |
tree | 216a407cf9e3455b1228bbda561d4f4e63720054 /linux-user | |
parent | linux-user: Add copy_file_range to strace.list (diff) | |
download | qemu-0fa259dd7986d152294f31a6483272a4cb627b6d.tar.gz qemu-0fa259dd7986d152294f31a6483272a4cb627b6d.tar.xz qemu-0fa259dd7986d152294f31a6483272a4cb627b6d.zip |
linux-user: Fix erroneous conversion in copy_file_range
The implicit cast from abi_long to size_t may introduce an intermediate
unwanted sign-extension of the value for 32bit targets running on 64bit
hosts.
Signed-off-by: Giuseppe Musacchio <thatlemon@gmail.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210503174159.54302-3-thatlemon@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/syscall.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 4d52b2cfe3..e05870c338 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -13244,8 +13244,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } poutoff = &outoff; } + /* Do not sign-extend the count parameter. */ ret = get_errno(safe_copy_file_range(arg1, pinoff, arg3, poutoff, - arg5, arg6)); + (abi_ulong)arg5, arg6)); if (!is_error(ret) && ret > 0) { if (arg2) { if (put_user_u64(inoff, arg2)) { |