Skip to contentSkip to conversation

Clear ulog message to prevent leaking uninitializied memory to user

PATCH New Mark Leander 1 participant 1 message Aug 10, 2010

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

PATCH 1/1 Clear ulog message to prevent leaking uninitializied memory to user

ipt_ulog_packet() did not properly blank the char[] members indev_name, outdev_name, prefix and mac of struct ulog_packet_msg. This leaks uninitialized kernel memory to user space in the form of netlink NFLOG broadcasts. This change clears the whole structure initially to avoid this.

---
 net/ipv4/netfilter/ipt_ULOG.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
net/ipv4/netfilter/ipt_ULOG.c +1 -0
index 446e0f4..07b36b0 100644
@@ -204,6 +204,7 @@ static void ipt_ulog_packet(unsigned int hooknum,
 	ub->qlen++;
 
 	pm = NLMSG_DATA(nlh);
+	memset(pm, 0, sizeof(*pm));
 
 	/* We might not have a timestamp, get one */
 	if (skb->tstamp.tv64 == 0)
Signature · 1 line
1.7.0.4