]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
netfilter: nft_tunnel: restrict it to netdev family
authorPablo Neira Ayuso <pablo@netfilter.org>
Sun, 21 Aug 2022 14:32:44 +0000 (16:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Sep 2022 08:27:41 +0000 (10:27 +0200)
[ Upstream commit 01e4092d53bc4fe122a6e4b6d664adbd57528ca3 ]

Only allow to use this expression from NFPROTO_NETDEV family.

Fixes: af308b94a2a4 ("netfilter: nf_tables: add tunnel support")
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_tunnel.c

index 1effd4878619f457d01a7e2007dce0e93d8c7c48..4e850c81ad8d88294008e696e5d9960b9e312f0f 100644 (file)
@@ -134,6 +134,7 @@ static const struct nft_expr_ops nft_tunnel_get_ops = {
 
 static struct nft_expr_type nft_tunnel_type __read_mostly = {
        .name           = "tunnel",
+       .family         = NFPROTO_NETDEV,
        .ops            = &nft_tunnel_get_ops,
        .policy         = nft_tunnel_policy,
        .maxattr        = NFTA_TUNNEL_MAX,