linux-xiaomi-chiron/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.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_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
nf_nat.h
nfnetlink.h net: cleanup unsigned to unsigned int 2012-04-15 12:44:40 -04:00
nfnetlink_acct.h
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
x_tables.h
xt_addrtype.h
xt_AUDIT.h
xt_CHECKSUM.h
xt_CLASSIFY.h
xt_cluster.h
xt_comment.h
xt_connbytes.h
xt_connlimit.h
xt_connmark.h
xt_CONNMARK.h
xt_CONNSECMARK.h
xt_conntrack.h
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
xt_esp.h
xt_hashlimit.h
xt_helper.h
xt_IDLETIMER.h
xt_iprange.h
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
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
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