syzbot


possible deadlock in do_ip_setsockopt (4)

Status: upstream: reported C repro on 2024/06/26 09:50
Subsystems: net
[Documentation on labels]
Reported-by: syzbot+e4c27043b9315839452d@syzkaller.appspotmail.com
First crash: 182d, last: 9m
Cause bisection: introduced by (bisect log) :
commit d25a92ccae6bed02327b63d138e12e7806830f78
Author: D. Wythe <alibuda@linux.alibaba.com>
Date: Thu Jun 13 18:00:30 2024 +0000

  net/smc: Introduce IPPROTO_SMC

Crash: possible deadlock in do_ip_setsockopt (log)
Repro: C syz .config
  
Discussions (6)
Title Replies (including bot) Last reply
[syzbot] Monthly net report (Dec 2024) 0 (1) 2024/12/05 09:04
[syzbot] Monthly net report (Nov 2024) 0 (1) 2024/11/04 08:49
[PATCH] net/ipv4: Fix circular deadlock in do_ip_setsockop 4 (4) 2024/09/22 21:04
Re: [syzbot] [PATCH] net/ipv4: Fixing circular deadlock 0 (1) 2024/09/17 22:57
[syzbot] [net?] possible deadlock in do_ip_setsockopt (4) 3 (8) 2024/09/17 22:31
[syzbot] Monthly net report (Sep 2024) 0 (1) 2024/09/02 08:21
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in do_ip_setsockopt netfilter C 467 2511d 2519d 0/28 closed as dup on 2018/01/30 13:58
upstream possible deadlock in do_ip_setsockopt (2) netfilter 59 2509d 2511d 4/28 fixed on 2018/02/07 13:26
android-49 possible deadlock in do_ip_setsockopt C 101 2322d 2081d 0/3 public: reported C repro on 2019/04/11 08:44
upstream possible deadlock in do_ip_setsockopt (3) netfilter 3731 2492d 2508d 4/28 fixed on 2018/02/26 20:04
Last patch testing requests (3)
Created Duration User Patch Repo Result
2024/09/17 22:57 25m srikarananta01@gmail.com patch upstream OK log
2024/09/17 21:58 3m srikarananta01@gmail.com patch upstream error
2024/09/17 21:11 15m srikarananta01@gmail.com git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 2f27fce67173bbb05d5a0ee03dae5c021202c912 report log

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
6.11.0-rc4-syzkaller-00255-gd2bafcf224f3 #0 Not tainted
------------------------------------------------------
syz-executor266/5220 is trying to acquire lock:
ffff888017752958 (sk_lock-AF_INET){+.+.}-{0:0}, at: do_ip_setsockopt+0x1a2d/0x3cd0 net/ipv4/ip_sockglue.c:1078

