]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
netfilter: x_tables: add context to know if extension runs from nft_compat
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 14 May 2015 12:57:23 +0000 (14:57 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 15 May 2015 18:14:07 +0000 (20:14 +0200)
commit55917a21d0cc012bb6073bb05bb768fd51d8e237
treee484cdbbe6bac4e5b4921117635356a1dfc1bc6d
parent12b7ed29bdea2d6dde58f304321d4e8ca453f13c
netfilter: x_tables: add context to know if extension runs from nft_compat

Currently, we have four xtables extensions that cannot be used from the
xt over nft compat layer. The problem is that they need real access to
the full blown xt_entry to validate that the rule comes with the right
dependencies. This check was introduced to overcome the lack of
sufficient userspace dependency validation in iptables.

To resolve this problem, this patch introduces a new field to the
xt_tgchk_param structure that tell us if the extension is run from
nft_compat context.

The three affected extensions are:

1) CLUSTERIP, this target has been superseded by xt_cluster. So just
   bail out by returning -EINVAL.

2) TCPMSS. Relax the checking when used from nft_compat. If used with
   the wrong configuration, it will corrupt !syn packets by adding TCP
   MSS option.

3) ebt_stp. Relax the check to make sure it uses the reserved
   destination MAC address for STP.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Tested-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
include/linux/netfilter/x_tables.h
net/bridge/netfilter/ebt_stp.c
net/ipv4/netfilter/ipt_CLUSTERIP.c
net/netfilter/nft_compat.c
net/netfilter/xt_TCPMSS.c