]> git.baikalelectronics.ru Git - kernel.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)
commitf53f377bc91c36071221351a09bb96eae5480373
treee484cdbbe6bac4e5b4921117635356a1dfc1bc6d
parentac8b3186139a043efadf01f0314b94af0e611797
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