summaryrefslogtreecommitdiff
path: root/net/netfilter/nft_rt.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2023-06-21 21:11:03 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2023-06-26 08:05:57 +0200
commita412dbf40ff37515acca4bba666f5386aa37246e (patch)
treed29ebda49810ab08757b1d5c33f2ea6001d04df1 /net/netfilter/nft_rt.c
parent079cd633219d7298d087cd115c17682264244c18 (diff)
netfilter: nf_tables: limit allowed range via nla_policy
These NLA_U32 types get stored in u8 fields, reject invalid values instead of silently casting to u8. Signed-off-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_rt.c')
-rw-r--r--net/netfilter/nft_rt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_rt.c b/net/netfilter/nft_rt.c
index 5990fdd7b3cc..35a2c28caa60 100644
--- a/net/netfilter/nft_rt.c
+++ b/net/netfilter/nft_rt.c
@@ -104,7 +104,7 @@ err:
static const struct nla_policy nft_rt_policy[NFTA_RT_MAX + 1] = {
[NFTA_RT_DREG] = { .type = NLA_U32 },
- [NFTA_RT_KEY] = { .type = NLA_U32 },
+ [NFTA_RT_KEY] = NLA_POLICY_MAX(NLA_BE32, 255),
};
static int nft_rt_get_init(const struct nft_ctx *ctx,