提交 18a47e6d 编写于 作者: W Willem de Bruijn 提交者: David S. Miller

net-timestamp: fix allocation error in test

A buffer is incorrectly zeroed to the length of the pointer. If
cfg_payload_len < sizeof(void *) this can overwrites unrelated memory.
The buffer contents are never read, so no need to zero.

Fixes: 8fe2f761 ("net-timestamp: expand documentation")
Reported-by: NDaniel Borkmann <dborkman@redhat.com>
Signed-off-by: NWillem de Bruijn <willemb@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b1c84927
......@@ -192,7 +192,6 @@ static int recv_errmsg(int fd)
memset(&msg, 0, sizeof(msg));
memset(&entry, 0, sizeof(entry));
memset(ctrl, 0, sizeof(ctrl));
memset(data, 0, sizeof(data));
entry.iov_base = data;
entry.iov_len = cfg_payload_len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册