Skip to contentSkip to conversation

iptables u32 kernel 2.6.17

LARTC gerald HUET 3 participants 4 messages Aug 2, 2006 Kbuild

lore
Share & tools
lore
#0 lore raw

hi everybody,

I used to test this rules on my gateway :
iptables -I FORWARD -p udp -m length --length 39 -m u32 --u32 '27&0x8f=7' --u32 '31=0x527c4833' -j DROP

This was working with a 2.6.16 kernel but now i upgraded to 2.6.17 it give me the following message :

[ 5333.870000] ip_tables: u32 match: invalid size 0 !2028

iptables: Unknown error -1

I tried to do some modifications on ipt_u32.c following modifications which work for ipp2p
(http://www.sieglitzhof.net/~doc/ipp2p/) without any succes.

Does anyone have an explication why the problem occurs whith the new kernel and how to solve it ?

Thanks in advance

___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet ! Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#1 lore raw
Quoted 7 lines · gerald HUET
[ 5333.870000] ip_tables: u32 match: invalid size 0 !> 2028

iptables: Unknown error -1

I tried to do some modifications on ipt_u32.c following modifications which work for ipp2p
(http://www.sieglitzhof.net/~doc/ipp2p/) without any succes.

Hm, that should have worked - it's the same problem for all the little-maintained stuff in patch-o-matic.

Quoted 2 lines

Does anyone have an explication why the problem occurs whith the new kernel and how to solve it ?

The parameters to checkentry() and match() changed incompatibly between 2.6.16 and 2.6.17.

The u32 match in current SVN works with 2.6.17 (but not with 2.6.16 or earlier).

You need to
svn co http://svn.netfilter.org/netfilter/trunk/patch-o-matic-ng

then patch your kernel and recompile.

Regards,
Torsten

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

#2 lore raw
In reply to gerald HUET
Quoted 19 lines · Torsten Luettgert
Quoted 8 lines · gerald HUET
[ 5333.870000] ip_tables: u32 match: invalid size 0 !=

2028
iptables: Unknown error -1

I tried to do some modifications on ipt_u32.c following modifications which work for ipp2p
(http://www.sieglitzhof.net/~doc/ipp2p/) without any succes.

Hm, that should have worked - it's the same problem for all the little-maintained stuff in patch-o-matic.

Quoted 2 lines

Does anyone have an explication why the problem occurs whith the new kernel and how to solve it ?

The parameters to checkentry() and match() changed incompatibly between 2.6.16 and 2.6.17.

Quoted 7 lines

The u32 match in current SVN works with 2.6.17 (but not with 2.6.16 or earlier).

You need to
svn co http://svn.netfilter.org/netfilter/trunk/patch-o-matic-ng

then patch your kernel and recompile.

apply also patch from attachment. 2.6.17 needs matchsize in ipt_match struct.

triss:~# iptables -I FORWARD -p udp -m length --length 39 -m u32 --u32 '27&0x8f=7' --u32 '31=0x527c4833' -j DROP
triss:~# iptables -L FORWARD -vn
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source destination         
    0     0 DROP       udp  --  *      *       0.0.0.0/0 0.0.0.0/0           length 39 u32 0x1f=0x527c4833 

seems working.

/pch

Signature · 2 lines
Dyslexia bug unpatched since 1977 ...
exploit has been leaked to the underground.
usr/src/linux-2.6.17.6/net/ipv4/netfilter/ipt_u32.c renamed from ipt_u32.c +1 -0
@@ -217,6 +217,7 @@
 static struct ipt_match u32_match = { 
 	.name 		= "u32",
 	.match		= &match,
+	.matchsize	= sizeof(struct ipt_u32),
 	.checkentry	= &checkentry,
 	.me		= THIS_MODULE
 };

_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc