From: Laurent Vivier Date: Thu, 16 Jun 2016 19:01:36 +0000 (+0200) Subject: linux-user: fd_trans_host_to_target_data() must process only received data X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~6^2~13^2~6^2~161^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48dc0f2c3d87c74c31a27e1d17dabf26c378b1e8;p=sdk%2Femulator%2Fqemu.git linux-user: fd_trans_host_to_target_data() must process only received data if we process the whole buffer, the netlink helpers can try to swap invalid data. Signed-off-by: Laurent Vivier Signed-off-by: Riku Voipio Reviewed-by: Peter Maydell --- diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 33409c01ba..4b0d791104 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -2991,7 +2991,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, len = ret; if (fd_trans_host_to_target_data(fd)) { ret = fd_trans_host_to_target_data(fd)(msg.msg_iov->iov_base, - msg.msg_iov->iov_len); + len); } else { ret = host_to_target_cmsg(msgp, &msg); }