twx-linux/include/linux/netfilter
Pablo Neira Ayuso 6714cf5465 netfilter: nf_conntrack: fix explicit helper attachment and NAT
Explicit helper attachment via the CT target is broken with NAT
if non-standard ports are used. This problem was hidden behind
the automatic helper assignment routine. Thus, it becomes more
noticeable now that we can disable the automatic helper assignment
with Eric Leblond's:

9e8ac5a netfilter: nf_ct_helper: allow to disable automatic helper assignment

Basically, nf_conntrack_alter_reply asks for looking up the helper
up if NAT is enabled. Unfortunately, we don't have the conntrack
template at that point anymore.

Since we don't want to rely on the automatic helper assignment,
we can skip the second look-up and stick to the helper that was
attached by iptables. With the CT target, the user is in full
control of helper attachment, thus, the policy is to trust what
the user explicitly configures via iptables (no automatic magic
anymore).

Interestingly, this bug was hidden by the automatic helper look-up
code. But it can be easily trigger if you attach the helper in
a non-standard port, eg.

iptables -I PREROUTING -t raw -p tcp --dport 8888 \
	-j CT --helper ftp

And you disabled the automatic helper assignment.

I added the IPS_HELPER_BIT that allows us to differenciate between
a helper that has been explicitly attached and those that have been
automatically assigned. I didn't come up with a better solution
(having backward compatibility in mind).

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
2012-05-08 19:44:42 +02:00
..
ipset net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
Kbuild netfilter: add cttimeout infrastructure for fine timeout tuning 2012-03-07 17:41:22 +01:00
nf_conntrack_amanda.h
nf_conntrack_common.h netfilter: nf_conntrack: fix explicit helper attachment and NAT 2012-05-08 19:44:42 +02:00
nf_conntrack_dccp.h
nf_conntrack_ftp.h
nf_conntrack_h323_asn1.h
nf_conntrack_h323_types.h net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
nf_conntrack_h323.h
nf_conntrack_irc.h
nf_conntrack_pptp.h
nf_conntrack_proto_gre.h
nf_conntrack_sane.h
nf_conntrack_sctp.h
nf_conntrack_sip.h
nf_conntrack_snmp.h
nf_conntrack_tcp.h netfilter: nf_ct_tcp: move retransmission and unacknowledged timeout to array 2012-03-07 17:41:15 +01:00
nf_conntrack_tftp.h
nf_conntrack_tuple_common.h netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
nf_nat.h netfilter: nf_nat: export NAT definitions to userspace 2011-12-23 14:36:43 +01:00
nfnetlink_acct.h netfilter: add extended accounting infrastructure over nfnetlink 2011-12-25 02:43:03 +01:00
nfnetlink_compat.h
nfnetlink_conntrack.h netfilter: ctnetlink: allow to set expectfn for expectations 2012-03-07 17:40:46 +01:00
nfnetlink_cttimeout.h netfilter: add cttimeout infrastructure for fine timeout tuning 2012-03-07 17:41:22 +01:00
nfnetlink_log.h
nfnetlink_queue.h netfilter: nfnetlink_queue: batch verdict support 2011-07-19 11:46:33 +02:00
nfnetlink.h net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
x_tables.h percpu: Remove irqsafe_cpu_xxx variants 2011-12-22 10:40:20 -08:00
xt_addrtype.h
xt_AUDIT.h
xt_CHECKSUM.h
xt_CLASSIFY.h
xt_cluster.h
xt_comment.h
xt_connbytes.h
xt_connlimit.h headers, xtables: Add missing #include <linux/netfilter.h> 2011-08-26 12:02:50 -04:00
xt_connmark.h
xt_CONNMARK.h
xt_CONNSECMARK.h
xt_conntrack.h headers, xtables: Add missing #include <linux/netfilter.h> 2011-08-26 12:02:50 -04:00
xt_cpu.h
xt_CT.h netfilter: xt_CT: allow to attach timeout policy + glue code 2012-03-07 17:41:28 +01:00
xt_dccp.h
xt_devgroup.h
xt_dscp.h
xt_DSCP.h
xt_ecn.h netfilter: xtables: give xt_ecn its own name 2011-12-27 20:31:38 +01:00
xt_esp.h
xt_hashlimit.h
xt_helper.h
xt_IDLETIMER.h
xt_iprange.h headers, xtables: Add missing #include <linux/netfilter.h> 2011-08-26 12:02:50 -04:00
xt_ipvs.h
xt_LED.h
xt_length.h
xt_limit.h
xt_LOG.h netfilter: merge ipt_LOG and ip6_LOG into xt_LOG 2012-03-07 17:40:49 +01:00
xt_mac.h
xt_mark.h
xt_MARK.h
xt_multiport.h
xt_nfacct.h netfilter: xtables: add nfacct match to support extended accounting 2011-12-25 02:43:17 +01:00
xt_NFLOG.h
xt_NFQUEUE.h
xt_osf.h
xt_owner.h
xt_physdev.h
xt_pkttype.h
xt_policy.h
xt_quota.h
xt_rateest.h
xt_RATEEST.h
xt_realm.h
xt_recent.h
xt_rpfilter.h netfilter: add ipv4 reverse path filter match 2011-12-04 22:43:37 +01:00
xt_sctp.h
xt_SECMARK.h
xt_set.h netfilter: ipset: avoid use of kernel-only types 2012-03-26 21:06:30 +02:00
xt_socket.h
xt_state.h
xt_statistic.h
xt_string.h
xt_tcpmss.h
xt_TCPMSS.h
xt_TCPOPTSTRIP.h
xt_tcpudp.h
xt_TEE.h
xt_time.h
xt_TPROXY.h
xt_u32.h