Skip to content

Commit 1629e45

Browse files
ummakynessmb49
authored andcommitted
netfilter: nft_compat: narrow down revision to unsigned 8-bits
BugLink: https://bugs.launchpad.net/bugs/2059991 [ Upstream commit 36fa8d6 ] xt_find_revision() expects u8, restrict it to this datatype. Fixes: 0ca743a ("netfilter: nf_tables: add compatibility layer for x_tables") Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Portia Stephens <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent 71067c2 commit 1629e45

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/netfilter/nft_compat.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void nft_target_eval_bridge(const struct nft_expr *expr,
135135

136136
static const struct nla_policy nft_target_policy[NFTA_TARGET_MAX + 1] = {
137137
[NFTA_TARGET_NAME] = { .type = NLA_NUL_STRING },
138-
[NFTA_TARGET_REV] = { .type = NLA_U32 },
138+
[NFTA_TARGET_REV] = NLA_POLICY_MAX(NLA_BE32, 255),
139139
[NFTA_TARGET_INFO] = { .type = NLA_BINARY },
140140
};
141141

@@ -419,7 +419,7 @@ static void nft_match_eval(const struct nft_expr *expr,
419419

420420
static const struct nla_policy nft_match_policy[NFTA_MATCH_MAX + 1] = {
421421
[NFTA_MATCH_NAME] = { .type = NLA_NUL_STRING },
422-
[NFTA_MATCH_REV] = { .type = NLA_U32 },
422+
[NFTA_MATCH_REV] = NLA_POLICY_MAX(NLA_BE32, 255),
423423
[NFTA_MATCH_INFO] = { .type = NLA_BINARY },
424424
};
425425

@@ -724,7 +724,7 @@ static int nfnl_compat_get_rcu(struct sk_buff *skb,
724724
static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = {
725725
[NFTA_COMPAT_NAME] = { .type = NLA_NUL_STRING,
726726
.len = NFT_COMPAT_NAME_MAX-1 },
727-
[NFTA_COMPAT_REV] = { .type = NLA_U32 },
727+
[NFTA_COMPAT_REV] = NLA_POLICY_MAX(NLA_BE32, 255),
728728
[NFTA_COMPAT_TYPE] = { .type = NLA_U32 },
729729
};
730730

0 commit comments

Comments
 (0)