From: pablo@netfilter.org
To: stable@kernel.org
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 3/3] netfilter: ipset: timeout fixing bug broke SET target special timeout value
Date: Thu, 11 Oct 2012 12:07:34 +0200 [thread overview]
Message-ID: <1349950054-12353-4-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1349950054-12353-1-git-send-email-pablo@netfilter.org>
From: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
The patch "127f559 netfilter: ipset: fix timeout value overflow bug"
broke the SET target when no timeout was specified.
Reported-by: Jean-Philippe Menil <jean-philippe.menil@univ-nantes.fr>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
This patch requires:
commit 127f559127f5175e4bec3dab725a34845d956591
Author: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Date: Mon May 7 02:35:44 2012 +0000
netfilter: ipset: fix timeout value overflow bug
Large timeout parameters could result wrong timeout values due to
an overflow at msec to jiffies conversion (reported by Andreas Herz)
---
net/netfilter/xt_set.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/xt_set.c b/net/netfilter/xt_set.c
index 035960e..c6f7db7 100644
--- a/net/netfilter/xt_set.c
+++ b/net/netfilter/xt_set.c
@@ -16,6 +16,7 @@
#include <linux/netfilter/x_tables.h>
#include <linux/netfilter/xt_set.h>
+#include <linux/netfilter/ipset/ip_set_timeout.h>
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>");
@@ -310,7 +311,8 @@ set_target_v2(struct sk_buff *skb, const struct xt_action_param *par)
info->del_set.flags, 0, UINT_MAX);
/* Normalize to fit into jiffies */
- if (add_opt.timeout > UINT_MAX/MSEC_PER_SEC)
+ if (add_opt.timeout != IPSET_NO_TIMEOUT &&
+ add_opt.timeout > UINT_MAX/MSEC_PER_SEC)
add_opt.timeout = UINT_MAX/MSEC_PER_SEC;
if (info->add_set.index != IPSET_INVALID_ID)
ip_set_add(info->add_set.index, skb, par, &add_opt);
--
1.7.10.4
next prev parent reply other threads:[~2012-10-11 10:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-11 10:07 [PATCH] Netfilter/IPVS updates for stable 3.4 onwards pablo
2012-10-11 10:07 ` [PATCH 1/3] ipvs: fix oops in ip_vs_dst_event on rmmod pablo
2012-10-11 10:07 ` [PATCH 2/3] netfilter: nf_conntrack: fix racy timer handling with reliable events pablo
2012-10-11 10:07 ` pablo [this message]
2012-10-11 19:09 ` [PATCH] Netfilter/IPVS updates for stable 3.4 onwards David Miller
-- strict thread matches above, loose matches on Subject: below --
2012-10-11 10:17 pablo
2012-10-11 10:17 ` [PATCH 3/3] netfilter: ipset: timeout fixing bug broke SET target special timeout value pablo
2012-10-15 23:22 ` Greg KH
2012-10-15 23:27 ` Greg KH
2012-10-15 23:40 ` Greg KH
2012-10-16 9:36 ` Pablo Neira Ayuso
2012-10-16 16:32 ` Greg KH
2012-10-17 2:09 ` Ben Hutchings
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=1349950054-12353-4-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=stable@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).