netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] netfilter: nf_tables: underflow in nft_parse_u32_check()
@ 2016-10-12  6:08 Dan Carpenter
  2016-10-12  7:27 ` Liping Zhang
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2016-10-12  6:08 UTC (permalink / raw)
  To: Pablo Neira Ayuso, Laura Garcia Liebana
  Cc: Patrick McHardy, Jozsef Kadlecsik, David S. Miller,
	netfilter-devel, coreteam, netdev, kernel-janitors

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>

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)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-17 15:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12  6:08 [patch] netfilter: nf_tables: underflow in nft_parse_u32_check() Dan Carpenter
2016-10-12  7:27 ` Liping Zhang
2016-10-12  9:14   ` [patch v2] " Dan Carpenter
2016-10-17 15:40     ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).