* netfilter: Fix potential crash in nft_hash walker
@ 2015-03-12 23:52 Herbert Xu
2015-03-13 3:05 ` David Miller
2015-03-13 10:50 ` Pablo Neira Ayuso
0 siblings, 2 replies; 3+ messages in thread
From: Herbert Xu @ 2015-03-12 23:52 UTC (permalink / raw)
To: David Miller, tgraf, netdev, Patrick McHardy
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>
diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
index c82df0a..37c15e6 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)
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: netfilter: Fix potential crash in nft_hash walker
2015-03-12 23:52 netfilter: Fix potential crash in nft_hash walker Herbert Xu
@ 2015-03-13 3:05 ` David Miller
2015-03-13 10:50 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-03-13 3:05 UTC (permalink / raw)
To: herbert; +Cc: tgraf, netdev, kaber
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Fri, 13 Mar 2015 10:52:14 +1100
> 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>
Pablo, you got this one?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: netfilter: Fix potential crash in nft_hash walker
2015-03-12 23:52 netfilter: Fix potential crash in nft_hash walker Herbert Xu
2015-03-13 3:05 ` David Miller
@ 2015-03-13 10:50 ` Pablo Neira Ayuso
1 sibling, 0 replies; 3+ messages in thread
From: Pablo Neira Ayuso @ 2015-03-13 10:50 UTC (permalink / raw)
To: Herbert Xu; +Cc: David Miller, tgraf, netdev, Patrick McHardy, netfilter-devel
On Fri, Mar 13, 2015 at 10:52:14AM +1100, Herbert Xu wrote:
> 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.
I'll enqueue this for nf, thanks Herbert.
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
>
> diff --git a/net/netfilter/nft_hash.c b/net/netfilter/nft_hash.c
> index c82df0a..37c15e6 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)
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-13 10:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-12 23:52 netfilter: Fix potential crash in nft_hash walker Herbert Xu
2015-03-13 3:05 ` David Miller
2015-03-13 10:50 ` 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).