Skip to content

Commit

Permalink
linux-user: fd_trans_host_to_target_data() must process only received…
Browse files Browse the repository at this point in the history
… data

if we process the whole buffer, the netlink helpers can try
to swap invalid data.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
  • Loading branch information
vivier authored and Riku Voipio committed Jun 26, 2016
1 parent 84f34b0 commit 48dc0f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linux-user/syscall.c
Expand Up @@ -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);
}
Expand Down

0 comments on commit 48dc0f2

Please sign in to comment.