Skip to contentSkip to conversation

netfilter: nf_tables: nft_parse_register can return a negative value

PATCH Applied Antoine Tenart 2 participants 2 messages Apr 12, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfilter: nf_tables: nft_parse_register can return a negative value

Since commit 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.") nft_parse_register can return a negative value, but the function prototype is still returning an unsigned int.

Fixes 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.")
Cc Pablo Neira Ayuso <[email protected]>
---
 net/netfilter/nf_tables_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_tables_api.c +1 -1
index 128ee3b300d6..16c3a39689f4 100644
@@ -9363,7 +9363,7 @@ int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest)
 }
 EXPORT_SYMBOL_GPL(nft_parse_u32_check);
 
-static unsigned int nft_parse_register(const struct nlattr *attr, u32 *preg)
+static int nft_parse_register(const struct nlattr *attr, u32 *preg)
 {
 	unsigned int reg;
 
Signature · 1 line
2.35.1
maintainer Applied
#1 lore raw
Quoted 3 lines · Antoine Tenart

Since commit 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.") nft_parse_register can return a negative value, but the function prototype is still returning an unsigned int.

Applied, thanks