EXT4-fs (loop8): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: writeback. ext4 filesystem being mounted at /530/file1 supports timestamps until 2038-01-19 (0x7fffffff) ====================================================== WARNING: possible circular locking dependency detected 6.13.0-rc3-syzkaller-00062-gc061cf420ded #0 Not tainted ------------------------------------------------------ syz.8.5139/19370 is trying to acquire lock: ffff888057f235a8 (&dquot->dq_lock){+.+.}-{4:4}, at: wait_on_dquot fs/quota/dquot.c:354 [inline] ffff888057f235a8 (&dquot->dq_lock){+.+.}-{4:4}, at: dqget+0x5f2/0x1160 fs/quota/dquot.c:972 but task is already holding lock: ffff888057c03c38 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_lock_xattr fs/ext4/xattr.h:154 [inline] ffff888057c03c38 (&ei->xattr_sem){++++}-{4:4}, at: ext4_xattr_set_handle+0x159/0x1420 fs/ext4/xattr.c:2373 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #9 (&ei->xattr_sem){++++}-{4:4}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 ext4_readpage_inline+0x33/0x610 fs/ext4/inline.c:518 ext4_read_folio+0x192/0x380 fs/ext4/inode.c:3185 filemap_read_folio+0xc9/0x2a0 mm/filemap.c:2366 filemap_create_folio mm/filemap.c:2497 [inline] filemap_get_pages+0x100b/0x1be0 mm/filemap.c:2555 filemap_read+0x3ca/0xd70 mm/filemap.c:2646 generic_file_read_iter+0x344/0x450 mm/filemap.c:2834 ext4_file_read_iter+0x1d6/0x6a0 fs/ext4/file.c:147 __kernel_read+0x3f4/0xb50 fs/read_write.c:523 integrity_kernel_read+0x7f/0xb0 security/integrity/iint.c:28 ima_calc_file_hash_tfm+0x2c9/0x3e0 security/integrity/ima/ima_crypto.c:480 ima_calc_file_shash security/integrity/ima/ima_crypto.c:511 [inline] ima_calc_file_hash+0x1ba/0x490 security/integrity/ima/ima_crypto.c:568 ima_collect_measurement+0x89f/0xa40 security/integrity/ima/ima_api.c:293 process_measurement+0x1271/0x2370 security/integrity/ima/ima_main.c:372 ima_file_check+0xc6/0x110 security/integrity/ima/ima_main.c:572 security_file_post_open+0x8e/0x210 security/security.c:3121 do_open fs/namei.c:3830 [inline] path_openat+0x1419/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_openat fs/open.c:1433 [inline] __se_sys_openat fs/open.c:1428 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1428 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #8 (mapping.invalidate_lock){++++}-{4:4}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:873 [inline] filemap_fault+0x2e0/0x2820 mm/filemap.c:3332 __do_fault+0x10d/0x490 mm/memory.c:4907 do_read_fault mm/memory.c:5322 [inline] do_fault mm/memory.c:5456 [inline] do_pte_missing+0xebd/0x3e00 mm/memory.c:3979 handle_pte_fault mm/memory.c:5801 [inline] __handle_mm_fault+0x103c/0x2a40 mm/memory.c:5944 handle_mm_fault+0x3fa/0xaa0 mm/memory.c:6112 do_user_addr_fault+0x60d/0x13f0 arch/x86/mm/fault.c:1338 handle_page_fault arch/x86/mm/fault.c:1481 [inline] exc_page_fault+0x5c/0xc0 arch/x86/mm/fault.c:1539 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623 -> #7 (&vma->vm_lock->lock){++++}-{4:4}: down_write+0x93/0x200 kernel/locking/rwsem.c:1577 vma_start_write include/linux/mm.h:769 [inline] vma_link+0x26d/0x4a0 mm/vma.c:1691 insert_vm_struct+0x197/0x3f0 mm/mmap.c:1740 __bprm_mm_init fs/exec.c:289 [inline] bprm_mm_init fs/exec.c:393 [inline] alloc_bprm+0x6e0/0xc90 fs/exec.c:1544 kernel_execve+0xb0/0x3b0 fs/exec.c:1974 try_to_run_init_process init/main.c:1394 [inline] kernel_init+0x14a/0x2b0 init/main.c:1522 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #6 (&mm->mmap_lock){++++}-{4:4}: __might_fault mm/memory.c:6751 [inline] __might_fault+0x11b/0x190 mm/memory.c:6744 _inline_copy_from_user include/linux/uaccess.h:162 [inline] _copy_from_user+0x29/0xd0 lib/usercopy.c:18 copy_from_user include/linux/uaccess.h:212 [inline] __blk_trace_setup+0xa8/0x180 kernel/trace/blktrace.c:626 blk_trace_ioctl+0x163/0x290 kernel/trace/blktrace.c:740 blkdev_ioctl+0x109/0x6d0 block/ioctl.c:682 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #5 (&q->debugfs_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 blk_mq_init_sched+0x42b/0x640 block/blk-mq-sched.c:473 elevator_init_mq+0x2cd/0x420 block/elevator.c:610 add_disk_fwnode+0x113/0x1300 block/genhd.c:413 sd_probe+0xa86/0x1000 drivers/scsi/sd.c:4024 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x241/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x15a/0x1e0 drivers/base/bus.c:459 __device_attach_async_helper+0x1d3/0x290 drivers/base/dd.c:987 async_run_entry_fn+0x9f/0x530 kernel/async.c:129 process_one_work+0x9c8/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #4 (&q->q_usage_counter(queue)#50){++++}-{0:0}: blk_queue_enter+0x50f/0x640 block/blk-core.c:328 blk_mq_alloc_request+0x59b/0x950 block/blk-mq.c:652 scsi_alloc_request drivers/scsi/scsi_lib.c:1222 [inline] scsi_execute_cmd+0x1eb/0xf40 drivers/scsi/scsi_lib.c:304 read_capacity_16+0x213/0xe10 drivers/scsi/sd.c:2655 sd_read_capacity drivers/scsi/sd.c:2824 [inline] sd_revalidate_disk.isra.0+0x1a06/0xa8d0 drivers/scsi/sd.c:3734 sd_probe+0x904/0x1000 drivers/scsi/sd.c:4010 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x241/0xa90 drivers/base/dd.c:658 __driver_probe_device+0x1de/0x440 drivers/base/dd.c:800 driver_probe_device+0x4c/0x1b0 drivers/base/dd.c:830 __device_attach_driver+0x1df/0x310 drivers/base/dd.c:958 bus_for_each_drv+0x15a/0x1e0 drivers/base/bus.c:459 __device_attach_async_helper+0x1d3/0x290 drivers/base/dd.c:987 async_run_entry_fn+0x9f/0x530 kernel/async.c:129 process_one_work+0x9c8/0x1ba0 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #3 (&q->limits_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 queue_limits_start_update include/linux/blkdev.h:947 [inline] loop_reconfigure_limits+0x407/0x8c0 drivers/block/loop.c:998 loop_set_block_size drivers/block/loop.c:1473 [inline] lo_simple_ioctl drivers/block/loop.c:1496 [inline] lo_ioctl+0x901/0x18b0 drivers/block/loop.c:1559 blkdev_ioctl+0x279/0x6d0 block/ioctl.c:693 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:906 [inline] __se_sys_ioctl fs/ioctl.c:892 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:892 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (&q->q_usage_counter(io)#23){++++}-{0:0}: bio_queue_enter block/blk.h:75 [inline] blk_mq_submit_bio+0x1fb6/0x24c0 block/blk-mq.c:3090 __submit_bio+0x384/0x540 block/blk-core.c:629 __submit_bio_noacct_mq block/blk-core.c:710 [inline] submit_bio_noacct_nocheck+0x698/0xd70 block/blk-core.c:739 submit_bio_noacct+0x93a/0x1e20 block/blk-core.c:868 __ext4_read_bh fs/ext4/super.c:181 [inline] ext4_read_bh+0x19d/0x310 fs/ext4/super.c:206 ext4_read_bh_lock+0x80/0xd0 fs/ext4/super.c:221 ext4_bread+0x130/0x190 fs/ext4/inode.c:918 ext4_quota_read+0x1c0/0x310 fs/ext4/super.c:7239 find_tree_dqentry+0xb3/0xb40 fs/quota/quota_tree.c:671 find_tree_dqentry+0x58e/0xb40 fs/quota/quota_tree.c:698 find_tree_dqentry+0x58e/0xb40 fs/quota/quota_tree.c:698 find_tree_dqentry+0x58e/0xb40 fs/quota/quota_tree.c:698 find_dqentry fs/quota/quota_tree.c:716 [inline] qtree_read_dquot+0x46a/0x8a0 fs/quota/quota_tree.c:736 v2_read_dquot+0x163/0x210 fs/quota/quota_v2.c:344 dquot_acquire+0x1bb/0x6f0 fs/quota/dquot.c:461 ext4_acquire_dquot+0x27f/0x4e0 fs/ext4/super.c:6934 dqget+0x694/0x1160 fs/quota/dquot.c:977 __dquot_initialize+0x588/0xd50 fs/quota/dquot.c:1505 ext4_rmdir+0x139/0xf30 fs/ext4/namei.c:3159 vfs_rmdir fs/namei.c:4394 [inline] vfs_rmdir+0x206/0x690 fs/namei.c:4371 do_rmdir+0x3a2/0x410 fs/namei.c:4453 __do_sys_unlinkat fs/namei.c:4629 [inline] __se_sys_unlinkat fs/namei.c:4623 [inline] __x64_sys_unlinkat+0xef/0x130 fs/namei.c:4623 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&s->s_dquot.dqio_sem){++++}-{4:4}: down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 v2_read_dquot+0x58/0x210 fs/quota/quota_v2.c:342 dquot_acquire+0x1bb/0x6f0 fs/quota/dquot.c:461 ext4_acquire_dquot+0x27f/0x4e0 fs/ext4/super.c:6934 dqget+0x694/0x1160 fs/quota/dquot.c:977 __dquot_initialize+0x588/0xd50 fs/quota/dquot.c:1505 ext4_set_acl+0x16d/0x5a0 fs/ext4/acl.c:238 set_posix_acl+0x25f/0x320 fs/posix_acl.c:954 vfs_set_acl+0x5a7/0x930 fs/posix_acl.c:1133 do_set_acl+0xd9/0x1a0 fs/posix_acl.c:1278 do_setxattr+0xe7/0x170 fs/xattr.c:633 filename_setxattr+0x16d/0x1d0 fs/xattr.c:665 path_setxattrat+0x1e0/0x290 fs/xattr.c:713 __do_sys_lsetxattr fs/xattr.c:754 [inline] __se_sys_lsetxattr fs/xattr.c:750 [inline] __x64_sys_lsetxattr+0xc9/0x140 fs/xattr.c:750 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (&dquot->dq_lock){+.+.}-{4:4}: check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 wait_on_dquot fs/quota/dquot.c:354 [inline] dqget+0x5f2/0x1160 fs/quota/dquot.c:972 __dquot_initialize+0x588/0xd50 fs/quota/dquot.c:1505 __ext4_new_inode+0x6bf/0x4f20 fs/ext4/ialloc.c:992 ext4_xattr_inode_create fs/ext4/xattr.c:1486 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1596 [inline] ext4_xattr_inode_lookup_create+0xaf8/0x1aa0 fs/ext4/xattr.c:1574 ext4_xattr_block_set+0x782/0x3170 fs/ext4/xattr.c:1916 ext4_xattr_set_handle+0xd73/0x1420 fs/ext4/xattr.c:2458 ext4_xattr_set+0x14b/0x360 fs/ext4/xattr.c:2560 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x142/0x170 fs/xattr.c:636 filename_setxattr+0x16d/0x1d0 fs/xattr.c:665 path_setxattrat+0x1e0/0x290 fs/xattr.c:713 __do_sys_setxattr fs/xattr.c:747 [inline] __se_sys_setxattr fs/xattr.c:743 [inline] __x64_sys_setxattr+0xc6/0x140 fs/xattr.c:743 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: &dquot->dq_lock --> mapping.invalidate_lock --> &ei->xattr_sem Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->xattr_sem); lock(mapping.invalidate_lock); lock(&ei->xattr_sem); lock(&dquot->dq_lock); *** DEADLOCK *** 3 locks held by syz.8.5139/19370: #0: ffff888012746420 (sb_writers#4){.+.+}-{0:0}, at: filename_setxattr+0xbc/0x1d0 fs/xattr.c:663 #1: ffff888057c03f68 (&type->i_mutex_dir_key#3){++++}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #1: ffff888057c03f68 (&type->i_mutex_dir_key#3){++++}-{4:4}, at: vfs_setxattr+0x123/0x360 fs/xattr.c:320 #2: ffff888057c03c38 (&ei->xattr_sem){++++}-{4:4}, at: ext4_write_lock_xattr fs/ext4/xattr.h:154 [inline] #2: ffff888057c03c38 (&ei->xattr_sem){++++}-{4:4}, at: ext4_xattr_set_handle+0x159/0x1420 fs/ext4/xattr.c:2373 stack backtrace: CPU: 0 UID: 0 PID: 19370 Comm: syz.8.5139 Not tainted 6.13.0-rc3-syzkaller-00062-gc061cf420ded #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/25/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_circular_bug+0x419/0x5d0 kernel/locking/lockdep.c:2074 check_noncircular+0x31a/0x400 kernel/locking/lockdep.c:2206 check_prev_add kernel/locking/lockdep.c:3161 [inline] check_prevs_add kernel/locking/lockdep.c:3280 [inline] validate_chain kernel/locking/lockdep.c:3904 [inline] __lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5226 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5849 __mutex_lock_common kernel/locking/mutex.c:585 [inline] __mutex_lock+0x19b/0xa60 kernel/locking/mutex.c:735 wait_on_dquot fs/quota/dquot.c:354 [inline] dqget+0x5f2/0x1160 fs/quota/dquot.c:972 __dquot_initialize+0x588/0xd50 fs/quota/dquot.c:1505 __ext4_new_inode+0x6bf/0x4f20 fs/ext4/ialloc.c:992 ext4_xattr_inode_create fs/ext4/xattr.c:1486 [inline] ext4_xattr_inode_lookup_create fs/ext4/xattr.c:1596 [inline] ext4_xattr_inode_lookup_create+0xaf8/0x1aa0 fs/ext4/xattr.c:1574 ext4_xattr_block_set+0x782/0x3170 fs/ext4/xattr.c:1916 ext4_xattr_set_handle+0xd73/0x1420 fs/ext4/xattr.c:2458 ext4_xattr_set+0x14b/0x360 fs/ext4/xattr.c:2560 __vfs_setxattr+0x176/0x1e0 fs/xattr.c:200 __vfs_setxattr_noperm+0x127/0x660 fs/xattr.c:234 __vfs_setxattr_locked+0x182/0x260 fs/xattr.c:295 vfs_setxattr+0x146/0x360 fs/xattr.c:321 do_setxattr+0x142/0x170 fs/xattr.c:636 filename_setxattr+0x16d/0x1d0 fs/xattr.c:665 path_setxattrat+0x1e0/0x290 fs/xattr.c:713 __do_sys_setxattr fs/xattr.c:747 [inline] __se_sys_setxattr fs/xattr.c:743 [inline] __x64_sys_setxattr+0xc6/0x140 fs/xattr.c:743 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2b7c985d29 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2b7d84f038 EFLAGS: 00000246 ORIG_RAX: 00000000000000bc RAX: ffffffffffffffda RBX: 00007f2b7cb75fa0 RCX: 00007f2b7c985d29 RDX: 00000000200003c0 RSI: 0000000020000380 RDI: 0000000020000040 RBP: 00007f2b7ca01a20 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000f000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f2b7cb75fa0 R15: 00007ffc5bae6018