]> git.proxmox.com Git - mirror_lxc.git/commitdiff
seccomp: recvmsg with MSG_TRUNC
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Mon, 8 Jul 2019 16:00:20 +0000 (18:00 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 9 Jul 2019 10:25:10 +0000 (12:25 +0200)
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>
src/lxc/seccomp.c

index 5b33413933d125f851c8a092fc8bc99753240f0f..978b1a2ca6f06208e2bcf8175b4eceb361cf968c 100644 (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);