summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorFernando Fernandez Mancera <ffmancera@riseup.net>2018-10-10 09:56:09 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2018-10-11 11:29:14 +0200
commit4a3e71b7b7dbaf3562be9d508260935aa13cb48b (patch)
tree05cdba11298fb4f3bc7c39abf1d36e818e01761a /net
parentnetfilter: nft_set_rbtree: allow loose matching of closing element in interval (diff)
downloadlinux-4a3e71b7b7dbaf3562be9d508260935aa13cb48b.tar.xz
linux-4a3e71b7b7dbaf3562be9d508260935aa13cb48b.zip
netfilter: nft_osf: usage from output path is not valid
The nft_osf extension, like xt_osf, is not supported from the output path. Fixes: b96af92d6eaf ("netfilter: nf_tables: implement Passive OS fingerprint module in nft_osf") Signed-off-by: Fernando Fernandez Mancera <ffmancera@riseup.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/nft_osf.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/netfilter/nft_osf.c b/net/netfilter/nft_osf.c
index a35fb59ace73..df4e3e0412ed 100644
--- a/net/netfilter/nft_osf.c
+++ b/net/netfilter/nft_osf.c
@@ -69,6 +69,15 @@ nla_put_failure:
return -1;
}
+static int nft_osf_validate(const struct nft_ctx *ctx,
+ const struct nft_expr *expr,
+ const struct nft_data **data)
+{
+ return nft_chain_validate_hooks(ctx->chain, (1 << NF_INET_LOCAL_IN) |
+ (1 << NF_INET_PRE_ROUTING) |
+ (1 << NF_INET_FORWARD));
+}
+
static struct nft_expr_type nft_osf_type;
static const struct nft_expr_ops nft_osf_op = {
.eval = nft_osf_eval,
@@ -76,6 +85,7 @@ static const struct nft_expr_ops nft_osf_op = {
.init = nft_osf_init,
.dump = nft_osf_dump,
.type = &nft_osf_type,
+ .validate = nft_osf_validate,
};
static struct nft_expr_type nft_osf_type __read_mostly = {