From: Tamas Lengyel <tamas.k.lengyel@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH] libnetfilter_queue: Fix Valgrind errors of unitialized byte(s) during call to nfq_unbind_pf
Date: Sat, 1 Jun 2013 00:20:57 +0200 [thread overview]
Message-ID: <CABfawhm7V6htNehkNrf-pCSsHt-gjZCOgBhAMAoCh7UyY=rapQ@mail.gmail.com> (raw)
Valgrind generates error reports of unitialized byte(s) during a call
to the nfq_unbind_pf function:
==00:00:00:08.662 22111== 4 errors in context 1 of 1:
==00:00:00:08.662 22111== Syscall param socketcall.sendto(msg) points
to uninitialised byte(s)
...
==00:00:00:08.662 22111== Uninitialised value was created by a stack allocation
==00:00:00:08.662 22111== at 0x679C30B: __build_send_cfg_msg
(libnetfilter_queue.c:178
The following (tiny) patch gets rid of the issue. I made the patch
available on github as well at
git://github.com/tklengyel/libnetfilter_queue.git
Signed-off-by: Tamas K Lengyel <tamas.k.lengyel@gmail.com>
---
diff --git a/src/libnetfilter_queue.c b/src/libnetfilter_queue.c
index 2894ccd..bf944f0 100644
--- a/src/libnetfilter_queue.c
+++ b/src/libnetfilter_queue.c
@@ -186,6 +186,7 @@ __build_send_cfg_msg(struct nfq_handle *h, u_int8_t command,
nfnl_fill_hdr(h->nfnlssh, &u.nmh, 0, AF_UNSPEC, queuenum,
NFQNL_MSG_CONFIG, NLM_F_REQUEST|NLM_F_ACK);
+ cmd._pad = 0;
cmd.command = command;
cmd.pf = htons(pf);
nfnl_addattr_l(&u.nmh, sizeof(u), NFQA_CFG_CMD, &cmd, sizeof(cmd));
next reply other threads:[~2013-05-31 22:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-31 22:20 Tamas Lengyel [this message]
2013-06-01 9:34 ` [PATCH] libnetfilter_queue: Fix Valgrind errors of unitialized byte(s) during call to nfq_unbind_pf Florian Westphal
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='CABfawhm7V6htNehkNrf-pCSsHt-gjZCOgBhAMAoCh7UyY=rapQ@mail.gmail.com' \
--to=tamas.k.lengyel@gmail.com \
--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).