audit: type=1804 audit(1669923371.824:13): pid=12019 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir1635526590/syzkaller.1UIi16/94/file0/bus" dev="loop4" ino=25 res=1 ====================================================== WARNING: possible circular locking dependency detected 4.14.300-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.4/12019 is trying to acquire lock: (&sbi->alloc_mutex){+.+.}, at: [] hfsplus_block_free+0xc7/0x560 fs/hfsplus/bitmap.c:182 but task is already holding lock: (&tree->tree_lock#2/1){+.+.}, at: [] hfsplus_find_init+0x161/0x220 fs/hfsplus/bfind.c:33 audit: type=1804 audit(1669923371.834:14): pid=12019 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir1635526590/syzkaller.1UIi16/94/file0/bus" dev="loop4" ino=25 res=1 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&tree->tree_lock#2/1){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 hfsplus_find_init+0x161/0x220 fs/hfsplus/bfind.c:33 hfsplus_ext_read_extent+0x15f/0x9e0 fs/hfsplus/extents.c:216 hfsplus_get_block+0x23e/0x820 fs/hfsplus/extents.c:268 block_read_full_page+0x25e/0x8d0 fs/buffer.c:2316 do_read_cache_page+0x38e/0xc10 mm/filemap.c:2713 read_mapping_page include/linux/pagemap.h:398 [inline] hfsplus_block_allocate+0x189/0x910 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x421/0xef0 fs/hfsplus/extents.c:463 hfsplus_get_block+0x15b/0x820 fs/hfsplus/extents.c:245 __block_write_begin_int+0x35c/0x11d0 fs/buffer.c:2038 __block_write_begin fs/buffer.c:2088 [inline] block_write_begin+0x58/0x270 fs/buffer.c:2147 audit: type=1804 audit(1669923371.834:15): pid=12019 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir1635526590/syzkaller.1UIi16/94/file0/bus" dev="loop4" ino=25 res=1 cont_write_begin+0x4a3/0x740 fs/buffer.c:2497 hfsplus_write_begin+0x87/0x130 fs/hfsplus/inode.c:53 cont_expand_zero fs/buffer.c:2424 [inline] cont_write_begin+0x296/0x740 fs/buffer.c:2487 hfsplus_write_begin+0x87/0x130 fs/hfsplus/inode.c:53 generic_cont_expand_simple+0xe1/0x130 fs/buffer.c:2388 hfsplus_setattr+0x139/0x310 fs/hfsplus/inode.c:258 notify_change+0x56b/0xd10 fs/attr.c:315 do_truncate+0xff/0x1a0 fs/open.c:63 do_sys_ftruncate.constprop.0+0x3a3/0x480 fs/open.c:205 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #1 (&HFSPLUS_I(inode)->extents_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 hfsplus_get_block+0x1f9/0x820 fs/hfsplus/extents.c:260 block_read_full_page+0x25e/0x8d0 fs/buffer.c:2316 do_read_cache_page+0x38e/0xc10 mm/filemap.c:2713 read_mapping_page include/linux/pagemap.h:398 [inline] hfsplus_block_allocate+0x189/0x910 fs/hfsplus/bitmap.c:37 hfsplus_file_extend+0x421/0xef0 fs/hfsplus/extents.c:463 hfsplus_get_block+0x15b/0x820 fs/hfsplus/extents.c:245 __block_write_begin_int+0x35c/0x11d0 fs/buffer.c:2038 __block_write_begin fs/buffer.c:2088 [inline] block_write_begin+0x58/0x270 fs/buffer.c:2147 cont_write_begin+0x4a3/0x740 fs/buffer.c:2497 hfsplus_write_begin+0x87/0x130 fs/hfsplus/inode.c:53 cont_expand_zero fs/buffer.c:2424 [inline] cont_write_begin+0x296/0x740 fs/buffer.c:2487 hfsplus_write_begin+0x87/0x130 fs/hfsplus/inode.c:53 generic_cont_expand_simple+0xe1/0x130 fs/buffer.c:2388 hfsplus_setattr+0x139/0x310 fs/hfsplus/inode.c:258 notify_change+0x56b/0xd10 fs/attr.c:315 do_truncate+0xff/0x1a0 fs/open.c:63 do_sys_ftruncate.constprop.0+0x3a3/0x480 fs/open.c:205 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 -> #0 (&sbi->alloc_mutex){+.+.}: lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 hfsplus_block_free+0xc7/0x560 fs/hfsplus/bitmap.c:182 hfsplus_free_extents+0x320/0x440 fs/hfsplus/extents.c:371 hfsplus_file_truncate+0xbc0/0xe80 fs/hfsplus/extents.c:585 hfsplus_write_failed fs/hfsplus/inode.c:42 [inline] hfsplus_write_begin+0x103/0x130 fs/hfsplus/inode.c:57 cont_expand_zero fs/buffer.c:2424 [inline] cont_write_begin+0x296/0x740 fs/buffer.c:2487 hfsplus_write_begin+0x87/0x130 fs/hfsplus/inode.c:53 generic_cont_expand_simple+0xe1/0x130 fs/buffer.c:2388 hfsplus_setattr+0x139/0x310 fs/hfsplus/inode.c:258 notify_change+0x56b/0xd10 fs/attr.c:315 do_truncate+0xff/0x1a0 fs/open.c:63 do_sys_ftruncate.constprop.0+0x3a3/0x480 fs/open.c:205 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 other info that might help us debug this: Chain exists of: &sbi->alloc_mutex --> &HFSPLUS_I(inode)->extents_lock --> &tree->tree_lock#2/1 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&tree->tree_lock#2/1); lock(&HFSPLUS_I(inode)->extents_lock); lock(&tree->tree_lock#2/1); lock(&sbi->alloc_mutex); *** DEADLOCK *** 4 locks held by syz-executor.4/12019: #0: (sb_writers#13){.+.+}, at: [] sb_start_write include/linux/fs.h:1551 [inline] #0: (sb_writers#13){.+.+}, at: [] do_sys_ftruncate.constprop.0+0x1fb/0x480 fs/open.c:200 #1: (&sb->s_type->i_mutex_key#21){+.+.}, at: [] inode_lock include/linux/fs.h:719 [inline] #1: (&sb->s_type->i_mutex_key#21){+.+.}, at: [] do_truncate+0xf0/0x1a0 fs/open.c:61 #2: (&hip->extents_lock){+.+.}, at: [] hfsplus_file_truncate+0x1ba/0xe80 fs/hfsplus/extents.c:571 #3: (&tree->tree_lock#2/1){+.+.}, at: [] hfsplus_find_init+0x161/0x220 fs/hfsplus/bfind.c:33 stack backtrace: CPU: 1 PID: 12019 Comm: syz-executor.4 Not tainted 4.14.300-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x281 lib/dump_stack.c:58 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1258 check_prev_add kernel/locking/lockdep.c:1905 [inline] check_prevs_add kernel/locking/lockdep.c:2022 [inline] validate_chain kernel/locking/lockdep.c:2464 [inline] __lock_acquire+0x2e0e/0x3f20 kernel/locking/lockdep.c:3491 lock_acquire+0x170/0x3f0 kernel/locking/lockdep.c:3998 __mutex_lock_common kernel/locking/mutex.c:756 [inline] __mutex_lock+0xc4/0x1310 kernel/locking/mutex.c:893 hfsplus_block_free+0xc7/0x560 fs/hfsplus/bitmap.c:182 hfsplus_free_extents+0x320/0x440 fs/hfsplus/extents.c:371 hfsplus_file_truncate+0xbc0/0xe80 fs/hfsplus/extents.c:585 hfsplus_write_failed fs/hfsplus/inode.c:42 [inline] hfsplus_write_begin+0x103/0x130 fs/hfsplus/inode.c:57 cont_expand_zero fs/buffer.c:2424 [inline] cont_write_begin+0x296/0x740 fs/buffer.c:2487 hfsplus_write_begin+0x87/0x130 fs/hfsplus/inode.c:53 generic_cont_expand_simple+0xe1/0x130 fs/buffer.c:2388 hfsplus_setattr+0x139/0x310 fs/hfsplus/inode.c:258 notify_change+0x56b/0xd10 fs/attr.c:315 do_truncate+0xff/0x1a0 fs/open.c:63 do_sys_ftruncate.constprop.0+0x3a3/0x480 fs/open.c:205 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x5e/0xd3 audit: type=1804 audit(1669923372.724:16): pid=12044 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/85/bus" dev="sda1" ino=14218 res=1 UDF-fs: error (device loop1): udf_process_sequence: Block 100 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop1): udf_process_sequence: Block 1988 of volume descriptor sequence is corrupted or we could not read it audit: type=1804 audit(1669923373.384:17): pid=12055 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/86/bus" dev="sda1" ino=14266 res=1 UDF-fs: Scanning with blocksize 512 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 audit: type=1804 audit(1669923373.394:18): pid=12058 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2261287791/syzkaller.bkph0H/99/bus" dev="sda1" ino=14267 res=1 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: error (device loop1): udf_read_tagged: read failed, block=256, location=256 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 audit: type=1804 audit(1669923373.725:19): pid=12062 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.4" name="/root/syzkaller-testdir1635526590/syzkaller.1UIi16/95/file0/bus" dev="loop4" ino=25 res=1 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 4096 failed UDF-fs: warning (device loop1): udf_fill_super: No partition found (1) audit: type=1804 audit(1669923373.725:20): pid=12062 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir1635526590/syzkaller.1UIi16/95/file0/bus" dev="loop4" ino=25 res=1 audit: type=1804 audit(1669923373.725:21): pid=12062 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.4" name="/root/syzkaller-testdir1635526590/syzkaller.1UIi16/95/file0/bus" dev="loop4" ino=25 res=1 audit: type=1804 audit(1669923374.305:22): pid=12081 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/87/bus" dev="sda1" ino=14272 res=1 UDF-fs: error (device loop1): udf_process_sequence: Block 100 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop1): udf_process_sequence: Block 1988 of volume descriptor sequence is corrupted or we could not read it UDF-fs: Scanning with blocksize 512 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: error (device loop1): udf_read_tagged: read failed, block=256, location=256 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 4096 failed UDF-fs: warning (device loop1): udf_fill_super: No partition found (1) UDF-fs: error (device loop1): udf_process_sequence: Block 100 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop1): udf_process_sequence: Block 1988 of volume descriptor sequence is corrupted or we could not read it UDF-fs: Scanning with blocksize 512 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: error (device loop1): udf_read_tagged: read failed, block=256, location=256 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found kauditd_printk_skb: 24 callbacks suppressed audit: type=1804 audit(1669923377.165:47): pid=12222 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.5" name="/root/syzkaller-testdir3540420677/syzkaller.5Lg9wK/89/file0/bus" dev="loop5" ino=25 res=1 UDF-fs: Scanning with blocksize 4096 failed audit: type=1804 audit(1669923377.165:48): pid=12222 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir3540420677/syzkaller.5Lg9wK/89/file0/bus" dev="loop5" ino=25 res=1 audit: type=1804 audit(1669923377.165:49): pid=12222 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.5" name="/root/syzkaller-testdir3540420677/syzkaller.5Lg9wK/89/file0/bus" dev="loop5" ino=25 res=1 UDF-fs: warning (device loop1): udf_fill_super: No partition found (1) audit: type=1804 audit(1669923377.405:50): pid=12236 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/90/file0/bus" dev="loop3" ino=25 res=1 audit: type=1804 audit(1669923377.405:51): pid=12236 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/90/file0/bus" dev="loop3" ino=25 res=1 audit: type=1804 audit(1669923377.405:52): pid=12236 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/90/file0/bus" dev="loop3" ino=25 res=1 audit: type=1804 audit(1669923377.525:53): pid=12247 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.0" name="/root/syzkaller-testdir2261287791/syzkaller.bkph0H/104/file0/bus" dev="loop0" ino=25 res=1 UDF-fs: error (device loop1): udf_process_sequence: Block 100 of volume descriptor sequence is corrupted or we could not read it UDF-fs: error (device loop1): udf_process_sequence: Block 1988 of volume descriptor sequence is corrupted or we could not read it UDF-fs: Scanning with blocksize 512 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 audit: type=1804 audit(1669923377.525:54): pid=12247 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.0" name="/root/syzkaller-testdir2261287791/syzkaller.bkph0H/104/file0/bus" dev="loop0" ino=25 res=1 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 audit: type=1804 audit(1669923377.525:55): pid=12247 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="ToMToU" comm="syz-executor.0" name="/root/syzkaller-testdir2261287791/syzkaller.bkph0H/104/file0/bus" dev="loop0" ino=25 res=1 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 1024 failed UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 audit: type=1804 audit(1669923378.295:56): pid=12302 uid=0 auid=4294967295 ses=4294967295 op="invalid_pcr" cause="open_writers" comm="syz-executor.3" name="/root/syzkaller-testdir3635600960/syzkaller.uqRLMg/91/file0/bus" dev="loop3" ino=25 res=1 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 2048 failed UDF-fs: error (device loop1): udf_read_tagged: read failed, block=256, location=256 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: read failed, block=512, location=512 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: error (device loop1): udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 0 UDF-fs: warning (device loop1): udf_load_vrs: No anchor found UDF-fs: Scanning with blocksize 4096 failed UDF-fs: warning (device loop1): udf_fill_super: No partition found (1) net_ratelimit: 1 callbacks suppressed ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table ip_tables: iptables: counters copy to user failed while replacing table