Commit d8bdff59cea141d2e5f7e98c1b11d3e0271640bd

Authored by Herbert Xu
Committed by Pablo Neira Ayuso
1 parent 78146572b9

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>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

net/netfilter/nft_hash.c
... ... @@ -153,6 +153,8 @@
153 153 iter->err = err;
154 154 goto out;
155 155 }
  156 +
  157 + continue;
156 158 }
157 159  
158 160 if (iter->count < iter->skip)