Warning: Permanently added '10.128.0.46' (ED25519) to the list of known hosts. executing program [ 50.879659][ T3500] [ 50.881996][ T3500] ====================================================== [ 50.888996][ T3500] WARNING: possible circular locking dependency detected [ 50.895993][ T3500] 5.15.146-syzkaller #0 Not tainted [ 50.901165][ T3500] ------------------------------------------------------ [ 50.908160][ T3500] syz-executor340/3500 is trying to acquire lock: [ 50.914555][ T3500] ffff88814af2a170 (&journal->j_barrier){+.+.}-{3:3}, at: jbd2_journal_lock_updates+0x2aa/0x370 [ 50.924997][ T3500] [ 50.924997][ T3500] but task is already holding lock: [ 50.932338][ T3500] ffff88814af28bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_change_inode_journal_flag+0x1a0/0x6e0 [ 50.943637][ T3500] [ 50.943637][ T3500] which lock already depends on the new lock. [ 50.943637][ T3500] [ 50.954032][ T3500] [ 50.954032][ T3500] the existing dependency chain (in reverse order) is: [ 50.963200][ T3500] [ 50.963200][ T3500] -> #4 (&sbi->s_writepages_rwsem){++++}-{0:0}: [ 50.971613][ T3500] lock_acquire+0x1db/0x4f0 [ 50.976631][ T3500] percpu_down_write+0x52/0x2d0 [ 50.981999][ T3500] ext4_change_inode_journal_flag+0x1a0/0x6e0 [ 50.988597][ T3500] ext4_fileattr_set+0xdf4/0x1750 [ 50.994166][ T3500] vfs_fileattr_set+0x8f3/0xd30 [ 50.999544][ T3500] do_vfs_ioctl+0x1d85/0x2b70 [ 51.004729][ T3500] __se_sys_ioctl+0x81/0x160 [ 51.009837][ T3500] do_syscall_64+0x3d/0xb0 [ 51.014775][ T3500] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 51.021175][ T3500] [ 51.021175][ T3500] -> #3 (mapping.invalidate_lock){++++}-{3:3}: [ 51.029495][ T3500] lock_acquire+0x1db/0x4f0 [ 51.034502][ T3500] down_write+0x97/0x170 [ 51.039247][ T3500] ext4_setattr+0xd6c/0x1990 [ 51.044348][ T3500] notify_change+0xc6d/0xf50 [ 51.049440][ T3500] do_truncate+0x21c/0x300 [ 51.054362][ T3500] do_sys_ftruncate+0x2eb/0x390 [ 51.059725][ T3500] do_syscall_64+0x3d/0xb0 [ 51.064650][ T3500] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 51.071049][ T3500] [ 51.071049][ T3500] -> #2 (&sb->s_type->i_mutex_key#9){++++}-{3:3}: [ 51.079647][ T3500] lock_acquire+0x1db/0x4f0 [ 51.084687][ T3500] down_read+0x45/0x2e0 [ 51.089349][ T3500] ext4_bmap+0x4b/0x410 [ 51.094024][ T3500] bmap+0xa1/0xd0 [ 51.098165][ T3500] jbd2_journal_flush+0x7a2/0xc90 [ 51.103695][ T3500] ext4_ioctl+0x3249/0x5b80 [ 51.108701][ T3500] __se_sys_ioctl+0xf1/0x160 [ 51.113798][ T3500] do_syscall_64+0x3d/0xb0 [ 51.118721][ T3500] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 51.125143][ T3500] [ 51.125143][ T3500] -> #1 (&journal->j_checkpoint_mutex){+.+.}-{3:3}: [ 51.133907][ T3500] lock_acquire+0x1db/0x4f0 [ 51.138921][ T3500] __mutex_lock_common+0x1da/0x25a0 [ 51.144713][ T3500] mutex_lock_io_nested+0x45/0x60 [ 51.150252][ T3500] jbd2_journal_flush+0x290/0xc90 [ 51.155790][ T3500] ext4_ioctl+0x3249/0x5b80 [ 51.160823][ T3500] __se_sys_ioctl+0xf1/0x160 [ 51.165937][ T3500] do_syscall_64+0x3d/0xb0 [ 51.170883][ T3500] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 51.177299][ T3500] [ 51.177299][ T3500] -> #0 (&journal->j_barrier){+.+.}-{3:3}: [ 51.185274][ T3500] validate_chain+0x1649/0x5930 [ 51.190630][ T3500] __lock_acquire+0x1295/0x1ff0 [ 51.195983][ T3500] lock_acquire+0x1db/0x4f0 [ 51.200993][ T3500] __mutex_lock_common+0x1da/0x25a0 [ 51.206701][ T3500] mutex_lock_nested+0x17/0x20 [ 51.211976][ T3500] jbd2_journal_lock_updates+0x2aa/0x370 [ 51.218120][ T3500] ext4_change_inode_journal_flag+0x1a8/0x6e0 [ 51.224696][ T3500] ext4_fileattr_set+0xdf4/0x1750 [ 51.230239][ T3500] vfs_fileattr_set+0x8f3/0xd30 [ 51.235602][ T3500] do_vfs_ioctl+0x1d85/0x2b70 [ 51.240794][ T3500] __se_sys_ioctl+0x81/0x160 [ 51.245901][ T3500] do_syscall_64+0x3d/0xb0 [ 51.250839][ T3500] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 51.257256][ T3500] [ 51.257256][ T3500] other info that might help us debug this: [ 51.257256][ T3500] [ 51.267468][ T3500] Chain exists of: [ 51.267468][ T3500] &journal->j_barrier --> mapping.invalidate_lock --> &sbi->s_writepages_rwsem [ 51.267468][ T3500] [ 51.282303][ T3500] Possible unsafe locking scenario: [ 51.282303][ T3500] [ 51.289756][ T3500] CPU0 CPU1 [ 51.295108][ T3500] ---- ---- [ 51.300467][ T3500] lock(&sbi->s_writepages_rwsem); [ 51.305652][ T3500] lock(mapping.invalidate_lock); [ 51.313268][ T3500] lock(&sbi->s_writepages_rwsem); [ 51.321061][ T3500] lock(&journal->j_barrier); [ 51.325820][ T3500] [ 51.325820][ T3500] *** DEADLOCK *** [ 51.325820][ T3500] [ 51.333948][ T3500] 4 locks held by syz-executor340/3500: [ 51.339477][ T3500] #0: ffff88807e4f6460 (sb_writers#5){.+.+}-{0:0}, at: mnt_want_write_file+0x5a/0x1f0 [ 51.349129][ T3500] #1: ffff8880742a67a0 (&sb->s_type->i_mutex_key#9){++++}-{3:3}, at: vfs_fileattr_set+0x135/0xd30 [ 51.359816][ T3500] #2: ffff8880742a6940 (mapping.invalidate_lock){++++}-{3:3}, at: ext4_change_inode_journal_flag+0x115/0x6e0 [ 51.371455][ T3500] #3: ffff88814af28bd8 (&sbi->s_writepages_rwsem){++++}-{0:0}, at: ext4_change_inode_journal_flag+0x1a0/0x6e0 [ 51.383186][ T3500] [ 51.383186][ T3500] stack backtrace: [ 51.389067][ T3500] CPU: 1 PID: 3500 Comm: syz-executor340 Not tainted 5.15.146-syzkaller #0 [ 51.397639][ T3500] Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 [ 51.407700][ T3500] Call Trace: [ 51.410985][ T3500] [ 51.413905][ T3500] dump_stack_lvl+0x1e3/0x2cb [ 51.418592][ T3500] ? io_uring_drop_tctx_refs+0x19d/0x19d [ 51.424221][ T3500] ? print_circular_bug+0x12b/0x1a0 [ 51.429409][ T3500] check_noncircular+0x2f8/0x3b0 [ 51.434357][ T3500] ? add_chain_block+0x850/0x850 [ 51.439278][ T3500] ? lockdep_lock+0x11f/0x2a0 [ 51.443946][ T3500] ? validate_chain+0x112/0x5930 [ 51.448872][ T3500] validate_chain+0x1649/0x5930 [ 51.453711][ T3500] ? reacquire_held_locks+0x660/0x660 [ 51.459070][ T3500] ? lockdep_unlock+0x166/0x300 [ 51.463905][ T3500] ? lockdep_lock+0x2a0/0x2a0 [ 51.468681][ T3500] ? lockdep_unlock+0x166/0x300 [ 51.473538][ T3500] ? reacquire_held_locks+0x660/0x660 [ 51.478908][ T3500] ? validate_chain+0x13bd/0x5930 [ 51.483933][ T3500] ? mark_lock+0x98/0x340 [ 51.488250][ T3500] ? mark_lock+0x98/0x340 [ 51.492568][ T3500] __lock_acquire+0x1295/0x1ff0 [ 51.497413][ T3500] lock_acquire+0x1db/0x4f0 [ 51.501926][ T3500] ? jbd2_journal_lock_updates+0x2aa/0x370 [ 51.507726][ T3500] ? read_lock_is_recursive+0x10/0x10 [ 51.513093][ T3500] ? __might_sleep+0xc0/0xc0 [ 51.517677][ T3500] ? print_irqtrace_events+0x210/0x210 [ 51.523140][ T3500] ? lockdep_hardirqs_off+0x70/0x100 [ 51.528466][ T3500] ? do_raw_spin_unlock+0x137/0x8b0 [ 51.533654][ T3500] __mutex_lock_common+0x1da/0x25a0 [ 51.538842][ T3500] ? jbd2_journal_lock_updates+0x2aa/0x370 [ 51.544638][ T3500] ? jbd2_journal_lock_updates+0x2aa/0x370 [ 51.550431][ T3500] ? jbd2_journal_lock_updates+0x299/0x370 [ 51.556222][ T3500] ? jbd2_journal_wait_updates+0x268/0x2d0 [ 51.562014][ T3500] ? mutex_lock_io_nested+0x60/0x60 [ 51.567204][ T3500] ? do_raw_read_unlock+0x70/0x70 [ 51.572216][ T3500] ? rcu_sync_func+0xaa/0x210 [ 51.576879][ T3500] mutex_lock_nested+0x17/0x20 [ 51.581631][ T3500] jbd2_journal_lock_updates+0x2aa/0x370 [ 51.587261][ T3500] ? jbd2_journal_wait_updates+0x2d0/0x2d0 [ 51.593052][ T3500] ? down_write+0x10e/0x170 [ 51.597555][ T3500] ? cpumask_next+0xc3/0xf0 [ 51.602044][ T3500] ? percpu_down_write+0x1ea/0x2d0 [ 51.607144][ T3500] ext4_change_inode_journal_flag+0x1a8/0x6e0 [ 51.613219][ T3500] ext4_fileattr_set+0xdf4/0x1750 [ 51.618248][ T3500] ? ext4_fileattr_get+0x200/0x200 [ 51.623348][ T3500] ? memset+0x1f/0x40 [ 51.627312][ T3500] ? fileattr_fill_flags+0x1d0/0x300 [ 51.632582][ T3500] ? fscrypt_prepare_setflags+0x5d/0x220 [ 51.638201][ T3500] vfs_fileattr_set+0x8f3/0xd30 [ 51.643060][ T3500] ? copy_fsxattr_to_user+0x3a0/0x3a0 [ 51.648425][ T3500] do_vfs_ioctl+0x1d85/0x2b70 [ 51.653091][ T3500] ? __x64_compat_sys_ioctl+0x80/0x80 [ 51.658448][ T3500] ? __lock_acquire+0x1ff0/0x1ff0 [ 51.663457][ T3500] ? slab_free_freelist_hook+0xdd/0x160 [ 51.668989][ T3500] ? tomoyo_path_number_perm+0x648/0x810 [ 51.674609][ T3500] ? kfree+0xf1/0x270 [ 51.678584][ T3500] ? tomoyo_path_number_perm+0x6ab/0x810 [ 51.684219][ T3500] ? tomoyo_check_path_acl+0x1c0/0x1c0 [ 51.689675][ T3500] ? lockdep_hardirqs_on_prepare+0x438/0x7a0 [ 51.695645][ T3500] ? print_irqtrace_events+0x210/0x210 [ 51.701100][ T3500] ? vtime_user_exit+0x2d1/0x400 [ 51.706031][ T3500] ? bpf_lsm_file_ioctl+0x5/0x10 [ 51.711070][ T3500] ? security_file_ioctl+0x7d/0xa0 [ 51.716185][ T3500] __se_sys_ioctl+0x81/0x160 [ 51.720768][ T3500] do_syscall_64+0x3d/0xb0 [ 51.725197][ T3500] entry_SYSCALL_64_after_hwframe+0x61/0xcb [ 51.731098][ T3500] RIP: 0033:0x7f333ec8b369 [ 51.735507][ T3500] Code: 48 83 c4 28 c3 e8 37 17 00 00 0f 1f 80 00 00 00 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 b8 ff ff ff f7 d8 64 89 01 48 [ 51.755097][ T3500] RSP: 002b:00007ffcd94ace08 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [ 51.763497][ T3500] RAX: ffffffffffffffda RBX: 00007ffcd94acfd8 RCX: 00007f333ec8b369 [ 51.771469][ T3500] RDX: 0000000020000180 RSI: 0000000040086602 RDI: 0000000000000004 [ 51.779432][ T3500] RBP: 00007f333ecfe610 R08: