IPVS: ftp: loaded support on port[0] = 21 audit: type=1800 audit(1670071448.298:546): pid=20485 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=14725 res=0 ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/20485 is trying to acquire lock: 00000000a80177a2 (&sb->s_type->i_mutex_key#10){++++}, at: inode_lock include/linux/fs.h:748 [inline] 00000000a80177a2 (&sb->s_type->i_mutex_key#10){++++}, at: __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 but task is already holding lock: audit: type=1804 audit(1670071448.328:547): pid=20485 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.3" name="/root/syzkaller-testdir2907803225/syzkaller.W3tnLR/155/bus" dev="sda1" ino=14725 res=1 00000000c73e4060 (loop_ctl_mutex){+.+.}, at: loop_set_fd drivers/block/loop.c:956 [inline] 00000000c73e4060 (loop_ctl_mutex){+.+.}, at: lo_ioctl+0x1bb/0x20e0 drivers/block/loop.c:1576 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (loop_ctl_mutex){+.+.}: lo_open+0x19/0xd0 drivers/block/loop.c:1771 __blkdev_get+0x372/0x1480 fs/block_dev.c:1494 blkdev_get+0xb0/0x940 fs/block_dev.c:1627 blkdev_open+0x202/0x290 fs/block_dev.c:1788 do_dentry_open+0x4aa/0x1160 fs/open.c:796 do_last fs/namei.c:3421 [inline] path_openat+0x793/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #4 (&bdev->bd_mutex){+.+.}: blkdev_put+0x30/0x520 fs/block_dev.c:1839 btrfs_close_bdev fs/btrfs/volumes.c:1033 [inline] btrfs_close_one_device fs/btrfs/volumes.c:1057 [inline] close_fs_devices.part.0+0x24d/0x8e0 fs/btrfs/volumes.c:1085 close_fs_devices fs/btrfs/volumes.c:1117 [inline] btrfs_close_devices+0x95/0x1f0 fs/btrfs/volumes.c:1103 close_ctree+0x3c8/0x850 fs/btrfs/disk-io.c:4047 generic_shutdown_super+0x144/0x370 fs/super.c:456 kill_anon_super+0x36/0x60 fs/super.c:1032 btrfs_kill_super+0x49/0x550 fs/btrfs/super.c:2221 deactivate_locked_super+0x94/0x160 fs/super.c:329 deactivate_super+0x174/0x1a0 fs/super.c:360 cleanup_mnt+0x1a8/0x290 fs/namespace.c:1098 task_work_run+0x148/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #3 (&fs_devs->device_list_mutex){+.+.}: btrfs_finish_chunk_alloc+0x27b/0xf90 fs/btrfs/volumes.c:4938 btrfs_create_pending_block_groups+0x242/0x590 fs/btrfs/extent-tree.c:10134 __btrfs_end_transaction+0x21a/0xb00 fs/btrfs/transaction.c:855 flush_space+0xa41/0xee0 fs/btrfs/extent-tree.c:4861 btrfs_async_reclaim_metadata_space+0x466/0x1050 fs/btrfs/extent-tree.c:4977 process_one_work+0x864/0x1570 kernel/workqueue.c:2153 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296 kthread+0x33f/0x460 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 -> #2 (sb_internal#2){.+.+}: sb_start_intwrite include/linux/fs.h:1626 [inline] start_transaction+0xa37/0xf90 fs/btrfs/transaction.c:528 btrfs_dirty_inode+0xe3/0x210 fs/btrfs/inode.c:6165 btrfs_update_time+0x33b/0x3d0 fs/btrfs/inode.c:6207 update_time fs/inode.c:1675 [inline] touch_atime+0x23c/0x2a0 fs/inode.c:1746 file_accessed include/linux/fs.h:2123 [inline] btrfs_file_mmap+0x11b/0x160 fs/btrfs/file.c:2274 call_mmap include/linux/fs.h:1826 [inline] mmap_region+0xc94/0x16b0 mm/mmap.c:1757 do_mmap+0x8e8/0x1080 mm/mmap.c:1530 do_mmap_pgoff include/linux/mm.h:2329 [inline] vm_mmap_pgoff+0x197/0x200 mm/util.c:357 ksys_mmap_pgoff+0x298/0x5a0 mm/mmap.c:1580 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&mm->mmap_sem){++++}: get_user_pages_unlocked+0xbd/0x400 mm/gup.c:1038 get_user_pages_fast+0x2a0/0x350 mm/gup.c:1923 iov_iter_get_pages+0x25b/0xe80 lib/iov_iter.c:1211 dio_refill_pages fs/direct-io.c:170 [inline] dio_get_page fs/direct-io.c:214 [inline] do_direct_IO fs/direct-io.c:982 [inline] do_blockdev_direct_IO fs/direct-io.c:1333 [inline] __blockdev_direct_IO+0x5b6e/0xef40 fs/direct-io.c:1419 ext4_direct_IO_write fs/ext4/inode.c:3777 [inline] ext4_direct_IO+0xae4/0x1c50 fs/ext4/inode.c:3915 generic_file_direct_write+0x208/0x4a0 mm/filemap.c:3073 __generic_file_write_iter+0x2d0/0x610 mm/filemap.c:3252 ext4_file_write_iter+0x2fe/0xf20 fs/ext4/file.c:272 call_write_iter include/linux/fs.h:1821 [inline] aio_write+0x37f/0x5c0 fs/aio.c:1574 __io_submit_one fs/aio.c:1858 [inline] io_submit_one+0xecd/0x20c0 fs/aio.c:1909 __do_sys_io_submit fs/aio.c:1953 [inline] __se_sys_io_submit+0x11b/0x4a0 fs/aio.c:1924 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&sb->s_type->i_mutex_key#10){++++}: down_write+0x34/0x90 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:748 [inline] __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 ext4_sync_file+0xa35/0x1420 fs/ext4/fsync.c:118 vfs_fsync_range fs/sync.c:197 [inline] vfs_fsync+0x127/0x1f0 fs/sync.c:211 __loop_update_dio+0x4cd/0x690 drivers/block/loop.c:209 loop_update_dio drivers/block/loop.c:636 [inline] loop_set_fd drivers/block/loop.c:1000 [inline] lo_ioctl+0xeee/0x20e0 drivers/block/loop.c:1576 __blkdev_driver_ioctl block/ioctl.c:303 [inline] blkdev_ioctl+0x5cb/0x1a80 block/ioctl.c:601 block_ioctl+0xe9/0x130 fs/block_dev.c:1906 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 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: &sb->s_type->i_mutex_key#10 --> &bdev->bd_mutex --> loop_ctl_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(loop_ctl_mutex); lock(&bdev->bd_mutex); lock(loop_ctl_mutex); lock(&sb->s_type->i_mutex_key#10); *** DEADLOCK *** 1 lock held by syz-executor.3/20485: #0: 00000000c73e4060 (loop_ctl_mutex){+.+.}, at: loop_set_fd drivers/block/loop.c:956 [inline] #0: 00000000c73e4060 (loop_ctl_mutex){+.+.}, at: lo_ioctl+0x1bb/0x20e0 drivers/block/loop.c:1576 stack backtrace: CPU: 1 PID: 20485 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 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_write+0x34/0x90 kernel/locking/rwsem.c:70 inode_lock include/linux/fs.h:748 [inline] __generic_file_fsync+0xb0/0x1f0 fs/libfs.c:989 ext4_sync_file+0xa35/0x1420 fs/ext4/fsync.c:118 vfs_fsync_range fs/sync.c:197 [inline] vfs_fsync+0x127/0x1f0 fs/sync.c:211 __loop_update_dio+0x4cd/0x690 drivers/block/loop.c:209 loop_update_dio drivers/block/loop.c:636 [inline] loop_set_fd drivers/block/loop.c:1000 [inline] lo_ioctl+0xeee/0x20e0 drivers/block/loop.c:1576 __blkdev_driver_ioctl block/ioctl.c:303 [inline] blkdev_ioctl+0x5cb/0x1a80 block/ioctl.c:601 block_ioctl+0xe9/0x130 fs/block_dev.c:1906 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:501 [inline] do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705 __do_sys_ioctl fs/ioctl.c:712 [inline] __se_sys_ioctl fs/ioctl.c:710 [inline] __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fdc74a900d9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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:00007fdc72fe1168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fdc74bb0050 RCX: 00007fdc74a900d9 RDX: 0000000000000006 RSI: 0000000000004c00 RDI: 0000000000000003 RBP: 00007fdc74aebae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdfc03bf1f R14: 00007fdc72fe1300 R15: 0000000000022000 audit: type=1800 audit(1670071449.798:548): pid=20539 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=14714 res=0 IPVS: ftp: loaded support on port[0] = 21 IPVS: ftp: loaded support on port[0] = 21 audit: type=1800 audit(1670071449.908:549): pid=20567 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14723 res=0 audit: type=1804 audit(1670071449.938:550): pid=20567 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir297223946/syzkaller.unVSuU/173/bus" dev="sda1" ino=14723 res=1 audit: type=1800 audit(1670071450.068:551): pid=20606 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=14714 res=0 IPVS: ftp: loaded support on port[0] = 21 audit: type=1804 audit(1670071450.118:552): pid=20604 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.3" name="/root/syzkaller-testdir2907803225/syzkaller.W3tnLR/157/bus" dev="sda1" ino=14714 res=1 IPVS: ftp: loaded support on port[0] = 21 audit: type=1800 audit(1670071450.288:553): pid=20651 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14729 res=0 audit: type=1804 audit(1670071450.318:554): pid=20651 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir297223946/syzkaller.unVSuU/174/bus" dev="sda1" ino=14729 res=1 IPVS: ftp: loaded support on port[0] = 21 audit: type=1800 audit(1670071450.458:555): pid=20678 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14729 res=0 hub 9-0:1.0: USB hub found hub 9-0:1.0: 8 ports detected netlink: 252 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 252 bytes leftover after parsing attributes in process `syz-executor.5'. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. netlink: 252 bytes leftover after parsing attributes in process `syz-executor.5'. dccp_close: ABORT with 87 bytes unread TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. kauditd_printk_skb: 110 callbacks suppressed audit: type=1804 audit(1670071453.978:666): pid=20860 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.3" name="/root/syzkaller-testdir2907803225/syzkaller.W3tnLR/160/bus" dev="sda1" ino=14752 res=1 audit: type=1804 audit(1670071454.418:667): pid=20880 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.5" name="/root/syzkaller-testdir2193354441/syzkaller.Pcz8tk/89/bus" dev="sda1" ino=14765 res=1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. audit: type=1804 audit(1670071454.468:668): pid=20879 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2672578151/syzkaller.SlFWDR/190/bus" dev="sda1" ino=14755 res=1 audit: type=1804 audit(1670071454.738:669): pid=20863 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.3" name="/root/syzkaller-testdir2907803225/syzkaller.W3tnLR/160/bus" dev="sda1" ino=14752 res=1 audit: type=1804 audit(1670071455.329:670): pid=20882 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2672578151/syzkaller.SlFWDR/190/bus" dev="sda1" ino=14755 res=1 audit: type=1804 audit(1670071455.609:671): pid=20885 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.5" name="/root/syzkaller-testdir2193354441/syzkaller.Pcz8tk/89/bus" dev="sda1" ino=14765 res=1 audit: type=1804 audit(1670071455.999:672): pid=20908 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.3" name="/root/syzkaller-testdir2907803225/syzkaller.W3tnLR/161/bus" dev="sda1" ino=14739 res=1 audit: type=1804 audit(1670071456.559:673): pid=20911 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.3" name="/root/syzkaller-testdir2907803225/syzkaller.W3tnLR/161/bus" dev="sda1" ino=14739 res=1 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. audit: type=1804 audit(1670071456.699:674): pid=20926 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2672578151/syzkaller.SlFWDR/191/bus" dev="sda1" ino=14772 res=1 Bluetooth: hci3: command 0x0406 tx timeout audit: type=1804 audit(1670071456.729:675): pid=20927 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.5" name="/root/syzkaller-testdir2193354441/syzkaller.Pcz8tk/90/bus" dev="sda1" ino=14755 res=1