but task is already holding lock:
ffffffff8fa72248 (rtnl_mutex){+.+.}-{3:3}, at: do_ip_setsockopt+0x127d/0x3cd0 net/ipv4/ip_sockglue.c:1077

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (rtnl_mutex){+.+.}-{3:3}:
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
       __mutex_lock_common kernel/locking/mutex.c:608 [inline]
       __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752
       smc_vlan_by_tcpsk+0x399/0x4e0 net/smc/smc_core.c:1853
       __smc_connect+0x2a4/0x1890 net/smc/af_smc.c:1522
       smc_connect+0x868/0xde0 net/smc/af_smc.c:1702
       __sys_connect_file net/socket.c:2061 [inline]
       __sys_connect+0x2df/0x310 net/socket.c:2078
       __do_sys_connect net/socket.c:2088 [inline]
       __se_sys_connect net/socket.c:2085 [inline]
       __x64_sys_connect+0x7a/0x90 net/socket.c:2085
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (sk_lock-AF_INET){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3133 [inline]
       check_prevs_add kernel/locking/lockdep.c:3252 [inline]
       validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868
       __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
       lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
       lock_sock_nested+0x48/0x100 net/core/sock.c:3543
       do_ip_setsockopt+0x1a2d/0x3cd0 net/ipv4/ip_sockglue.c:1078
       ip_setsockopt+0x63/0x100 net/ipv4/ip_sockglue.c:1417
       do_sock_setsockopt+0x3af/0x720 net/socket.c:2324
       __sys_setsockopt+0x1ae/0x250 net/socket.c:2347
       __do_sys_setsockopt net/socket.c:2356 [inline]
       __se_sys_setsockopt net/socket.c:2353 [inline]
       __x64_sys_setsockopt+0xb5/0xd0 net/socket.c:2353
       do_syscall_x64 arch/x86/entry/common.c:52 [inline]
       do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(rtnl_mutex);
                               lock(sk_lock-AF_INET);
                               lock(rtnl_mutex);
  lock(sk_lock-AF_INET);

 *** DEADLOCK ***

1 lock held by syz-executor266/5220:
 #0: ffffffff8fa72248 (rtnl_mutex){+.+.}-{3:3}, at: do_ip_setsockopt+0x127d/0x3cd0 net/ipv4/ip_sockglue.c:1077

stack backtrace:
CPU: 1 UID: 0 PID: 5220 Comm: syz-executor266 Not tainted 6.11.0-rc4-syzkaller-00255-gd2bafcf224f3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:93 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:119
 check_noncircular+0x36a/0x4a0 kernel/locking/lockdep.c:2186
 check_prev_add kernel/locking/lockdep.c:3133 [inline]
 check_prevs_add kernel/locking/lockdep.c:3252 [inline]
 validate_chain+0x18e0/0x5900 kernel/locking/lockdep.c:3868
 __lock_acquire+0x137a/0x2040 kernel/locking/lockdep.c:5142
 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5759
 lock_sock_nested+0x48/0x100 net/core/sock.c:3543
 do_ip_setsockopt+0x1a2d/0x3cd0 net/ipv4/ip_sockglue.c:1078
 ip_setsockopt+0x63/0x100 net/ipv4/ip_sockglue.c:1417
 do_sock_setsockopt+0x3af/0x720 net/socket.c:2324
 __sys_setsockopt+0x1ae/0x250 net/socket.c:2347
 __do_sys_setsockopt net/socket.c:2356 [inline]
 __se_sys_setsockopt net/socket.c:2353 [inline]
 __x64_sys_setsockopt+0xb5/0xd0 net/socket.c:2353
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f9dbe0ada79
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffcf0f564e8 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f9dbe0ada79
RDX: 0000000000000023 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007f9dbe1205f0 R08: 0000000000000000 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 431bde82d7b634db R14: 0000000000000001 R15: 0000000000000001
 </TASK>

Crashes (5790):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/24 16:47 upstream d2bafcf224f3 d7d32352 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in do_ip_setsockopt
2024/12/21 10:29 upstream e9b8ffafd20a d7f584ee .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/20 18:37 upstream 8faabc041a00 49cfeac8 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/20 15:22 upstream 8faabc041a00 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in do_ip_setsockopt
2024/12/19 23:02 upstream 8faabc041a00 c87fa8a3 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 21:41 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 20:18 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 18:48 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 17:20 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 15:46 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 10:29 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in do_ip_setsockopt
2024/12/19 08:39 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 06:15 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 02:51 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/19 01:47 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/12/18 01:44 upstream 59dbb9d81adf c8c15bb2 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in do_ip_setsockopt
2024/12/17 02:49 upstream 78d4f34e2115 f93b2b55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/16 10:04 upstream 78d4f34e2115 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in do_ip_setsockopt
2024/12/15 22:50 upstream 2d8308bf5b67 7cbfbb3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in do_ip_setsockopt
2024/12/21 12:43 upstream 499551201b5f d7f584ee .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/21 00:50 upstream e9b8ffafd20a 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/20 17:13 upstream 8faabc041a00 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/20 06:31 upstream 8faabc041a00 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/20 05:27 upstream 8faabc041a00 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/20 00:39 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/19 21:31 upstream eabcdba3ad40 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/19 09:56 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/19 07:24 upstream c061cf420ded 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/18 07:14 upstream aef25be35d23 a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/12/11 10:28 upstream f92f4749861b cfc402b4 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in do_ip_setsockopt
2024/12/17 06:35 upstream f44d154d6e3d f93b2b55 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in do_ip_setsockopt
2024/12/20 23:25 net cc54ec56d822 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 08:40 net 954a2b40719a a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/21 13:47 net-next ae418e95dd93 d7f584ee .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/21 04:27 net-next 3272040790eb 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/21 03:13 net-next 3272040790eb 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/21 02:10 net-next 3272040790eb 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 20:01 net-next b73e56f16250 1ac6aa80 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 14:04 net-next b73e56f16250 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 12:51 net-next b73e56f16250 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 10:46 net-next b73e56f16250 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 09:14 net-next b73e56f16250 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 04:11 net-next 6b3099ebca13 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 03:09 net-next 6b3099ebca13 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/20 01:49 net-next 6b3099ebca13 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/19 14:02 net-next 4fefbc66dfb3 1d58202c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/19 12:44 net-next 4fefbc66dfb3 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/19 04:36 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/19 04:33 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 22:13 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 20:55 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 19:48 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 18:48 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 18:04 net-next c1bad69f8baf 1432fc84 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/18 12:04 net-next d3c9510dc900 a0626d3a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/07/20 13:04 net-next 58f9416d413a b88348e9 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-net-next-test-gce possible deadlock in do_ip_setsockopt
2024/06/26 02:51 net-next 73cfd947dbdb da0bd5ca .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/06/22 09:44 net-next 3226607302ca edc5149a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/12/08 09:14 linux-next af2ea8ab7a54 9ac0fdc6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in do_ip_setsockopt
2024/12/17 06:21 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 2e7aff49b5da f93b2b55 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 possible deadlock in do_ip_setsockopt
* Struck through repros no longer work on HEAD.