net-timestamp: fix allocation error in test
authorWillem de Bruijn <willemb@google.com>
Thu, 4 Sep 2014 14:15:45 +0000 (10:15 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 6 Sep 2014 00:31:03 +0000 (17:31 -0700)
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 <dborkman@redhat.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Documentation/networking/timestamping/txtimestamp.c

index e5b0b98a89afef1b607eba662b46a14def1b85f5..b32fc2a07734ca28ac60a30913dab738b8111f57 100644 (file)
@@ -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;