syzbot


possible deadlock in genl_rcv (2)

Status: auto-closed as invalid on 2019/09/08 03:35
Reported-by: syzbot+cf29f8ae16ca7ceb483d@syzkaller.appspotmail.com
First crash: 1481d, last: 1421d
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in genl_rcv 1 1879d 1874d 0/24 closed as invalid on 2018/02/13 19:42
linux-4.19 possible deadlock in genl_rcv (2) 1 444d 444d 0/1 auto-closed as invalid on 2022/03/12 20:05
upstream possible deadlock in genl_rcv (3) 1 400d 396d 0/24 auto-closed as invalid on 2022/04/25 11:14
linux-4.19 possible deadlock in genl_rcv 1 1062d 1062d 0/1 auto-closed as invalid on 2020/07/02 11:07

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
5.0.0+ #18 Not tainted
------------------------------------------------------
syz-executor.5/23020 is trying to acquire lock:
0000000029807534 (cb_lock){++++}, at: genl_rcv+0x1a/0x40 net/netlink/genetlink.c:636

but task is already holding lock:
0000000028bc234e (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:62 [inline]
0000000028bc234e (&pipe->mutex/1){+.+.}, at: pipe_lock+0x6e/0x80 fs/pipe.c:70

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (&pipe->mutex/1){+.+.}:
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211
       __mutex_lock_common kernel/locking/mutex.c:925 [inline]
       __mutex_lock+0xf7/0x1310 kernel/locking/mutex.c:1072
       mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
       pipe_lock_nested fs/pipe.c:62 [inline]
       pipe_lock+0x6e/0x80 fs/pipe.c:70
       iter_file_splice_write+0x18b/0xbe0 fs/splice.c:700
       do_splice_from fs/splice.c:851 [inline]
       do_splice+0x70a/0x1490 fs/splice.c:1158
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice fs/splice.c:1408 [inline]
       __x64_sys_splice+0x2c6/0x330 fs/splice.c:1408
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #3 (sb_writers#4){.+.+}:
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211
       percpu_down_read include/linux/percpu-rwsem.h:36 [inline]
       __sb_start_write+0x20b/0x360 fs/super.c:1389
       sb_start_write include/linux/fs.h:1615 [inline]
       mnt_want_write+0x3f/0xc0 fs/namespace.c:357
       ovl_want_write+0x76/0xa0 fs/overlayfs/util.c:24
       ovl_create_object+0xb3/0x2c0 fs/overlayfs/dir.c:599
       ovl_create+0x28/0x30 fs/overlayfs/dir.c:630
       lookup_open+0x12e0/0x1b10 fs/namei.c:3232
       do_last fs/namei.c:3322 [inline]
       path_openat+0x14ac/0x46e0 fs/namei.c:3533
       do_filp_open+0x1a1/0x280 fs/namei.c:3563
       do_sys_open+0x3fe/0x5d0 fs/open.c:1063
       __do_sys_openat fs/open.c:1090 [inline]
       __se_sys_openat fs/open.c:1084 [inline]
       __x64_sys_openat+0x9d/0x100 fs/open.c:1084
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #2 (&ovl_i_mutex_dir_key[depth]){++++}:
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211
       down_read+0x3b/0x90 kernel/locking/rwsem.c:24
       inode_lock_shared include/linux/fs.h:777 [inline]
       lookup_slow+0x4a/0x80 fs/namei.c:1685
       walk_component+0x74b/0x2000 fs/namei.c:1808
       link_path_walk.part.0+0x980/0x1340 fs/namei.c:2139
       link_path_walk fs/namei.c:2070 [inline]
       path_openat+0x202/0x46e0 fs/namei.c:3532
       do_filp_open+0x1a1/0x280 fs/namei.c:3563
       file_open_name+0x2c5/0x3b0 fs/open.c:1010
       filp_open+0x4c/0x80 fs/open.c:1030
       kernel_read_file_from_path+0x84/0x100 fs/exec.c:974
       fw_get_filesystem_firmware drivers/base/firmware_loader/main.c:328 [inline]
       _request_firmware+0x749/0x1110 drivers/base/firmware_loader/main.c:587
       request_firmware+0x38/0x50 drivers/base/firmware_loader/main.c:636
       reg_reload_regdb+0x81/0x250 net/wireless/reg.c:1089
       nl80211_reload_regdb+0xe/0x10 net/wireless/nl80211.c:6213
       genl_family_rcv_msg+0x6e1/0xd90 net/netlink/genetlink.c:601
       genl_rcv_msg+0xca/0x16c net/netlink/genetlink.c:626
       netlink_rcv_skb+0x17a/0x460 net/netlink/af_netlink.c:2485
       genl_rcv+0x29/0x40 net/netlink/genetlink.c:637
       netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
       netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1336
       netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1925
       sock_sendmsg_nosec net/socket.c:622 [inline]
       sock_sendmsg+0xdd/0x130 net/socket.c:632
       ___sys_sendmsg+0x806/0x930 net/socket.c:2137
       __sys_sendmsg+0x105/0x1d0 net/socket.c:2175
       __do_sys_sendmsg net/socket.c:2184 [inline]
       __se_sys_sendmsg net/socket.c:2182 [inline]
       __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2182
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #1 (genl_mutex){+.+.}:
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211
       __mutex_lock_common kernel/locking/mutex.c:925 [inline]
       __mutex_lock+0xf7/0x1310 kernel/locking/mutex.c:1072
       mutex_lock_nested+0x16/0x20 kernel/locking/mutex.c:1087
       genl_lock net/netlink/genetlink.c:33 [inline]
       genl_lock_all net/netlink/genetlink.c:54 [inline]
       genl_register_family net/netlink/genetlink.c:331 [inline]
       genl_register_family+0x1d6/0x1220 net/netlink/genetlink.c:322
       genl_init+0x17/0x6e net/netlink/genetlink.c:1046
       do_one_initcall+0x109/0x796 init/main.c:887
       do_initcall_level init/main.c:955 [inline]
       do_initcalls init/main.c:963 [inline]
       do_basic_setup init/main.c:981 [inline]
       kernel_init_freeable+0x4da/0x5c9 init/main.c:1136
       kernel_init+0x12/0x1c5 init/main.c:1054
       ret_from_fork+0x3a/0x50 arch/x86/entry/entry_64.S:352

-> #0 (cb_lock){++++}:
       check_prevs_add kernel/locking/lockdep.c:2333 [inline]
       validate_chain kernel/locking/lockdep.c:2714 [inline]
       __lock_acquire+0x239c/0x3fb0 kernel/locking/lockdep.c:3701
       lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211
       down_read+0x3b/0x90 kernel/locking/rwsem.c:24
       genl_rcv+0x1a/0x40 net/netlink/genetlink.c:636
       netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
       netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1336
       netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1925
       sock_sendmsg_nosec net/socket.c:622 [inline]
       sock_sendmsg+0xdd/0x130 net/socket.c:632
       kernel_sendmsg+0x44/0x50 net/socket.c:640
       sock_no_sendpage+0x116/0x150 net/core/sock.c:2716
       kernel_sendpage+0x95/0xf0 net/socket.c:3427
       sock_sendpage+0x8b/0xc0 net/socket.c:869
       pipe_to_sendpage+0x299/0x370 fs/splice.c:452
       splice_from_pipe_feed fs/splice.c:503 [inline]
       __splice_from_pipe+0x39a/0x7e0 fs/splice.c:627
       splice_from_pipe+0x108/0x170 fs/splice.c:662
       generic_splice_sendpage+0x3c/0x50 fs/splice.c:832
       do_splice_from fs/splice.c:851 [inline]
       do_splice+0x70a/0x1490 fs/splice.c:1158
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice fs/splice.c:1408 [inline]
       __x64_sys_splice+0x2c6/0x330 fs/splice.c:1408
       do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

Chain exists of:
  cb_lock --> sb_writers#4 --> &pipe->mutex/1

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&pipe->mutex/1);
                               lock(sb_writers#4);
                               lock(&pipe->mutex/1);
  lock(cb_lock);

 *** DEADLOCK ***

1 lock held by syz-executor.5/23020:
 #0: 0000000028bc234e (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:62 [inline]
 #0: 0000000028bc234e (&pipe->mutex/1){+.+.}, at: pipe_lock+0x6e/0x80 fs/pipe.c:70

stack backtrace:
CPU: 1 PID: 23020 Comm: syz-executor.5 Not tainted 5.0.0+ #18
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x172/0x1f0 lib/dump_stack.c:113
 print_circular_bug.isra.0.cold+0x1cc/0x28f kernel/locking/lockdep.c:1571
 check_prev_add.constprop.0+0xf11/0x23c0 kernel/locking/lockdep.c:2220
 check_prevs_add kernel/locking/lockdep.c:2333 [inline]
 validate_chain kernel/locking/lockdep.c:2714 [inline]
 __lock_acquire+0x239c/0x3fb0 kernel/locking/lockdep.c:3701
 lock_acquire+0x16f/0x3f0 kernel/locking/lockdep.c:4211
 down_read+0x3b/0x90 kernel/locking/rwsem.c:24
 genl_rcv+0x1a/0x40 net/netlink/genetlink.c:636
 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline]
 netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1336
 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1925
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xdd/0x130 net/socket.c:632
 kernel_sendmsg+0x44/0x50 net/socket.c:640
 sock_no_sendpage+0x116/0x150 net/core/sock.c:2716
 kernel_sendpage+0x95/0xf0 net/socket.c:3427
 sock_sendpage+0x8b/0xc0 net/socket.c:869
 pipe_to_sendpage+0x299/0x370 fs/splice.c:452
 splice_from_pipe_feed fs/splice.c:503 [inline]
 __splice_from_pipe+0x39a/0x7e0 fs/splice.c:627
 splice_from_pipe+0x108/0x170 fs/splice.c:662
 generic_splice_sendpage+0x3c/0x50 fs/splice.c:832
 do_splice_from fs/splice.c:851 [inline]
 do_splice+0x70a/0x1490 fs/splice.c:1158
 __do_sys_splice fs/splice.c:1428 [inline]
 __se_sys_splice fs/splice.c:1408 [inline]
 __x64_sys_splice+0x2c6/0x330 fs/splice.c:1408
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457f29
Code: ad b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fb7445adc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000000457f29
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 000000000073bfa0 R08: 0000080000010005 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb7445ae6d4
R13: 00000000004c6d75 R14: 00000000004db970 R15: 00000000ffffffff

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-selinux-root 2019/03/12 03:34 upstream a089e4fed5c5 12365b99 .config console log report
ci-upstream-kasan-gce-selinux-root 2019/01/11 01:11 upstream 1bdbe2274920 80dde172 .config console log report
* Struck through repros no longer work on HEAD.