seccomp: recvmsg with MSG_TRUNC

We only read the message without the cookie. For now assert
that the sender also didn't try to send more by letting
`recvmsg()` return the original size of the packet if it was
longer.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2019-07-08 18:00:20 +02:00
parent 214008eeb2
commit 87e547d9c7

View File

@ -1466,7 +1466,8 @@ retry:
goto out;
}
bytes = lxc_recvmsg_nointr_iov(listener_proxy_fd, iov,iov_len, 0);
bytes = lxc_recvmsg_nointr_iov(listener_proxy_fd, iov,iov_len,
MSG_TRUNC);
if (bytes != (ssize_t)msg_base_size) {
SYSERROR("Failed to receive message from seccomp proxy");
seccomp_notify_default_answer(fd, req, resp, hdlr);