qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] linux-user/syscall: Endian-swap [res]uid/gid


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] linux-user/syscall: Endian-swap [res]uid/gid
Date: Wed, 28 Dec 2022 21:21:01 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

On 28/12/22 16:35, Philippe Mathieu-Daudé wrote:
Various syscalls miss swapping the endiannes of the [res]uid/gid
values. Use the tswapid() helper meant to do exactly that.

Fixes: b03c60f351 ("more syscalls")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1394

This is not the correct fix, simply an API cleanup.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  linux-user/syscall.c | 55 ++++++++++++++++++++++++--------------------
  1 file changed, 30 insertions(+), 25 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 1f8c10f8ef..2aa19e33ca 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c

  #ifdef TARGET_NR_getuid
      case TARGET_NR_getuid:
-        return get_errno(high2lowuid(getuid()));
+        return get_errno(tswapid(high2lowuid(getuid())));
  #endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]