diff options
author | Peter Maydell | 2016-07-07 16:44:43 +0200 |
---|---|---|
committer | Riku Voipio | 2016-07-19 14:23:17 +0200 |
commit | a1e221929f570cc84661158421f942b3328a9fd1 (patch) | |
tree | ff0d7cfba933de9ee8d7dd4dd9a00b793e795105 /hw/intc/arm_gicv3_common.c | |
parent | linux-user: Forget about synchronous signal once it is delivered (diff) | |
download | qemu-a1e221929f570cc84661158421f942b3328a9fd1.tar.gz qemu-a1e221929f570cc84661158421f942b3328a9fd1.tar.xz qemu-a1e221929f570cc84661158421f942b3328a9fd1.zip |
linux-user: Handle short lengths in host_to_target_sockaddr()
If userspace specifies a short buffer for a target sockaddr,
the kernel will only copy in as much as it has space for
(or none at all if the length is zero) -- see the kernel
move_addr_to_user() function. Mimic this in QEMU's
host_to_target_sockaddr() routine.
In particular, this fixes a segfault running the LTP
recvfrom01 test, where the guest makes a recvfrom()
call with a bad buffer pointer and other parameters which
cause the kernel to set the addrlen to zero; because we
did not skip the attempt to swap the sa_family field we
segfaulted on the bad address.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'hw/intc/arm_gicv3_common.c')
0 files changed, 0 insertions, 0 deletions