Skip to contentSkip to conversation

net-timestamp: fix allocation error in test

PATCH Applied Willem de Bruijn 2 participants 2 messages Sep 4, 2014 – Sep 6, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 Documentation/networking/timestamping/txtimestamp.c | 1 -
 1 file changed, 1 deletion(-)
Documentation/networking/timestamping/txtimestamp.c +0 -1
index e5b0b98..b32fc2a 100644
@@ -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;
Signature · 1 line
2.1.0.rc2.206.gedb03e5
maintainer Applied
#1 lore raw

From: Willem de Bruijn <[email protected]>
Date: Thu, 4 Sep 2014 10:15:45 -0400

Quoted 8 lines

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")

Applied, thanks.