Commit 48dc0f2c authored by Laurent Vivier's avatar Laurent Vivier Committed by Riku Voipio
Browse files

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: default avatarLaurent Vivier <laurent@vivier.eu>
Signed-off-by: default avatarRiku Voipio <riku.voipio@linaro.org>
Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 84f34b00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
            }