Re: [syzbot] [PATCH] net/ipv4: Fixing circular deadlock
From: syzbot
Date: Tue Sep 17 2024 - 18:57:53 EST
For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.
***
Subject: [PATCH] net/ipv4: Fixing circular deadlock
Author: srikarananta01@xxxxxxxxx
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
Fixed the circular lock dependency reported by syzkaller.
Signed-off-by: AnantaSrikar <srikarananta01@xxxxxxxxx>
Reported-by: syzbot+e4c27043b9315839452d@xxxxxxxxxxxxxxxxxxxxxxxxx
Closes: https://syzkaller.appspot.com/bug?extid=e4c27043b9315839452d
Fixes: d2bafcf224f3 ("Merge tag 'cgroup-for-6.11-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup")
---
net/ipv4/ip_sockglue.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index cf377377b52d..a8f46d1ba62b 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -1073,9 +1073,11 @@ int do_ip_setsockopt(struct sock *sk, int level, int optname,
}
err = 0;
+
+ sockopt_lock_sock(sk);
+
if (needs_rtnl)
rtnl_lock();
- sockopt_lock_sock(sk);
switch (optname) {
case IP_OPTIONS:
--
2.43.0