From: ycaibb <ycaibb@gmail•com>
To: davem@davemloft•net, yoshfuji@linux-ipv6•org, dsahern@kernel•org,
kuba@kernel•org, ast@kernel•org, daniel@iogearbox•net,
andrii@kernel•org, kafai@fb•com, songliubraving@fb•com,
yhs@fb•com, john.fastabend@gmail•com, kpsingh@kernel•org
Cc: netdev@vger•kernel.org, ycaibb@gmail•com,
linux-kernel@vger•kernel.org, bpf@vger•kernel.org
Subject: [PATCH] inet: missing lock releases in udp.c
Date: Fri, 21 Jan 2022 11:15:53 +0800 [thread overview]
Message-ID: <20220121031553.5342-1-ycaibb@gmail.com> (raw)
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
next reply other threads:[~2022-01-21 3:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-21 3:15 ycaibb [this message]
2022-01-23 7:11 ` [inet] 1b84613d30: WARNING:at_kernel/softirq.c:#__local_bh_enable_ip kernel test robot
2022-01-23 19:57 ` [PATCH] inet: missing lock releases in udp.c Cong Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220121031553.5342-1-ycaibb@gmail.com \
--to=ycaibb@gmail$(echo .)com \
--cc=andrii@kernel$(echo .)org \
--cc=ast@kernel$(echo .)org \
--cc=bpf@vger$(echo .)kernel.org \
--cc=daniel@iogearbox$(echo .)net \
--cc=davem@davemloft$(echo .)net \
--cc=dsahern@kernel$(echo .)org \
--cc=john.fastabend@gmail$(echo .)com \
--cc=kafai@fb$(echo .)com \
--cc=kpsingh@kernel$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=songliubraving@fb$(echo .)com \
--cc=yhs@fb$(echo .)com \
--cc=yoshfuji@linux-ipv6$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox