On 10/2/23 16:23, John Paul Adrian Glaubitz wrote:
Hi!

There is an unaddressed issue in qemu-user [1] which results in getresuid()
returning an incorrect UID due to a byte-swapping issue on sparc64.

This issue is fixed by the patch below which was suggested by Phillippe
Mathieu-Daudé, but the corresponding line [2] has not been patched yet.

Could anyone step up and fix the bug?

Sorry Adrian, this is in my TODO list, but I couldn't find the time to
write a good commit description to this fix yet :~(

Thanks,
Adrian

diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 77864de57f..4d4b4a22e8 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -61,7 +61,7 @@
#if (defined(TARGET_I386) && defined(TARGET_ABI32)) \
       || (defined(TARGET_ARM) && defined(TARGET_ABI32)) \
-     || defined(TARGET_SPARC) \
+     || (defined(TARGET_SPARC) && defined(TARGET_ABI32)) \
       || defined(TARGET_M68K) || defined(TARGET_SH4) || defined(TARGET_CRIS)
       /* 16 bit uid wrappers emulation */
   #define USE_UID16

[1] https://gitlab.com/qemu-project/qemu/-/issues/1394
[2] 
https://gitlab.com/qemu-project/qemu/-/blob/master/linux-user/syscall_defs.h#L64



Reply via email to