Skip to contentSkip to conversation

netfilter: add missing attribute validation

PATCH In review Jakub Kicinski 2 participants 5 messages Mar 3, 2020 – Mar 4, 2020

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

cover netfilter: add missing attribute validation

Hi!

Netfilter and nf_tables is missing a handful of netlink policy entries.

Compilation tested only.

Jakub Kicinski (3):
netfilter: add missing attribute validation for cthelper
netfilter: add missing attribute validation for payload csum flags
netfilter: nf_tables: add missing attribute validation for tunnels

 net/netfilter/nfnetlink_cthelper.c | 2 ++
 net/netfilter/nft_payload.c        | 1 +
 net/netfilter/nft_tunnel.c         | 2 ++
 3 files changed, 5 insertions(+)
Signature · 1 line
2.24.1
author maintainer
#2 lore raw

PATCH 2/3 netfilter: add missing attribute validation for payload csum flags

Add missing attribute validation for NFTA_PAYLOAD_CSUM_FLAGS to the netlink policy.

Fixes 1814096980bb ("netfilter: nft_payload: layer 4 checksum adjustment for pseudoheader fields")
---
 net/netfilter/nft_payload.c | 1 +
 1 file changed, 1 insertion(+)
net/netfilter/nft_payload.c +1 -0
index 1993af3a2979..a7de3a58f553 100644
@@ -129,6 +129,7 @@ static const struct nla_policy nft_payload_policy[NFTA_PAYLOAD_MAX + 1] = {
 	[NFTA_PAYLOAD_LEN]		= { .type = NLA_U32 },
 	[NFTA_PAYLOAD_CSUM_TYPE]	= { .type = NLA_U32 },
 	[NFTA_PAYLOAD_CSUM_OFFSET]	= { .type = NLA_U32 },
+	[NFTA_PAYLOAD_CSUM_FLAGS]	= { .type = NLA_U32 },
 };
 
 static int nft_payload_init(const struct nft_ctx *ctx,
Signature · 1 line
2.24.1
author maintainer
#3 lore raw

PATCH 3/3 netfilter: nf_tables: add missing attribute validation for tunnels

In reply to Jakub Kicinski

Add missing attribute validation for tunnel source and destination ports to the netlink policy.

Fixes af308b94a2a4 ("netfilter: nf_tables: add tunnel support")
---
 net/netfilter/nft_tunnel.c | 2 ++
 1 file changed, 2 insertions(+)
net/netfilter/nft_tunnel.c +2 -0
index 4c3f2e24c7cb..764e88682a81 100644
@@ -339,6 +339,8 @@ static const struct nla_policy nft_tunnel_key_policy[NFTA_TUNNEL_KEY_MAX + 1] =
 	[NFTA_TUNNEL_KEY_FLAGS]	= { .type = NLA_U32, },
 	[NFTA_TUNNEL_KEY_TOS]	= { .type = NLA_U8, },
 	[NFTA_TUNNEL_KEY_TTL]	= { .type = NLA_U8, },
+	[NFTA_TUNNEL_KEY_SPORT]	= { .type = NLA_U16, },
+	[NFTA_TUNNEL_KEY_DPORT]	= { .type = NLA_U16, },
 	[NFTA_TUNNEL_KEY_OPTS]	= { .type = NLA_NESTED, },
 };
 
Signature · 1 line
2.24.1
author maintainer
#1 lore raw

PATCH 1/3 netfilter: add missing attribute validation for cthelper

In reply to Jakub Kicinski

Add missing attribute validation for cthelper
to the netlink policy.

Fixes 12f7a505331e ("netfilter: add user-space connection tracking helper infrastructure")
---
 net/netfilter/nfnetlink_cthelper.c | 2 ++
 1 file changed, 2 insertions(+)
net/netfilter/nfnetlink_cthelper.c +2 -0
index de3a9596b7f1..a5f294aa8e4c 100644
@@ -742,6 +742,8 @@ static const struct nla_policy nfnl_cthelper_policy[NFCTH_MAX+1] = {
 	[NFCTH_NAME] = { .type = NLA_NUL_STRING,
 			 .len = NF_CT_HELPER_NAME_LEN-1 },
 	[NFCTH_QUEUE_NUM] = { .type = NLA_U32, },
+	[NFCTH_PRIV_DATA_LEN] = { .type = NLA_U32, },
+	[NFCTH_STATUS] = { .type = NLA_U32, },
 };
 
 static const struct nfnl_callback nfnl_cthelper_cb[NFNL_MSG_CTHELPER_MAX] = {
Signature · 1 line
2.24.1