qemu-cr16/linux-user
Peter Maydell 0db2de22fc linux-user: permit sendto() with NULL buf and 0 len
If you pass sendto() a NULL buffer, this is usually an error
(causing an EFAULT return); however if you pass a 0 length then
we should not try to validate the buffer provided. Instead we
skip the copying of the user data and possible processing
through fd_trans_target_to_host_data, and call the host syscall
with NULL, 0.

(unlock_user() permits a NULL buffer pointer for "do nothing"
so we don't need to special case the unlock code.)

Cc: qemu-stable@nongnu.org
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3102
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20251028142001.3011630-1-peter.maydell@linaro.org>
2025-10-31 12:50:15 +01:00
..
aarch64
alpha
arm
generic
hexagon
hppa
i386
include
loongarch64
m68k
microblaze
mips
mips64
openrisc
ppc
riscv
s390x
sh4
sparc
x86_64
xtensa
elfload.c
errnos.c.inc
exit.c
fd-trans.c
fd-trans.h
flat.h
flatload.c
gen-vdso-elfn.c.inc
gen-vdso.c
ioctls.h
linux_loop.h
linuxload.c
loader.h
main.c
meson.build
mmap.c
plugin-api.c
qemu.h
semihost.c
signal-common.h
signal.c
socket.h
strace.c
strace.h
strace.list
syscall.c
syscall_defs.h
syscall_types.h
thunk.c
trace-events
trace.h
uaccess.c
uname.c
uname.h
user-internals.h
user-mmap.h
vm86.c