netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 2/8] netfilter: nft_exthdr: call ipv6_find_hdr() with explicitly initialized offset
Date: Sat, 28 Dec 2013 23:03:01 +0100	[thread overview]
Message-ID: <1388268187-11569-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1388268187-11569-1-git-send-email-pablo@netfilter.org>

From: Daniel Borkmann <dborkman@redhat.com>

In nft's nft_exthdr_eval() routine we process IPv6 extension header
through invoking ipv6_find_hdr(), but we call it with an uninitialized
offset variable that contains some stack value. In ipv6_find_hdr()
we then test if the value of offset != 0 and call skb_header_pointer()
on that offset in order to map struct ipv6hdr into it. Fix it up by
initializing offset to 0 as it was probably intended to be.

Fixes: 96518518cc41 ("netfilter: add nftables")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 net/netfilter/nft_exthdr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nft_exthdr.c b/net/netfilter/nft_exthdr.c
index 8e0bb75..55c939f 100644
--- a/net/netfilter/nft_exthdr.c
+++ b/net/netfilter/nft_exthdr.c
@@ -31,7 +31,7 @@ static void nft_exthdr_eval(const struct nft_expr *expr,
 {
 	struct nft_exthdr *priv = nft_expr_priv(expr);
 	struct nft_data *dest = &data[priv->dreg];
-	unsigned int offset;
+	unsigned int offset = 0;
 	int err;
 
 	err = ipv6_find_hdr(pkt->skb, &offset, priv->type, NULL, NULL);
-- 
1.7.10.4


  parent reply	other threads:[~2013-12-28 22:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-28 22:02 [PATCH 0/8] Netfilter/IPVS fixes for net Pablo Neira Ayuso
2013-12-28 22:03 ` [PATCH 1/8] netfilter: nfnetlink_log: unset nf_loggers for netns when unloading module Pablo Neira Ayuso
2013-12-28 22:03 ` Pablo Neira Ayuso [this message]
2013-12-28 22:03 ` [PATCH 3/8] netfilter: nf_ct_timestamp: Fix BUG_ON after netns deletion Pablo Neira Ayuso
2013-12-28 22:03 ` [PATCH 4/8] netfilter: WARN about wrong usage of sequence number adjustments Pablo Neira Ayuso
2013-12-28 22:03 ` [PATCH 5/8] ipvs: correct usage/allocation of seqadj ext in ipvs Pablo Neira Ayuso
2013-12-28 22:03 ` [PATCH 6/8] netfilter: nf_tables: fix dumping with large number of sets Pablo Neira Ayuso
2013-12-28 22:03 ` [PATCH 7/8] netfilter: nf_tables: fix oops when updating table with user chains Pablo Neira Ayuso
2013-12-28 22:03 ` [PATCH 8/8] netfilter: nf_tables: fix wrong datatype in nft_validate_data_load() Pablo Neira Ayuso
2013-12-29  5:29 ` [PATCH 0/8] Netfilter/IPVS fixes for net David Miller

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=1388268187-11569-3-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --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).