All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: LemonBoy <thatlemon@gmail.com>, qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org
Subject: Re: [PATCH 2/2] linux-user: Fix erroneous conversion in copy_file_range
Date: Mon, 3 May 2021 20:47:53 +0200	[thread overview]
Message-ID: <67e3e6c7-2d8e-ae00-193c-bf91ce1dcfb4@vivier.eu> (raw)
In-Reply-To: <20210503174159.54302-3-thatlemon@gmail.com>

Le 03/05/2021 à 19:41, LemonBoy a écrit :
> From: Giuseppe Musacchio <thatlemon@gmail.com>
> 
> 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>
> ---
>  linux-user/syscall.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 95d79ddc43..c425dfa278 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -13245,8 +13245,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)) {
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


  reply	other threads:[~2021-05-03 18:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-03 17:41 [PATCH 0/2] linux-user: Small fix for copy_file_range LemonBoy
2021-05-03 17:41 ` [PATCH 1/2] linux-user: Add copy_file_range to strace.list LemonBoy
2021-05-03 18:42   ` Laurent Vivier
2021-05-03 17:41 ` [PATCH 2/2] linux-user: Fix erroneous conversion in copy_file_range LemonBoy
2021-05-03 18:47   ` Laurent Vivier [this message]
2021-05-15 19:49 ` [PATCH 0/2] linux-user: Small fix for copy_file_range Laurent Vivier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67e3e6c7-2d8e-ae00-193c-bf91ce1dcfb4@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=thatlemon@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.