Browse Source

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 <herbert@gondor.apana.org.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Herbert Xu 10 năm trước cách đây
mục cha
commit
d8bdff59ce
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      net/netfilter/nft_hash.c

+ 2 - 0
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;
 				iter->err = err;
 				goto out;
 				goto out;
 			}
 			}
+
+			continue;
 		}
 		}
 
 
 		if (iter->count < iter->skip)
 		if (iter->count < iter->skip)