[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161012060811.GE12841@mwanda>
Date: Wed, 12 Oct 2016 09:08:11 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Pablo Neira Ayuso <pablo@...filter.org>,
Laura Garcia Liebana <nevola@...il.com>
Cc: Patrick McHardy <kaber@...sh.net>,
Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
"David S. Miller" <davem@...emloft.net>,
netfilter-devel@...r.kernel.org, coreteam@...filter.org,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] 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@...cle.com>
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index b70d3ea..dd55187 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,
*/
unsigned int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest)
{
- int val;
+ uint val;
val = ntohl(nla_get_be32(attr));
if (val > max)
Powered by blists - more mailing lists