Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1719228

Re: [PATCH] tipc: Fix tipc_sk_reinit handling of -EAGAIN

From Herbert Xu <herbert@gondor.apana.org.au>
Newsgroups linux.kernel
Subject Re: [PATCH] tipc: Fix tipc_sk_reinit handling of -EAGAIN
Date 2017-08-24 15:20 +0200
Message-ID <ui0db-742-5@gated-at.bofh.it> (permalink)
References <uhF8L-1Mw-27@gated-at.bofh.it> <uhF8K-1Mw-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 23, 2017 at 10:43:02AM -0400, Bob Peterson wrote:
> Hi,
> 
> In 9dbbfb0ab6680c6a85609041011484e6658e7d3c function tipc_sk_reinit
> had additional logic added to loop in the event that function
> rhashtable_walk_next() returned -EAGAIN. No worries.
> 
> However, if rhashtable_walk_start returns -EAGAIN, it does "continue",
> and therefore skips the call to rhashtable_walk_stop(). That has
> the effect of calling rcu_read_lock() without its paired call to
> rcu_read_unlock(). Since rcu_read_lock() may be nested, the problem
> may not be apparent for a while, especially since resize events may
> be rare. But the comments to rhashtable_walk_start() state:
> 
>  * ...Note that we take the RCU lock in all
>  * cases including when we return an error.  So you must always call
>  * rhashtable_walk_stop to clean up.
> 
> This patch replaces the continue with a goto and label to ensure a
> matching call to rhashtable_walk_stop().
> 
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks for catching this!
-- 
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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] tipc: Fix tipc_sk_reinit handling of -EAGAIN Bob Peterson <rpeterso@redhat.com> - 2017-08-23 16:50 +0200
  Re: [PATCH] tipc: Fix tipc_sk_reinit handling of -EAGAIN Herbert Xu <herbert@gondor.apana.org.au> - 2017-08-24 15:20 +0200
  Re: [PATCH] tipc: Fix tipc_sk_reinit handling of -EAGAIN David Miller <davem@davemloft.net> - 2017-08-24 23:10 +0200

csiph-web