qemu-e2k/linux-user
Laurent Vivier 42b16184d0 linux-user: fix print_syscall_err() when syscall returned value is negative
print_syscall_err() relies on the sign of the returned value to know
if it is an errno value or not.

But in some cases the returned value can have the most signicant bit
set without being an errno.

This patch restores previous behaviour that was also checking if
we can decode the errno to validate it.

This patch fixes this kind of problem (qemu-m68k):

  root@sid:/# QEMU_STRACE= ls
  3 brk(NULL) = -1 errno=21473607683 uname(0x407fff8a) = 0

to become:

  root@sid:/# QEMU_STRACE= ls
  3 brk(NULL) = 0x8001e000
  3 uname(0xffffdf8a) = 0

Fixes: c84be71f68 ("linux-user: Extend strace support to enable argument printing after syscall execution")
Cc: Filip.Bozuta@syrmia.com
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200708152435.706070-3-laurent@vivier.eu>
2020-07-14 09:29:14 +02:00
..
aarch64
alpha
arm linux-user/arm/signal.c: Drop TARGET_CONFIG_CPU_32 2020-05-21 22:05:27 +01:00
cris
generic linux-user: implement OFD locks 2020-06-05 21:23:22 +02:00
host
hppa
i386
m68k
microblaze
mips
mips64
nios2
openrisc
ppc target/ppc: Add support for scv and rfscv instructions 2020-05-27 15:29:24 +10:00
riscv
s390x
sh4
sparc linux-user/sparc64: Fix the handling of window spill trap 2020-06-29 13:00:23 +02:00
sparc64
tilegx
x86_64
xtensa
cpu_loop-common.h
elfload.c linux-user/elfload: use MAP_FIXED_NOREPLACE in pgb_reserved_va 2020-07-11 15:53:00 +01:00
errno_defs.h
exit.c
fd-trans.c linux-user: add netlink RTM_SETLINK command 2020-07-13 21:26:33 +02:00
fd-trans.h
flat.h
flatload.c
ioctls.h linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS 2020-06-29 13:10:11 +02:00
linux_loop.h
linuxload.c
main.c
Makefile.objs
mmap.c linux-user: detect overflow of MAP_FIXED mmap 2020-06-08 17:04:19 +01:00
qemu.h linux-user: Add strace support for printing arguments of ioctl() 2020-07-04 18:08:51 +02:00
safe-syscall.S
signal-common.h
signal.c
socket.h
strace.c linux-user: fix print_syscall_err() when syscall returned value is negative 2020-07-14 09:29:14 +02:00
strace.list linux-user: Add strace support for printing arguments of ioctl() 2020-07-04 18:08:51 +02:00
syscall_defs.h linux-user: syscall: ioctls: support DRM_IOCTL_VERSION 2020-06-29 13:04:37 +02:00
syscall_types.h linux-user: Add thunk argument types for SIOCGSTAMP and SIOCGSTAMPNS 2020-06-29 13:10:11 +02:00
syscall.c linux-user: refactor ipc syscall and support of semtimedop syscall 2020-07-13 21:21:02 +02:00
target_flat.h
trace-events
uaccess.c
uname.c
uname.h
vm86.c