BTRFS: device fsid 28302361-d975-4c41-bd4c-c547b14b74a1 devid 1 transid 8 /dev/loop5 BTRFS info (device loop5): using free space tree BTRFS info (device loop5): has skinny extents ====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/24452 is trying to acquire lock: 00000000c9c8512c (sb_internal#3){.+.+}, at: sb_start_intwrite include/linux/fs.h:1626 [inline] 00000000c9c8512c (sb_internal#3){.+.+}, at: start_transaction+0xa37/0xf90 fs/btrfs/transaction.c:528 but task is already holding lock: 000000000cf78d66 (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x152/0x200 mm/util.c:355 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #8 (&mm->mmap_sem){++++}: perf_copy_attr+0xab/0x7a0 kernel/events/core.c:10275 _perf_ioctl+0x6aa/0x2300 kernel/events/core.c:5150 perf_ioctl+0x55/0x80 kernel/events/core.c:5177 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 -> #7 (&cpuctx_mutex){+.+.}: perf_event_init_cpu+0xc4/0x170 kernel/events/core.c:11828 perf_event_init+0x309/0x34e kernel/events/core.c:11875 start_kernel+0x5b1/0x911 init/main.c:644 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243 -> #6 (pmus_lock){+.+.}: perf_event_init_cpu+0x2c/0x170 kernel/events/core.c:11822 cpuhp_invoke_callback+0x201/0x1b80 kernel/cpu.c:170 cpuhp_up_callbacks kernel/cpu.c:584 [inline] _cpu_up+0x25c/0x540 kernel/cpu.c:1192 do_cpu_up+0xdd/0x1b0 kernel/cpu.c:1228 smp_init+0x1ed/0x202 kernel/smp.c:578 kernel_init_freeable+0x62b/0xab7 init/main.c:1138 kernel_init+0xd/0x1ba init/main.c:1062 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 -> #5 (cpu_hotplug_lock.rw_sem){++++}: get_online_cpus include/linux/cpu.h:137 [inline] kmem_cache_create_usercopy+0x24/0x240 mm/slab_common.c:447 kmem_cache_create+0xd/0x10 mm/slab_common.c:522 bio_find_or_create_slab block/bio.c:117 [inline] bioset_init+0x473/0x810 block/bio.c:1920 init_bio+0x184/0x1e0 block/bio.c:2094 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 -> #4 (bio_slab_lock){+.+.}: bio_find_or_create_slab block/bio.c:82 [inline] bioset_init+0x1ab/0x810 block/bio.c:1920 blk_alloc_queue_node+0x189/0xbf0 block/blk-core.c:1025 blk_mq_init_queue+0x44/0xa0 block/blk-mq.c:2500 loop_add+0x2cb/0x8a0 drivers/block/loop.c:1996 loop_init+0x1ef/0x24a drivers/block/loop.c:2259 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 -> #3 (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 F2FS-fs (loop0): Unrecognized mount option "no" or missing value do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #2 (&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 open_ctree+0x26b/0x61e0 fs/btrfs/disk-io.c:3326 btrfs_fill_super fs/btrfs/super.c:1209 [inline] btrfs_mount_root+0x12e5/0x1830 fs/btrfs/super.c:1613 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount+0x3c/0x60 fs/namespace.c:951 btrfs_mount+0x23a/0xaa0 fs/btrfs/super.c:1681 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&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 -> #0 (sb_internal#3){.+.+}: percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x6e/0x2a0 fs/super.c:1366 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 other info that might help us debug this: Chain exists of: sb_internal#3 --> &cpuctx_mutex --> &mm->mmap_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&mm->mmap_sem); lock(&cpuctx_mutex); lock(&mm->mmap_sem); lock(sb_internal#3); *** DEADLOCK *** 2 locks held by syz-executor.5/24452: #0: 000000000cf78d66 (&mm->mmap_sem){++++}, at: vm_mmap_pgoff+0x152/0x200 mm/util.c:355 #1: 00000000cad85710 (sb_writers#19){.+.+}, at: sb_start_write_trylock include/linux/fs.h:1584 [inline] #1: 00000000cad85710 (sb_writers#19){.+.+}, at: touch_atime+0x152/0x2a0 fs/inode.c:1731 stack backtrace: CPU: 0 PID: 24452 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 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 percpu_down_read_preempt_disable include/linux/percpu-rwsem.h:36 [inline] percpu_down_read include/linux/percpu-rwsem.h:59 [inline] __sb_start_write+0x6e/0x2a0 fs/super.c:1366 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 RIP: 0033:0x7fec8331d0c9 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:00007fec8188f168 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fec8343cf80 RCX: 00007fec8331d0c9 RDX: 0000000000000001 RSI: 0000000000003000 RDI: 0000000020000000 RBP: 00007fec83378ae9 R08: 0000000000000004 R09: 0000000000000000 R10: 0000000000010012 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffeed608b0f R14: 00007fec8188f300 R15: 0000000000022000 F2FS-fs (loop0): Unrecognized mount option "no" or missing value audit: type=1800 audit(1675666347.963:28399): pid=24368 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=15041 res=0 BTRFS info (device loop5): using free space tree BTRFS info (device loop5): has skinny extents F2FS-fs (loop0): Unrecognized mount option "no" or missing value F2FS-fs (loop0): Unrecognized mount option "no" or missing value audit: type=1800 audit(1675666349.993:28400): pid=24518 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=14868 res=0 BTRFS info (device loop5): using free space tree BTRFS info (device loop5): has skinny extents audit: type=1800 audit(1675666352.233:28401): pid=24620 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=15133 res=0 F2FS-fs (loop0): Unrecognized mount option "no" or missing value F2FS-fs (loop0): Unrecognized mount option "no" or missing value audit: type=1804 audit(1675666353.703:28402): pid=24746 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir1988427773/syzkaller.keLIwK/4260/bus" dev="sda1" ino=15132 res=1 audit: type=1804 audit(1675666353.823:28403): pid=24785 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.1" name="/root/syzkaller-testdir1988427773/syzkaller.keLIwK/4260/bus" dev="sda1" ino=15132 res=1 F2FS-fs (loop0): Unrecognized mount option "no" or missing value F2FS-fs (loop0): Unrecognized mount option "no" or missing value audit: type=1800 audit(1675666354.003:28404): pid=24726 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=15136 res=0 audit: type=1804 audit(1675666355.154:28405): pid=24849 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir1988427773/syzkaller.keLIwK/4261/bus" dev="sda1" ino=14421 res=1 audit: type=1804 audit(1675666355.154:28406): pid=24851 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.1" name="/root/syzkaller-testdir1988427773/syzkaller.keLIwK/4261/bus" dev="sda1" ino=14421 res=1 F2FS-fs (loop5): Mismatch start address, segment0(512) cp_blkaddr(605) F2FS-fs (loop5): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop5): invalid crc value F2FS-fs (loop5): Found nat_bits in checkpoint F2FS-fs (loop0): Unrecognized mount option "no" or missing value F2FS-fs (loop0): Unrecognized mount option "no" or missing value overlayfs: failed to resolve './file1': -2 netlink: 16 bytes leftover after parsing attributes in process `syz-executor.4'. F2FS-fs (loop5): Mounted with checkpoint version = 753bd00b audit: type=1804 audit(1675666356.044:28407): pid=24837 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.5" name="/root/syzkaller-testdir2844602636/syzkaller.EUugVE/5104/bus/bus" dev="loop5" ino=4 res=1 tmpfs: Bad value 'x2k47g2' for mount option 'size' audit: type=1804 audit(1675666356.124:28408): pid=24878 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.5" name="/root/syzkaller-testdir2844602636/syzkaller.EUugVE/5104/bus/bus" dev="loop5" ino=4 res=1 attempt to access beyond end of device loop5: rw=2049, want=77832, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77840, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77848, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77856, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77864, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77872, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77880, limit=63271 attempt to access beyond end of device audit: type=1804 audit(1675666356.494:28409): pid=24885 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.1" name="/root/syzkaller-testdir1988427773/syzkaller.keLIwK/4262/bus" dev="sda1" ino=15126 res=1 loop5: rw=2049, want=77888, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77896, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77904, limit=63271 attempt to access beyond end of device audit: type=1804 audit(1675666356.574:28410): pid=24884 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.1" name="/root/syzkaller-testdir1988427773/syzkaller.keLIwK/4262/bus" dev="sda1" ino=15126 res=1 loop5: rw=2049, want=77912, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77920, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77928, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77936, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77944, limit=63271 attempt to access beyond end of device loop5: rw=2049, want=77952, limit=63271 attempt to access beyond end of device loop5: rw=34817, want=77952, limit=63271 overlayfs: failed to resolve './bus': -2 overlayfs: failed to resolve './bus': -2 overlayfs: failed to resolve './bus': -2 overlayfs: failed to resolve './bus': -2 overlayfs: failed to resolve './bus': -2 overlayfs: failed to resolve './bus': -2 overlayfs: failed to resolve './bus': -2