Skip to content

Commit

Permalink
netfilter: nf_tables: nft_parse_register can return a negative value
Browse files Browse the repository at this point in the history
Since commit 6e1acfa ("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: 6e1acfa ("netfilter: nf_tables: validate registers coming from userspace.")
Signed-off-by: Antoine Tenart <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
atenart authored and ummakynes committed Apr 12, 2022
1 parent 05ae2fb commit 6c6f9f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 6c6f9f3

Please sign in to comment.