Skip to content

Commit

Permalink
net-timestamp: fix allocation error in test
Browse files Browse the repository at this point in the history
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: 8fe2f76 ("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>
  • Loading branch information
Willem de Bruijn authored and David S. Miller committed Sep 6, 2014
1 parent b1c8492 commit 18a47e6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion Documentation/networking/timestamping/txtimestamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 18a47e6

Please sign in to comment.