From: Herbert Xu Date: Thu, 12 Mar 2015 23:52:14 +0000 (+1100) Subject: netfilter: Fix potential crash in nft_hash walker X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=d8bdff59cea141d2e5f7e98c1b11d3e0271640bd;p=openwrt%2Fstaging%2Fblogic.git netfilter: Fix potential crash in nft_hash walker When we get back an EAGAIN from rhashtable_walk_next we were treating it as a valid object which obviously doesn't work too well. Luckily this is hard to trigger so it seems nobody has run into it yet. This patch fixes it by redoing the next call when we get an EAGAIN. Signed-off-by: Herbert Xu Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c index c82df0a48fcd..37c15e674884 100644 --- a/net/netfilter/nft_hash.c +++ b/net/netfilter/nft_hash.c @@ -153,6 +153,8 @@ static void nft_hash_walk(const struct nft_ctx *ctx, const struct nft_set *set, iter->err = err; goto out; } + + continue; } if (iter->count < iter->skip)