netfilter: nf_tables: underflow in nft_parse_u32_check()

We don't want to allow negatives here.

Fixes: 36b701fae1 ('netfilter: nf_tables: validate maximum value of u32 netlink attributes')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
This commit is contained in:
Dan Carpenter 2016-10-12 12:14:29 +03:00 committed by Pablo Neira Ayuso
parent 5751e175c6
commit 09525a09ad
1 changed files with 1 additions and 1 deletions

View File

@ -4423,7 +4423,7 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx,
*/
unsigned int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest)
{
int val;
u32 val;
val = ntohl(nla_get_be32(attr));
if (val > max)