Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-21 Thread David Miller
From: Cong Wang Date: Wed, 19 Oct 2016 23:35:12 -0700 > Baozeng reported this deadlock case: > >CPU0CPU1 > > lock([ 165.136033] sk_lock-AF_INET6); >lock([ 165.136033] rtnl_mutex); >

Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-20 Thread Cong Wang
On Thu, Oct 20, 2016 at 3:10 PM, Eric Dumazet wrote: > > I used 'I wonder if' to say that we might have some better way to code > this test nowadays, but this can be done in a separate patch of course. OK, let's keep one bugfix in one patch. ;)

Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-20 Thread Eric Dumazet
On Thu, 2016-10-20 at 14:35 -0700, Cong Wang wrote: > On Thu, Oct 20, 2016 at 6:47 AM, Eric Dumazet wrote: > > On Wed, 2016-10-19 at 23:35 -0700, Cong Wang wrote: > >> Baozeng reported this deadlock case: > > > > ... > > > >> + > >> +void ipv6_sock_mc_close(struct sock *sk) > >> +{ > >> + stru

Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-20 Thread Cong Wang
On Thu, Oct 20, 2016 at 6:47 AM, Eric Dumazet wrote: > On Wed, 2016-10-19 at 23:35 -0700, Cong Wang wrote: >> Baozeng reported this deadlock case: > > ... > >> + >> +void ipv6_sock_mc_close(struct sock *sk) >> +{ >> + struct ipv6_pinfo *np = inet6_sk(sk); >> + >> + if (!rcu_access_pointer(

Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-20 Thread Eric Dumazet
On Wed, 2016-10-19 at 23:35 -0700, Cong Wang wrote: > Baozeng reported this deadlock case: ... > + > +void ipv6_sock_mc_close(struct sock *sk) > +{ > + struct ipv6_pinfo *np = inet6_sk(sk); > + > + if (!rcu_access_pointer(np->ipv6_mc_list)) > + return; I wonder if rcu_derefer

Re: [Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-20 Thread Marcelo Ricardo Leitner
On Wed, Oct 19, 2016 at 11:35:12PM -0700, Cong Wang wrote: > Baozeng reported this deadlock case: > >CPU0CPU1 > > lock([ 165.136033] sk_lock-AF_INET6); >lock([ 165.136033] rtnl_mutex); >

[Patch net v2] ipv6: fix a potential deadlock in do_ipv6_setsockopt()

2016-10-19 Thread Cong Wang
Baozeng reported this deadlock case: CPU0CPU1 lock([ 165.136033] sk_lock-AF_INET6); lock([ 165.136033] rtnl_mutex); lock([ 165.136033] sk_lock-AF_INET6); lock([ 165.