qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe()
@ 2022-07-17 16:21 Helge Deller
  2022-07-23 21:03 ` Richard Henderson
  2022-07-23 22:22 ` Laurent Vivier
  0 siblings, 2 replies; 3+ messages in thread
From: Helge Deller @ 2022-07-17 16:21 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel

When writing back the fd[1] pipe file handle to emulated userspace
memory, use sizeof(abi_int) as offset insted of the hosts's int type.
There is no functional change in this patch.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 991b85e6b4..1e6e814871 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1624,7 +1624,7 @@ static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes,
     }

     if (put_user_s32(host_pipe[0], pipedes)
-        || put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0])))
+        || put_user_s32(host_pipe[1], pipedes + sizeof(abi_int)))
         return -TARGET_EFAULT;
     return get_errno(ret);
 }


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe()
  2022-07-17 16:21 [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe() Helge Deller
@ 2022-07-23 21:03 ` Richard Henderson
  2022-07-23 22:22 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Henderson @ 2022-07-23 21:03 UTC (permalink / raw)
  To: Helge Deller, Laurent Vivier, qemu-devel

On 7/17/22 21:51, Helge Deller wrote:
> When writing back the fd[1] pipe file handle to emulated userspace
> memory, use sizeof(abi_int) as offset insted of the hosts's int type.
> There is no functional change in this patch.
> 
> Signed-off-by: Helge Deller<deller@gmx.de>

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe()
  2022-07-17 16:21 [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe() Helge Deller
  2022-07-23 21:03 ` Richard Henderson
@ 2022-07-23 22:22 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2022-07-23 22:22 UTC (permalink / raw)
  To: Helge Deller, qemu-devel

Le 17/07/2022 à 18:21, Helge Deller a écrit :
> When writing back the fd[1] pipe file handle to emulated userspace
> memory, use sizeof(abi_int) as offset insted of the hosts's int type.
> There is no functional change in this patch.
> 
> Signed-off-by: Helge Deller <deller@gmx.de>
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 991b85e6b4..1e6e814871 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1624,7 +1624,7 @@ static abi_long do_pipe(CPUArchState *cpu_env, abi_ulong pipedes,
>       }
> 
>       if (put_user_s32(host_pipe[0], pipedes)
> -        || put_user_s32(host_pipe[1], pipedes + sizeof(host_pipe[0])))
> +        || put_user_s32(host_pipe[1], pipedes + sizeof(abi_int)))
>           return -TARGET_EFAULT;
>       return get_errno(ret);
>   }
> 

Applied to my linux-user-for-7.1 branch.

Thanks,
Laurent



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-23 22:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-17 16:21 [PATCH] linux-user: Use target abi_int type for pipefd[1] in pipe() Helge Deller
2022-07-23 21:03 ` Richard Henderson
2022-07-23 22:22 ` Laurent Vivier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).