On 09/03/11 17:19, Greg KH wrote:
> What do you want [email protected] to do with this patch?
> 
> Please read Documentation/stable_kernel_rules.txt for how to get a patch
> into the stable kernel trees (hint, this wasn't the way...)

sorry, this was my first time doing this and i should have read the
rules more in deep.

I think this has to go to -stable since it fixed arptables which is
completely broken with the arpt_mangle target since 2.6.35.

I have included the affected kernel version and where you can checkrry
pick that patch from.

please, let me know if i'm missing anything else.

thanks.
>From 9d0db8b6b1da9e3d4c696ef29449700c58d589db Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <[email protected]>
Date: Tue, 1 Feb 2011 16:03:46 +0100
Subject: [PATCH] netfilter: arpt_mangle: fix return values of checkentry

In 135367b "netfilter: xtables: change xt_target.checkentry return type",
the type returned by checkentry was changed from boolean to int, but the
return values where not adjusted.

arptables: Input/output error

This broke arptables with the mangle target since it returns true
under success, which is interpreted by xtables as >0, thus
returning EIO.

The following Linux kernels are affected:
* 2.6.35.9
* 2.6.36.4
* 2.6.37.3

Cc: [email protected]
Signed-off-by: Pablo Neira Ayuso <[email protected]>
Signed-off-by: Patrick McHardy <[email protected]>
(cherry picked from commit 9d0db8b6b1da9e3d4c696ef29449700c58d589db)
---
 net/ipv4/netfilter/arpt_mangle.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c
index b8ddcc4..a5e52a9 100644
--- a/net/ipv4/netfilter/arpt_mangle.c
+++ b/net/ipv4/netfilter/arpt_mangle.c
@@ -60,12 +60,12 @@ static int checkentry(const struct xt_tgchk_param *par)
 
 	if (mangle->flags & ~ARPT_MANGLE_MASK ||
 	    !(mangle->flags & ARPT_MANGLE_MASK))
-		return false;
+		return -EINVAL;
 
 	if (mangle->target != NF_DROP && mangle->target != NF_ACCEPT &&
 	   mangle->target != XT_CONTINUE)
-		return false;
-	return true;
+		return -EINVAL;
+	return 0;
 }
 
 static struct xt_target arpt_mangle_reg __read_mostly = {
-- 
1.7.2.3

_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to