Message ID | 20180823231944.4959-1-xiyou.wangcong@gmail.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Series | [net] tipc: fix a missing rhashtable_walk_exit() | expand |
From: Cong Wang <xiyou.wangcong@gmail.com> Date: Thu, 23 Aug 2018 16:19:44 -0700 > rhashtable_walk_exit() must be paired with rhashtable_walk_enter(). > > Fixes: 40f9f4397060 ("tipc: Fix tipc_sk_reinit race conditions") > Cc: Herbert Xu <herbert@gondor.apana.org.au> > Cc: Ying Xue <ying.xue@windriver.com> > Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Applied and queued up for -stable, thanks Cong.
On 08/24/2018 07:19 AM, Cong Wang wrote: > rhashtable_walk_exit() must be paired with rhashtable_walk_enter(). > > Fixes: 40f9f4397060 ("tipc: Fix tipc_sk_reinit race conditions") > Cc: Herbert Xu <herbert@gondor.apana.org.au> > Cc: Ying Xue <ying.xue@windriver.com> > Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Ying Xue <ying.xue@windriver.com> > --- > net/tipc/socket.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/net/tipc/socket.c b/net/tipc/socket.c > index c1e93c9515bc..c9a50b62c738 100644 > --- a/net/tipc/socket.c > +++ b/net/tipc/socket.c > @@ -2672,6 +2672,8 @@ void tipc_sk_reinit(struct net *net) > > rhashtable_walk_stop(&iter); > } while (tsk == ERR_PTR(-EAGAIN)); > + > + rhashtable_walk_exit(&iter); > } > > static struct tipc_sock *tipc_sk_lookup(struct net *net, u32 portid) >
diff --git a/net/tipc/socket.c b/net/tipc/socket.c index c1e93c9515bc..c9a50b62c738 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -2672,6 +2672,8 @@ void tipc_sk_reinit(struct net *net) rhashtable_walk_stop(&iter); } while (tsk == ERR_PTR(-EAGAIN)); + + rhashtable_walk_exit(&iter); } static struct tipc_sock *tipc_sk_lookup(struct net *net, u32 portid)
rhashtable_walk_exit() must be paired with rhashtable_walk_enter(). Fixes: 40f9f4397060 ("tipc: Fix tipc_sk_reinit race conditions") Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Ying Xue <ying.xue@windriver.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> --- net/tipc/socket.c | 2 ++ 1 file changed, 2 insertions(+)