* [PATCH net-next] net-timestamp: fix allocation error in test
@ 2014-09-04 14:15 Willem de Bruijn
  2014-09-06  0:31 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Willem de Bruijn @ 2014-09-04 14:15 UTC (permalink / raw)
  To: netdev; +Cc: davem, dborkman, Willem de Bruijn
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>
---
 Documentation/networking/timestamping/txtimestamp.c | 1 -
 1 file changed, 1 deletion(-)
diff --git a/Documentation/networking/timestamping/txtimestamp.c b/Documentation/networking/timestamping/txtimestamp.c
index e5b0b98..b32fc2a 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;
-- 
2.1.0.rc2.206.gedb03e5
^ permalink raw reply related	[flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net-timestamp: fix allocation error in test
  2014-09-04 14:15 [PATCH net-next] net-timestamp: fix allocation error in test Willem de Bruijn
@ 2014-09-06  0:31 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-09-06  0:31 UTC (permalink / raw)
  To: willemb; +Cc: netdev, dborkman
From: Willem de Bruijn <willemb@google.com>
Date: Thu,  4 Sep 2014 10:15:45 -0400
> 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>
Applied, thanks.
^ permalink raw reply	[flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-06  0:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-04 14:15 [PATCH net-next] net-timestamp: fix allocation error in test Willem de Bruijn
2014-09-06  0:31 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).