All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCHv2] linux-user: Fix sched_getaffinity mask size
@ 2018-02-11 17:47 Samuel Thibault
  2018-02-12  7:23 ` Laurent Vivier
  2018-02-15 13:32 ` Laurent Vivier
  0 siblings, 2 replies; 3+ messages in thread
From: Samuel Thibault @ 2018-02-11 17:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Samuel Thibault, Laurent Vivier, Riku Voipio

We properly computed the capped mask size to be put to the application
buffer, but didn't actually used it. Also, we need to return the capped mask
size instead of 0 on success.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

---
Difference from v1:
- simplify fix
---
 linux-user/syscall.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 82b35a6bdf..bcda3362fc 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10493,7 +10493,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
                     ret = arg2;
                 }
 
-                ret = host_to_target_cpu_mask(mask, mask_size, arg3, arg2);
+                if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
+                    goto efault;
+                }
             }
         }
         break;
-- 
2.15.1

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

* Re: [Qemu-devel] [PATCHv2] linux-user: Fix sched_getaffinity mask size
  2018-02-11 17:47 [Qemu-devel] [PATCHv2] linux-user: Fix sched_getaffinity mask size Samuel Thibault
@ 2018-02-12  7:23 ` Laurent Vivier
  2018-02-15 13:32 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2018-02-12  7:23 UTC (permalink / raw)
  To: Samuel Thibault, qemu-devel; +Cc: Riku Voipio

Le 11/02/2018 à 18:47, Samuel Thibault a écrit :
> We properly computed the capped mask size to be put to the application
> buffer, but didn't actually used it. Also, we need to return the capped mask
> size instead of 0 on success.
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> ---
> Difference from v1:
> - simplify fix
> ---
>  linux-user/syscall.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 82b35a6bdf..bcda3362fc 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -10493,7 +10493,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>                      ret = arg2;
>                  }
>  
> -                ret = host_to_target_cpu_mask(mask, mask_size, arg3, arg2);
> +                if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
> +                    goto efault;
> +                }
>              }
>          }
>          break;
> 

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

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

* Re: [Qemu-devel] [PATCHv2] linux-user: Fix sched_getaffinity mask size
  2018-02-11 17:47 [Qemu-devel] [PATCHv2] linux-user: Fix sched_getaffinity mask size Samuel Thibault
  2018-02-12  7:23 ` Laurent Vivier
@ 2018-02-15 13:32 ` Laurent Vivier
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2018-02-15 13:32 UTC (permalink / raw)
  To: Samuel Thibault, qemu-devel; +Cc: Riku Voipio

Le 11/02/2018 à 18:47, Samuel Thibault a écrit :
> We properly computed the capped mask size to be put to the application
> buffer, but didn't actually used it. Also, we need to return the capped mask
> size instead of 0 on success.
> 
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> 
> ---
> Difference from v1:
> - simplify fix
> ---
>  linux-user/syscall.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 82b35a6bdf..bcda3362fc 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -10493,7 +10493,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
>                      ret = arg2;
>                  }
>  
> -                ret = host_to_target_cpu_mask(mask, mask_size, arg3, arg2);
> +                if (host_to_target_cpu_mask(mask, mask_size, arg3, ret)) {
> +                    goto efault;
> +                }
>              }
>          }
>          break;
> 

Applied to my 'linux-user-for-2.12' branch.

Thanks,
Laurent

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

end of thread, other threads:[~2018-02-15 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-11 17:47 [Qemu-devel] [PATCHv2] linux-user: Fix sched_getaffinity mask size Samuel Thibault
2018-02-12  7:23 ` Laurent Vivier
2018-02-15 13:32 ` Laurent Vivier

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.