From: Antoine Tenart Date: Tue, 12 Apr 2022 08:14:59 +0000 (+0200) Subject: netfilter: nf_tables: nft_parse_register can return a negative value X-Git-Tag: baikal/aarch64/sdk6.1~4221^2~11^2 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=6d44556d991a3c0cdb9db1e13ac6170038e99081;p=kernel.git netfilter: nf_tables: nft_parse_register can return a negative value Since commit bfcfe6b3cdd4 ("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: bfcfe6b3cdd4 ("netfilter: nf_tables: validate registers coming from userspace.") Signed-off-by: Antoine Tenart Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 128ee3b300d61..16c3a39689f47 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -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;