syzbot


possible deadlock in genl_rcv (2)

Status: auto-closed as invalid on 2022/03/12 20:05
Reported-by: syzbot+37586ec272a077ec0e36@syzkaller.appspotmail.com
First crash: 896d, last: 896d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in genl_rcv net 1 2331d 2326d 0/26 closed as invalid on 2018/02/13 19:42
upstream possible deadlock in genl_rcv (3) net 1 852d 848d 0/26 auto-closed as invalid on 2022/04/25 11:14
linux-4.19 possible deadlock in genl_rcv 1 1514d 1514d 0/1 auto-closed as invalid on 2020/07/02 11:07
upstream possible deadlock in genl_rcv (2) net 2 1872d 1932d 0/26 auto-closed as invalid on 2019/09/08 03:35

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
4.19.211-syzkaller #0 Not tainted
------------------------------------------------------
syz-executor.4/20894 is trying to acquire lock:
00000000150c8034 (cb_lock){++++}, at: genl_rcv+0x15/0x40 net/netlink/genetlink.c:637

but task is already holding lock:
00000000246b8333 (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:77 [inline]
00000000246b8333 (&pipe->mutex/1){+.+.}, at: pipe_lock+0x63/0x80 fs/pipe.c:85

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #4 (&pipe->mutex/1){+.+.}:
       pipe_lock_nested fs/pipe.c:77 [inline]
       pipe_lock+0x63/0x80 fs/pipe.c:85
       iter_file_splice_write+0x183/0xbb0 fs/splice.c:700
       do_splice_from fs/splice.c:852 [inline]
       do_splice fs/splice.c:1154 [inline]
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #3 (sb_writers#3){.+.+}:
       sb_start_write include/linux/fs.h:1579 [inline]
       mnt_want_write+0x3a/0xb0 fs/namespace.c:360
       ovl_xattr_set+0x53/0x600 fs/overlayfs/inode.c:338
       ovl_posix_acl_xattr_set+0x347/0x9a0 fs/overlayfs/super.c:917
       __vfs_setxattr+0x10e/0x170 fs/xattr.c:149
       __vfs_setxattr_noperm+0x11a/0x420 fs/xattr.c:180
       __vfs_setxattr_locked+0x176/0x250 fs/xattr.c:238
       vfs_setxattr+0xe5/0x270 fs/xattr.c:255
       setxattr+0x23d/0x330 fs/xattr.c:520
       path_setxattr+0x170/0x190 fs/xattr.c:539
       __do_sys_lsetxattr fs/xattr.c:561 [inline]
       __se_sys_lsetxattr fs/xattr.c:557 [inline]
       __x64_sys_lsetxattr+0xbd/0x150 fs/xattr.c:557
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #2 (&ovl_i_mutex_dir_key[depth]){++++}:
       inode_lock_shared include/linux/fs.h:758 [inline]
       lookup_slow fs/namei.c:1688 [inline]
       walk_component+0x798/0xda0 fs/namei.c:1811
       link_path_walk.part.0+0x901/0x1230 fs/namei.c:2142
       link_path_walk fs/namei.c:2073 [inline]
       path_openat+0x1db/0x2df0 fs/namei.c:3536
       do_filp_open+0x18c/0x3f0 fs/namei.c:3567
       file_open_name+0x269/0x380 fs/open.c:1032
       filp_open+0x47/0x70 fs/open.c:1052
       kernel_read_file_from_path+0x78/0xf0 fs/exec.c:971
       fw_get_filesystem_firmware drivers/base/firmware_loader/main.c:328 [inline]
       _request_firmware+0x714/0x1210 drivers/base/firmware_loader/main.c:589
       request_firmware+0x33/0x50 drivers/base/firmware_loader/main.c:638
       reg_reload_regdb+0x7a/0x240 net/wireless/reg.c:1073
       genl_family_rcv_msg+0x642/0xc40 net/netlink/genetlink.c:602
       genl_rcv_msg+0xbf/0x160 net/netlink/genetlink.c:627
       netlink_rcv_skb+0x160/0x440 net/netlink/af_netlink.c:2463
       genl_rcv+0x24/0x40 net/netlink/genetlink.c:638
       netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
       netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
       netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
       sock_sendmsg_nosec net/socket.c:651 [inline]
       sock_sendmsg+0xc3/0x120 net/socket.c:661
       ___sys_sendmsg+0x7bb/0x8e0 net/socket.c:2227
       __sys_sendmsg net/socket.c:2265 [inline]
       __do_sys_sendmsg net/socket.c:2274 [inline]
       __se_sys_sendmsg net/socket.c:2272 [inline]
       __x64_sys_sendmsg+0x132/0x220 net/socket.c:2272
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

-> #1 (genl_mutex){+.+.}:
       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+0x257/0x1240 net/netlink/genetlink.c:322
       genl_init+0x12/0x62 net/netlink/genetlink.c:998
       do_one_initcall+0xf1/0x740 init/main.c:884
       do_initcall_level init/main.c:952 [inline]
       do_initcalls init/main.c:960 [inline]
       do_basic_setup init/main.c:978 [inline]
       kernel_init_freeable+0x9c5/0xab7 init/main.c:1145
       kernel_init+0xd/0x1ba init/main.c:1062
       ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

-> #0 (cb_lock){++++}:
       down_read+0x36/0x80 kernel/locking/rwsem.c:24
       genl_rcv+0x15/0x40 net/netlink/genetlink.c:637
       netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
       netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
       netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
       sock_sendmsg_nosec net/socket.c:651 [inline]
       sock_sendmsg+0xc3/0x120 net/socket.c:661
       sock_no_sendpage+0xf5/0x140 net/core/sock.c:2686
       kernel_sendpage net/socket.c:3585 [inline]
       sock_sendpage+0xdf/0x140 net/socket.c:912
       pipe_to_sendpage+0x268/0x330 fs/splice.c:452
       splice_from_pipe_feed fs/splice.c:503 [inline]
       __splice_from_pipe+0x389/0x800 fs/splice.c:627
       splice_from_pipe fs/splice.c:662 [inline]
       generic_splice_sendpage+0xd4/0x140 fs/splice.c:833
       do_splice_from fs/splice.c:852 [inline]
       do_splice fs/splice.c:1154 [inline]
       __do_sys_splice fs/splice.c:1428 [inline]
       __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
       do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
       entry_SYSCALL_64_after_hwframe+0x49/0xbe

other info that might help us debug this:

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

 Possible unsafe locking scenario:

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

 *** DEADLOCK ***

1 lock held by syz-executor.4/20894:
 #0: 00000000246b8333 (&pipe->mutex/1){+.+.}, at: pipe_lock_nested fs/pipe.c:77 [inline]
 #0: 00000000246b8333 (&pipe->mutex/1){+.+.}, at: pipe_lock+0x63/0x80 fs/pipe.c:85

stack backtrace:
CPU: 0 PID: 20894 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0
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+0x1fc/0x2ef lib/dump_stack.c:118
 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222
 check_prev_add kernel/locking/lockdep.c:1866 [inline]
 check_prevs_add kernel/locking/lockdep.c:1979 [inline]
 validate_chain kernel/locking/lockdep.c:2420 [inline]
 __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416
 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908
 down_read+0x36/0x80 kernel/locking/rwsem.c:24
 genl_rcv+0x15/0x40 net/netlink/genetlink.c:637
 netlink_unicast_kernel net/netlink/af_netlink.c:1325 [inline]
 netlink_unicast+0x4d5/0x690 net/netlink/af_netlink.c:1351
 netlink_sendmsg+0x6c3/0xc50 net/netlink/af_netlink.c:1917
 sock_sendmsg_nosec net/socket.c:651 [inline]
 sock_sendmsg+0xc3/0x120 net/socket.c:661
 sock_no_sendpage+0xf5/0x140 net/core/sock.c:2686
 kernel_sendpage net/socket.c:3585 [inline]
 sock_sendpage+0xdf/0x140 net/socket.c:912
 pipe_to_sendpage+0x268/0x330 fs/splice.c:452
 splice_from_pipe_feed fs/splice.c:503 [inline]
 __splice_from_pipe+0x389/0x800 fs/splice.c:627
 splice_from_pipe fs/splice.c:662 [inline]
 generic_splice_sendpage+0xd4/0x140 fs/splice.c:833
 do_splice_from fs/splice.c:852 [inline]
 do_splice fs/splice.c:1154 [inline]
 __do_sys_splice fs/splice.c:1428 [inline]
 __se_sys_splice+0xfe7/0x16d0 fs/splice.c:1408
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f7faa799ae9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7fa7d0f188 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00007f7faa8acf60 RCX: 00007f7faa799ae9
RDX: 0000000000000005 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f7faa7f3f6d R08: 0000000080000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd70bd3a9f R14: 00007f7fa7d0f300 R15: 0000000000022000
print_req_error: I/O error, dev loop4, sector 0
FAT-fs (loop4): unable to read boot sector
print_req_error: I/O error, dev loop4, sector 0
FAT-fs (loop4): unable to read boot sector
kauditd_printk_skb: 5 callbacks suppressed
audit: type=1800 audit(1636747477.860:176): pid=20932 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.5" name="bus" dev="sda1" ino=14961 res=0
BTRFS: device label K devid 0 transid 7 /dev/loop1
audit: type=1800 audit(1636747477.910:177): pid=20960 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.5" name="bus" dev="sda1" ino=14961 res=0
Unknown ioctl -1072131203
Unknown ioctl -1072131203
audit: type=1800 audit(1636747479.180:178): pid=21089 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="file0" dev="sda1" ino=14980 res=0
audit: type=1800 audit(1636747479.540:179): pid=21115 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.1" name="file0" dev="sda1" ino=14988 res=0
audit: type=1804 audit(1636747479.560:180): pid=21115 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir392198534/syzkaller.WO5twV/7/file0" dev="sda1" ino=14988 res=1
BTRFS info (device loop4): unrecognized mount option '®É͉¥Ðnospace_cache6'
BTRFS error (device loop4): open_ctree failed
UDF-fs: bad mount option "ÒÈ–«ý]Êòs)" or missing value
IPVS: ftp: loaded support on port[0] = 21
ieee802154 phy0 wpan0: encryption failed: -22
ieee802154 phy1 wpan1: encryption failed: -22
IPVS: ftp: loaded support on port[0] = 21
UDF-fs: bad mount option "ÒÈ–«ý]Êòs)" or missing value
audit: type=1800 audit(1636747481.020:181): pid=21259 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.4" name="bus" dev="sda1" ino=14738 res=0
IPVS: ftp: loaded support on port[0] = 21
overlayfs: failed to resolve './file1': -2
overlayfs: 'file0' not a directory
overlayfs: './bus' not a directory
nf_conntrack: default automatic helper assignment has been turned off for security reasons and CT-based  firewall rule not found. Use the iptables CT target to attach helpers instead.
ieee80211 phy23: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy24: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy25: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy26: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy27: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy28: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy29: Selected rate control algorithm 'minstrel_ht'
ieee80211 phy30: Selected rate control algorithm 'minstrel_ht'

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/11/12 20:04 linux-4.19.y 3f8a27f9e27b 75b04091 .config console log report info ci2-linux-4-19 possible deadlock in genl_rcv
* Struck through repros no longer work on HEAD.