[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231011002814.77527-1-kuniyu@amazon.com>
Date: Tue, 10 Oct 2023 17:28:14 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <f.fainelli@...il.com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
<kuba@...nel.org>, <linux-kernel-mentees@...ts.linuxfoundation.org>,
<linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
<pabeni@...hat.com>, <singhabhinav9051571833@...il.com>, <kuniyu@...zon.com>
Subject: Re: [PATCH] Remove extra unlock for the mutex
From: Florian Fainelli <f.fainelli@...il.com>
Date: Tue, 10 Oct 2023 15:51:13 -0700
> On 10/10/23 15:46, Abhinav Singh wrote:
> > There is a double unlock on mutex. This can cause undefined behaviour.
>
> Where is the double unlock of head->lock (which is a spinlock and not a
> mutex, btw)?
Maybe head is just confused with the preceding head2 as the two are
the same type of struct. They are pointers of different hash tables
though.
bind()ing two sockets to the same 2-tuple will easily trigger hung task.
>
> >
> > Signed-off-by: Abhinav Singh <singhabhinav9051571833@...il.com>
> > ---
> > net/ipv4/inet_connection_sock.c | 1 -
> > 1 file changed, 1 deletion(-)
> >
> > diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
> > index aeebe8816689..f11fe8c727a4 100644
> > --- a/net/ipv4/inet_connection_sock.c
> > +++ b/net/ipv4/inet_connection_sock.c
> > @@ -597,7 +597,6 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
> > }
> > if (head2_lock_acquired)
> > spin_unlock(&head2->lock);
> > - spin_unlock_bh(&head->lock);
> > return ret;
> > }
> > EXPORT_SYMBOL_GPL(inet_csk_get_port);
Powered by blists - more mailing lists