netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Leander <mark.leander@topicbranch.net>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org,
	Mark Leander <mark.leander@topicbranch.net>
Subject: [PATCH] Clear ulog message to prevent leaking uninitializied memory to user
Date: Tue, 10 Aug 2010 20:22:31 +0000	[thread overview]
Message-ID: <1281471751-3397-1-git-send-email-mark.leander@topicbranch.net> (raw)

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.

Signed-off-by: Mark Leander <mark.leander@topicbranch.net>
---
 net/ipv4/netfilter/ipt_ULOG.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c
index 446e0f4..07b36b0 100644
--- a/net/ipv4/netfilter/ipt_ULOG.c
+++ b/net/ipv4/netfilter/ipt_ULOG.c
@@ -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)
-- 
1.7.0.4


                 reply	other threads:[~2010-08-10 20:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281471751-3397-1-git-send-email-mark.leander@topicbranch.net \
    --to=mark.leander@topicbranch.net \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).