From 8b4c30af5e25e3c18abd546dc275c8c372d70f03 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 10 Feb 2021 10:45:11 +0100 Subject: [PATCH] swrap: don't read the callers msg_control buffer in swrap_recvmsg_before_unix() 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 Reviewed-by: Andreas Schneider --- src/socket_wrapper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 59fb07d..a950a0a 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -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; -- GitLab