From: Willem de Bruijn Date: Thu, 4 Sep 2014 14:15:45 +0000 (-0400) Subject: net-timestamp: fix allocation error in test X-Git-Tag: Ubuntu-5.10.0-12.13~16058^2~152 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=18a47e6d8af01db1b691802a6bb8eae73d83ad9e;p=mirror_ubuntu-hirsute-kernel.git 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: 8fe2f761cae9 ("net-timestamp: expand documentation") Reported-by: Daniel Borkmann Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/Documentation/networking/timestamping/txtimestamp.c b/Documentation/networking/timestamping/txtimestamp.c index e5b0b98a89af..b32fc2a07734 100644 --- a/Documentation/networking/timestamping/txtimestamp.c +++ b/Documentation/networking/timestamping/txtimestamp.c @@ -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;