linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom syscalls
commitcd8133679f7e0e2c292f631f1c78b2452d2435c7
authorAndreas Schwab <schwab@suse.de>
Thu, 14 Feb 2019 11:43:40 +0000 (14 12:43 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 7 Mar 2019 09:57:29 +0000 (7 10:57 +0100)
treec307b9b68ec1defbacba25defdfd35169258e54e
parente20e3ec928ebdcad051ed3ac71ccf46a5aacc59b
linux-user: fix emulation of accept4/getpeername/getsockname/recvfrom syscalls

System calls that return a socket address do so by writing the (possibly
truncated) address into the provided buffer space, but setting the
addrlen parameter to the actual size of the address.  To determine how
much to copy back to the target memory the emulation needs to remember
the incoming value of the addrlen parameter, so that it doesn't write
past the buffer limits.

Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <mvmimxmppcj.fsf_-_@suse.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/syscall.c