swrap: don't read the callers msg_control buffer in swrap_recvmsg_before_unix()
authorStefan Metzmacher <metze@samba.org>
Wed, 10 Feb 2021 09:45:11 +0000 (10:45 +0100)
committerAndreas Schneider <asn@samba.org>
Wed, 10 Feb 2021 09:50:17 +0000 (10:50 +0100)
For recvmsg() msg_control is a write only buffer, that is filled by the
kernel, but the kernel won't read from that buffer. So we shouldn't
read from (copy) it either.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/socket_wrapper.c

index 59fb07dc5909274633927440190e46038c740392..a950a0a0dbc882e8ca8b95278bcd1f013b0036ab 100644 (file)
@@ -5993,7 +5993,6 @@ static int swrap_recvmsg_before_unix(struct msghdr *msg_in,
        if (cm_data == NULL) {
                return -1;
        }
-       memcpy(cm_data, msg_in->msg_control, msg_in->msg_controllen);
 
        msg_tmp->msg_controllen = cm_data_space;
        msg_tmp->msg_control = cm_data;