* [PATCH] inet: missing lock releases in udp.c
@ 2022-01-21 3:15 ycaibb
2022-01-23 19:57 ` Cong Wang
0 siblings, 1 reply; 2+ messages in thread
From: ycaibb @ 2022-01-21 3:15 UTC (permalink / raw)
To: davem, yoshfuji, dsahern, kuba, ast, daniel, andrii, kafai,
songliubraving, yhs, john.fastabend, kpsingh
Cc: netdev, ycaibb, linux-kernel, bpf
From: Ryan Cai <ycaibb@gmail.com>
In method udp_get_first, the lock hslot->lock is not released when afinfo->family == AF_UNSPEC || sk->sk_family == afinfo->family is true. This patch fixes the problem by adding the unlock statement.
Signed-off-by: Ryan Cai <ycaibb@gmail.com>
---
net/ipv4/udp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 23b05e28490b..f7d573ecaafb 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2967,6 +2967,7 @@ static struct sock *udp_get_first(struct seq_file *seq, int start)
continue;
if (afinfo->family == AF_UNSPEC ||
sk->sk_family == afinfo->family)
+ spin_unlock_bh(&hslot->lock);
goto found;
}
spin_unlock_bh(&hslot->lock);
--
2.33.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] inet: missing lock releases in udp.c
2022-01-21 3:15 [PATCH] inet: missing lock releases in udp.c ycaibb
@ 2022-01-23 19:57 ` Cong Wang
0 siblings, 0 replies; 2+ messages in thread
From: Cong Wang @ 2022-01-23 19:57 UTC (permalink / raw)
To: ycaibb
Cc: davem, yoshfuji, dsahern, kuba, ast, daniel, andrii, kafai,
songliubraving, yhs, john.fastabend, kpsingh, netdev,
linux-kernel, bpf
On Fri, Jan 21, 2022 at 11:15:53AM +0800, ycaibb wrote:
> From: Ryan Cai <ycaibb@gmail.com>
>
> In method udp_get_first, the lock hslot->lock is not released when afinfo->family == AF_UNSPEC || sk->sk_family == afinfo->family is true. This patch fixes the problem by adding the unlock statement.
>
It should be unlocked by udp_seq_stop(). Do you see any real lockdep
warning or bug report?
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-23 19:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-21 3:15 [PATCH] inet: missing lock releases in udp.c ycaibb
2022-01-23 19:57 ` Cong Wang
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).