From: pablo@netfilter.org
To: netfilter-devel@vger.kernel.org
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH 2/5] netfilter: nf_nat: fix out-of-bounds access in address selection
Date: Thu, 13 Sep 2012 13:01:29 +0200 [thread overview]
Message-ID: <1347534092-3579-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1347534092-3579-1-git-send-email-pablo@netfilter.org>
From: Florian Westphal <fw@strlen.de>
include/linux/jhash.h:138:16: warning: array subscript is above array bounds
[jhash2() expects the number of u32 in the key]
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
net/netfilter/nf_nat_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
index 29d4452..1816ad3 100644
--- a/net/netfilter/nf_nat_core.c
+++ b/net/netfilter/nf_nat_core.c
@@ -255,7 +255,7 @@ find_best_ips_proto(u16 zone, struct nf_conntrack_tuple *tuple,
* client coming from the same IP (some Internet Banking sites
* like this), even across reboots.
*/
- j = jhash2((u32 *)&tuple->src.u3, sizeof(tuple->src.u3),
+ j = jhash2((u32 *)&tuple->src.u3, sizeof(tuple->src.u3) / sizeof(u32),
range->flags & NF_NAT_RANGE_PERSISTENT ?
0 : (__force u32)tuple->dst.u3.all[max] ^ zone);
--
1.7.10.4
next prev parent reply other threads:[~2012-09-13 11:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 11:01 [PATCH 0/5] Netfilter updates for net-next pablo
2012-09-13 11:01 ` [PATCH 1/5] netfilter: fix crash during boot if NAT has been compiled built-in pablo
2012-09-13 11:01 ` pablo [this message]
2012-09-13 11:01 ` [PATCH 3/5] netfilter: nfnetlink_queue: remove pointless conditional before kfree_skb() pablo
2012-09-13 11:01 ` [PATCH 4/5] ipvs: use list_del_init instead of list_del/INIT_LIST_HEAD pablo
2012-09-13 11:01 ` [PATCH 5/5] netfilter: ctnetlink: fix module auto-load in ctnetlink_parse_nat pablo
2012-09-13 18:26 ` [PATCH 0/5] Netfilter updates for net-next 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=1347534092-3579-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).