From patchwork Thu Oct 11 10:07:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 190851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1B7EF2C0086 for ; Thu, 11 Oct 2012 21:07:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758324Ab2JKKHx (ORCPT ); Thu, 11 Oct 2012 06:07:53 -0400 Received: from mail.us.es ([193.147.175.20]:48787 "EHLO mail.us.es" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758247Ab2JKKHw (ORCPT ); Thu, 11 Oct 2012 06:07:52 -0400 Received: (qmail 13634 invoked from network); 11 Oct 2012 12:07:51 +0200 Received: from unknown (HELO us.es) (192.168.2.11) by us.es with SMTP; 11 Oct 2012 12:07:51 +0200 Received: (qmail 32191 invoked by uid 507); 11 Oct 2012 10:07:51 -0000 X-Qmail-Scanner-Diagnostics: from 127.0.0.1 by antivirus1 (envelope-from , uid 501) with qmail-scanner-2.10 (clamdscan: 0.97.6/15453. spamassassin: 3.3.2. Clear:RC:1(127.0.0.1):SA:0(-97.0/7.5):. Processed in 5.346034 secs); 11 Oct 2012 10:07:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on antivirus1 X-Spam-Level: X-Spam-Status: No, score=-97.0 required=7.5 tests=BAYES_50, RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC, USER_IN_WHITELIST autolearn=disabled version=3.3.2 X-Envelope-From: pablo@netfilter.org Received: from unknown (HELO antivirus1) (127.0.0.1) by us.es with SMTP; 11 Oct 2012 10:07:45 -0000 Received: from 192.168.1.13 (192.168.1.13) by antivirus1 (F-Secure/fsigk_smtp/407/antivirus1); Thu, 11 Oct 2012 12:07:45 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/407/antivirus1) Received: (qmail 18675 invoked from network); 11 Oct 2012 12:07:45 +0200 Received: from 165.64.221.87.dynamic.jazztel.es (HELO localhost.localdomain) (pneira@us.es@87.221.64.165) by us.es with SMTP; 11 Oct 2012 12:07:45 +0200 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 Message-Id: <1349950054-12353-4-git-send-email-pablo@netfilter.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1349950054-12353-1-git-send-email-pablo@netfilter.org> References: <1349950054-12353-1-git-send-email-pablo@netfilter.org> Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org From: Jozsef Kadlecsik The patch "127f559 netfilter: ipset: fix timeout value overflow bug" broke the SET target when no timeout was specified. Reported-by: Jean-Philippe Menil Signed-off-by: Jozsef Kadlecsik Signed-off-by: Pablo Neira Ayuso --- This patch requires: commit 127f559127f5175e4bec3dab725a34845d956591 Author: Jozsef Kadlecsik 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 #include +#include MODULE_LICENSE("GPL"); MODULE_AUTHOR("Jozsef Kadlecsik "); @@ -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);