Skip to content

Commit

Permalink
netfilter: Fix potential crash in nft_hash walker
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Herbert Xu authored and Pablo Neira Ayuso committed Mar 13, 2015
1 parent 7814657 commit d8bdff5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/netfilter/nft_hash.c
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit d8bdff5

Please sign in to comment.