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: 151d, last: 36m
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 (5)
Title Replies (including bot) Last reply
[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 2481d 2489d 0/28 closed as dup on 2018/01/30 13:58
upstream possible deadlock in do_ip_setsockopt (2) netfilter 59 2478d 2481d 4/28 fixed on 2018/02/07 13:26
android-49 possible deadlock in do_ip_setsockopt C 101 2292d 2050d 0/3 public: reported C repro on 2019/04/11 08:44
upstream possible deadlock in do_ip_setsockopt (3) netfilter 3731 2461d 2478d 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 (4214):
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/11/21 05:14 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/21 03:40 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/21 02:05 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/21 00:59 upstream 8f7c8b88bda4 4b25d554 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/20 20:25 upstream 8f7c8b88bda4 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/20 18:23 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root possible deadlock in do_ip_setsockopt
2024/11/20 15:32 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce possible deadlock in do_ip_setsockopt
2024/11/20 13:48 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/20 10:49 upstream bf9aa14fc523 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/20 06:59 upstream bf9aa14fc523 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/20 02:36 upstream 158f238aa69d 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 23:48 upstream 158f238aa69d 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 20:19 upstream 158f238aa69d 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in do_ip_setsockopt
2024/11/19 18:00 upstream 158f238aa69d 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 13:05 upstream 158f238aa69d 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 10:48 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 09:33 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 08:05 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 06:58 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 05:04 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 03:04 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 01:56 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/19 01:38 upstream adc218676eef 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root possible deadlock in do_ip_setsockopt
2024/11/19 00:18 upstream 9fb2cfa4635a 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 21:48 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 20:47 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 19:39 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 18:12 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 16:56 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 15:17 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 14:13 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 11:51 upstream adc218676eef e7bb5d6e .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 09:34 upstream adc218676eef cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 06:58 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 04:51 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 03:46 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 02:45 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/18 00:50 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 22:54 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 21:52 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 20:07 upstream f66d6acccbc0 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 17:59 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 16:29 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 15:24 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 15:18 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/17 14:17 upstream 4a5df3796467 cfe3a04a .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto possible deadlock in do_ip_setsockopt
2024/11/15 04:17 upstream cfaaa7d010d1 f6ede3a3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in do_ip_setsockopt
2024/08/30 07:45 upstream d5d547aa7b51 54fe8471 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in do_ip_setsockopt
2024/11/20 21:21 upstream bf9aa14fc523 4fca1650 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/11/19 22:26 upstream 158f238aa69d 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/11/18 22:54 upstream adc218676eef 571351cb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 possible deadlock in do_ip_setsockopt
2024/11/13 11:09 upstream 3022e9d00ebe 62026c85 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream possible deadlock in do_ip_setsockopt
2024/10/15 06:59 upstream eca631b8fe80 b01b6661 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in do_ip_setsockopt
2024/11/14 01:04 net 73af53d82076 a8c99394 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-this-kasan-gce possible deadlock in do_ip_setsockopt
2024/11/20 08:06 net-next dd7207838d38 7d02db5a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-net-kasan-gce possible deadlock in do_ip_setsockopt
2024/11/19 18:58 net-next dd7207838d38 571351cb .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/08/17 11:07 linux-next 367b5c3d53e5 dbc93b08 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root possible deadlock in do_ip_setsockopt
2024/11/19 16:32 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7b1d1d4cfac0 571351cb .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.