netfilter fix for 3.6-rc7
Subsystems (3)
[email protected]
maintainerPATCH 1/1 netfilter fix for 3.6-rc7
From: Pablo Neira Ayuso <[email protected]>
Hi David,
If time allows, I'd appreciate if you can take the following fix for the xt_limit match.
As Jan indicates, random things may occur while using the xt_limit match due to use of uninitialized memory.
You can pull this change from:
git://1984.lsi.us.es/nf master
Thanks!
Jan Engelhardt (1):
netfilter: xt_limit: have r->cost != 0 case work
net/netfilter/xt_limit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Signature · 1 line
1.7.10.4
[email protected]
maintainerPATCH 1/1 netfilter: xt_limit: have r->cost != 0 case work
From: Jan Engelhardt <[email protected]>
Commit v2.6.19-rc1~1272^2~41 tells us that r->cost != 0 can happen when a running state is saved to userspace and then reinstated from there.
Make sure that private xt_limit area is initialized with correct values. Otherwise, random matchings due to use of uninitialized memory.
--- net/netfilter/xt_limit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/netfilter/xt_limit.c +4 -4
@@ -117,11 +117,11 @@ static int limit_mt_check(const struct xt_mtchk_param *par)/* For SMP, we only want to use one set of state. */ r->master = priv; +/* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies * +128. */ + priv->prev = jiffies; + priv->credit =user2credits (r->avg * r->burst);/* Credits full. */ if (r->cost ==0 ) { -/* User avg in seconds * XT_LIMIT_SCALE: convert to jiffies * -128. */ - priv->prev = jiffies; - priv->credit =user2credits (r->avg * r->burst);/* Credits full. */ r->credit_cap = priv->credit;/* Credits full. */ r->cost =user2credits (r->avg); }
Signature · 1 line
1.7.10.4
David Miller
maintainerFrom: [email protected]
Date: Wed, 26 Sep 2012 01:34:10 +0200
Quoted 9 lines
If time allows, I'd appreciate if you can take the following fix for the
xt_limitmatch.As Jan indicates, random things may occur while using the
xt_limitmatch due to use of uninitialized memory.You can pull this change from:
git://1984.lsi.us.es/nfmaster
Pulled, thanks.