diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-10-12 05:14:29 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-17 11:43:53 -0400 |
commit | 09525a09ad3099efd9ba49b0b90bddc350d6b53a (patch) | |
tree | dc43e492d23803c86071082981d33ef7094fc5f7 | |
parent | 5751e175c60be1b4113d1e9bfa011b58ec01f104 (diff) |
netfilter: nf_tables: underflow in nft_parse_u32_check()
We don't want to allow negatives here.
Fixes: 36b701fae12a ('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>
-rw-r--r-- | net/netfilter/nf_tables_api.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index b70d3ea1430e..24db22257586 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c | |||
@@ -4423,7 +4423,7 @@ static int nf_tables_check_loops(const struct nft_ctx *ctx, | |||
4423 | */ | 4423 | */ |
4424 | unsigned int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest) | 4424 | unsigned int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest) |
4425 | { | 4425 | { |
4426 | int val; | 4426 | u32 val; |
4427 | 4427 | ||
4428 | val = ntohl(nla_get_be32(attr)); | 4428 | val = ntohl(nla_get_be32(attr)); |
4429 | if (val > max) | 4429 | if (val > max) |