/home/rusty/devel/kernel/quilt/linux-2.6.10-bk7-Netfilter: When ipt_ECN needs TCP, check it is not inverted
Subsystems (2)
PATCH 2/18 /home/rusty/devel/kernel/quilt/linux-2.6.10-bk7-Netfilter: When ipt_ECN needs TCP, check it is not inverted
Name: When ipt_ECN needs TCP, check it is not inverted
Signed-off-by Rusty Russell <[email protected]>
Status: Tested under nfsim
Writing the nfsim testcase for the ECN target revealed a hole in the rule checking: when checking whether the rule specified TCP, you need to check it isn't inverted.
net/ipv4/netfilter/ipt_ECN.c +1 -1
@@ -148,7 +148,7 @@ }if ((einfo->operation & (IPT_ECN_OP_SET_ECE |IPT_ECN_OP_SET_CWR )) - && e->ip.proto !=IPPROTO_TCP ) { + && (e->ip.proto !=IPPROTO_TCP || (e->ip.invflags &IPT_INV_PROTO ))) {printk (KERN_WARNING "ECN: cannot use TCP operations on a " "non-tcp rule\n" );return 0 ;