====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.0/7042 is trying to acquire lock: 00000000874e2327 (&sbi->alloc_mutex){+.+.}, at: hfsplus_block_free+0xdb/0x5d0 fs/hfsplus/bitmap.c:182 but task is already holding lock: 000000004b2e64a4 (&HFSPLUS_I(inode)->extents_lock){+.+.}, at: hfsplus_file_truncate+0x1e2/0x1040 fs/hfsplus/extents.c:576 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}: hfsplus_get_block+0x292/0x960 fs/hfsplus/extents.c:260 block_read_full_page+0x288/0xd10 fs/buffer.c:2259 do_read_cache_page+0x533/0x1170 mm/filemap.c:2828 read_mapping_page include/linux/pagemap.h:402 [inline] hfsplus_block_allocate+0x197/0xa60 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x436/0xf40 fs/hfsplus/extents.c:468 hfsplus_get_block+0x196/0x960 fs/hfsplus/extents.c:245 __block_write_begin_int+0x46c/0x17b0 fs/buffer.c:1978 __block_write_begin fs/buffer.c:2028 [inline] block_write_begin+0x58/0x2e0 fs/buffer.c:2087 cont_write_begin+0x55a/0x820 fs/buffer.c:2440 hfsplus_write_begin+0x87/0x150 fs/hfsplus/inode.c:52 generic_perform_write+0x1f8/0x4d0 mm/filemap.c:3170 __generic_file_write_iter+0x24b/0x610 mm/filemap.c:3295 generic_file_write_iter+0x3f8/0x730 mm/filemap.c:3323 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 (&sbi->alloc_mutex){+.+.}: __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 hfsplus_block_free+0xdb/0x5d0 fs/hfsplus/bitmap.c:182 hfsplus_free_extents+0x228/0x520 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0xd96/0x1040 fs/hfsplus/extents.c:591 hfsplus_delete_inode+0x18d/0x220 fs/hfsplus/inode.c:419 hfsplus_unlink+0x595/0x820 fs/hfsplus/dir.c:405 hfsplus_rename+0xbe/0x200 fs/hfsplus/dir.c:545 vfs_rename+0x67e/0x1bc0 fs/namei.c:4479 do_renameat2+0xb59/0xc70 fs/namei.c:4629 __do_sys_rename fs/namei.c:4675 [inline] __se_sys_rename fs/namei.c:4673 [inline] __x64_sys_rename+0x5d/0x80 fs/namei.c:4673 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: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&HFSPLUS_I(inode)->extents_lock); lock(&sbi->alloc_mutex); lock(&HFSPLUS_I(inode)->extents_lock); lock(&sbi->alloc_mutex); *** DEADLOCK *** 8 locks held by syz-executor.0/7042: #0: 00000000ff3b15ca (sb_writers#30){.+.+}, at: sb_start_write include/linux/fs.h:1579 [inline] #0: 00000000ff3b15ca (sb_writers#30){.+.+}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:360 #1: 00000000b9cf9c50 (&type->s_vfs_rename_key#5){+.+.}, at: lock_rename+0x54/0x280 fs/namei.c:2867 #2: 0000000050311f41 (&type->i_mutex_dir_key#14/1){+.+.}, at: inode_lock_nested include/linux/fs.h:783 [inline] #2: 0000000050311f41 (&type->i_mutex_dir_key#14/1){+.+.}, at: lock_rename+0x132/0x280 fs/namei.c:2878 #3: 000000009e00998a (&type->i_mutex_dir_key#14/2){+.+.}, at: inode_lock_nested include/linux/fs.h:783 [inline] #3: 000000009e00998a (&type->i_mutex_dir_key#14/2){+.+.}, at: lock_rename+0x166/0x280 fs/namei.c:2879 #4: 00000000cb91ff25 (&sb->s_type->i_mutex_key#35){+.+.}, at: inode_lock include/linux/fs.h:748 [inline] #4: 00000000cb91ff25 (&sb->s_type->i_mutex_key#35){+.+.}, at: lock_two_nondirectories+0xec/0x110 fs/inode.c:1015 #5: 00000000f2962269 (&sb->s_type->i_mutex_key#35/4){+.+.}, at: inode_lock_nested include/linux/fs.h:783 [inline] #5: 00000000f2962269 (&sb->s_type->i_mutex_key#35/4){+.+.}, at: lock_two_nondirectories+0xd1/0x110 fs/inode.c:1017 #6: 00000000586b3622 (&sbi->vh_mutex){+.+.}, at: hfsplus_unlink+0x140/0x820 fs/hfsplus/dir.c:370 #7: 000000004b2e64a4 (&HFSPLUS_I(inode)->extents_lock){+.+.}, at: hfsplus_file_truncate+0x1e2/0x1040 fs/hfsplus/extents.c:576 stack backtrace: CPU: 0 PID: 7042 Comm: syz-executor.0 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 __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 hfsplus_block_free+0xdb/0x5d0 fs/hfsplus/bitmap.c:182 hfsplus_free_extents+0x228/0x520 fs/hfsplus/extents.c:363 hfsplus_file_truncate+0xd96/0x1040 fs/hfsplus/extents.c:591 hfsplus_delete_inode+0x18d/0x220 fs/hfsplus/inode.c:419 hfsplus_unlink+0x595/0x820 fs/hfsplus/dir.c:405 hfsplus_rename+0xbe/0x200 fs/hfsplus/dir.c:545 vfs_rename+0x67e/0x1bc0 fs/namei.c:4479 do_renameat2+0xb59/0xc70 fs/namei.c:4629 __do_sys_rename fs/namei.c:4675 [inline] __se_sys_rename fs/namei.c:4673 [inline] __x64_sys_rename+0x5d/0x80 fs/namei.c:4673 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fdaba87c0a9 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:00007fdab8dee168 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 00007fdaba99bf80 RCX: 00007fdaba87c0a9 RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000020000000 RBP: 00007fdaba8d7ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd22957b6f R14: 00007fdab8dee300 R15: 0000000000022000 REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 kauditd_printk_skb: 255 callbacks suppressed audit: type=1804 audit(1672058679.420:1043): pid=7088 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.3" name="/root/syzkaller-testdir1836918283/syzkaller.aLXPW8/968/bus" dev="sda1" ino=14647 res=1 REISERFS (device loop4): checking transaction log (loop4) audit: type=1800 audit(1672058679.420:1044): pid=7088 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.3" name="bus" dev="sda1" ino=14647 res=0 REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. attempt to access beyond end of device loop0: rw=0, want=201326594, limit=1024 Buffer I/O error on dev loop0, logical block 100663296, async page read hfsplus: unable to mark blocks free: error -5 hfsplus: can't free extent ntfs: (device loop1): parse_options(): NLS character set cp737case_sensitive=no not found. Using previous one maccenteuro. ntfs: (device loop1): parse_options(): Invalid mft_zone_multiplier. Using default value, i.e. 1. ntfs: (device loop1): check_mft_mirror(): $MFT and $MFTMirr (record 2) do not match. Run ntfsfix or chkdsk. ntfs: (device loop1): load_system_files(): $MFTMirr does not match $MFT. Mounting read-only. Run ntfsfix and/or chkdsk. ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Missing length entry in mapping pairs array. ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Invalid length in mapping pairs array. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0xa, attribute type 0x80, vcn 0x0, offset 0x0 because its location on disk could not be determined even after retrying (error code -5). ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Missing length entry in mapping pairs array. ntfs: volume version 3.1. ntfs: volume version 3.1. REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. hfsplus: unable to parse mount options ntfs: volume version 3.1. REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. ubi: mtd0 is already attached to ubi0 ubi0: detaching mtd0 ubi0: mtd0 is detached ubi0: attaching mtd0 ubi0: scanning is finished ubi0: attached mtd0 (name "mtdram test device", size 0 MiB) ubi0: PEB size: 4096 bytes (4 KiB), LEB size: 3968 bytes ubi0: min./max. I/O unit sizes: 1/64, sub-page size 1 ubi0: VID header offset: 64 (aligned 64), data offset: 128 ubi0: good PEBs: 32, bad PEBs: 0, corrupted PEBs: 0 ubi0: user volume: 0, internal volumes: 1, max. volumes count: 23 ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 532862539 ubi0: available PEBs: 28, total reserved PEBs: 4, PEBs reserved for bad PEB handling: 0 ubi0: background thread "ubi_bgt0d" started, PID 7438 ubi0: detaching mtd0 ubi0: mtd0 is detached REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode ubi0: attaching mtd0 reiserfs: using flush barriers ubi0: scanning is finished REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) ntfs: volume version 3.1. ubi0 error: ubi_attach_mtd_dev: cannot spawn "ubi_bgt0d", error -4 REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. team0: Port device bridge1 added tmpfs: No value for mount option 'ÿ' __ntfs_error: 72 callbacks suppressed ntfs: (device loop1): parse_options(): NLS character set cp737case_sensitive=no not found. Using previous one maccenteuro. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. audit: type=1800 audit(1672058684.670:1047): pid=7626 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed(directio) comm="syz-executor.2" name="bus" dev="sda1" ino=14418 res=0 ntfs: (device loop1): check_mft_mirror(): $MFT and $MFTMirr (record 2) do not match. Run ntfsfix or chkdsk. REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. ntfs: (device loop1): load_system_files(): $MFTMirr does not match $MFT. Mounting read-only. Run ntfsfix and/or chkdsk. reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Missing length entry in mapping pairs array. REISERFS (device loop4): checking transaction log (loop4) ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Invalid length in mapping pairs array. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.0'. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0xa, attribute type 0x80, vcn 0x0, offset 0x0 because its location on disk could not be determined even after retrying (error code -5). REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Missing length entry in mapping pairs array. ntfs: (device loop1): ntfs_mapping_pairs_decompress(): Invalid length in mapping pairs array. ntfs: (device loop1): ntfs_read_block(): Failed to read from inode 0xa, attribute type 0x80, vcn 0x0, offset 0x800 because its location on disk could not be determined even after retrying (error code -5). ntfs: volume version 3.1. ntfs: volume version 3.1. tmpfs: No value for mount option 'ÿ' xt_CHECKSUM: CHECKSUM should be avoided. If really needed, restrict with "-p udp" and only use in OUTPUT 9pnet: p9_fd_create_tcp (7727): problem connecting socket to 127.0.0.1 REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode Process accounting resumed reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) ntfs: volume version 3.1. 9pnet: p9_fd_create_tcp (7768): problem connecting socket to 127.0.0.1 REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. Process accounting resumed 9pnet: p9_fd_create_tcp (7753): problem connecting socket to 127.0.0.1 Process accounting resumed ntfs: volume version 3.1. 9pnet: p9_fd_create_tcp (7821): problem connecting socket to 127.0.0.1 tmpfs: No value for mount option 'ÿ' Process accounting resumed Process accounting resumed Process accounting resumed ntfs: volume version 3.1. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 136 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 72 bytes leftover after parsing attributes in process `syz-executor.3'. ntfs: volume version 3.1. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 136 bytes leftover after parsing attributes in process `syz-executor.3'. x_tables: ip6_tables: TCPMSS target: only valid for protocol 6 netlink: 72 bytes leftover after parsing attributes in process `syz-executor.3'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.3'. REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) ntfs: volume version 3.1. REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage. x_tables: ip6_tables: TCPMSS target: only valid for protocol 6 x_tables: ip6_tables: TCPMSS target: only valid for protocol 6 x_tables: ip6_tables: TCPMSS target: only valid for protocol 6 ntfs: volume version 3.1. x_tables: ip6_tables: TCPMSS target: only valid for protocol 6 REISERFS (device loop4): found reiserfs format "3.6" with non-standard journal REISERFS (device loop4): using ordered data mode reiserfs: using flush barriers REISERFS (device loop4): journal params: device loop4, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop4): checking transaction log (loop4) REISERFS (device loop4): Using r5 hash to sort names REISERFS (device loop4): Created .reiserfs_priv - reserved for xattr storage.