[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220121031553.5342-1-ycaibb@gmail.com>
Date: Fri, 21 Jan 2022 11:15:53 +0800
From: ycaibb <ycaibb@...il.com>
To: davem@...emloft.net, yoshfuji@...ux-ipv6.org, dsahern@...nel.org,
kuba@...nel.org, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org
Cc: netdev@...r.kernel.org, ycaibb@...il.com,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: [PATCH] inet: missing lock releases in udp.c
From: Ryan Cai <ycaibb@...il.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@...il.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
Powered by blists - more mailing lists