====================================================== WARNING: possible circular locking dependency detected 6.12.0-syzkaller-00971-g158f238aa69d #0 Not tainted ------------------------------------------------------ syz.1.231/6872 is trying to acquire lock: ffff8880427cfc40 (mapping.invalidate_lock#2){.+.+}-{3:3}, at: filemap_invalidate_lock_shared include/linux/fs.h:873 [inline] ffff8880427cfc40 (mapping.invalidate_lock#2){.+.+}-{3:3}, at: filemap_fault+0x2e2/0x2820 mm/filemap.c:3333 but task is already holding lock: ffff888022deb118 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] ffff888022deb118 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:6114 [inline] ffff888022deb118 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x6a0 mm/memory.c:6174 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #5 (&mm->mmap_lock){++++}-{3:3}: __might_fault mm/memory.c:6716 [inline] __might_fault+0x11b/0x190 mm/memory.c:6709 _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] compat_blk_trace_setup+0xc9/0x200 kernel/trace/blktrace.c:664 blk_trace_ioctl+0x24a/0x290 kernel/trace/blktrace.c:745 compat_blkdev_ioctl+0x13c/0x750 block/ioctl.c:742 __do_compat_sys_ioctl+0x1cb/0x2c0 fs/ioctl.c:1004 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #4 ( &q->debugfs_mutex){+.+.}-{3:3} : __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 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+0xa66/0xfa0 drivers/scsi/sd.c:4024 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/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+0x157/0x1e0 drivers/base/bus.c:459 __device_attach_async_helper+0x1d3/0x290 drivers/base/dd.c:987 async_run_entry_fn+0x9c/0x530 kernel/async.c:129 process_one_work+0x958/0x1b30 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #3 ( &q->q_usage_counter(queue)#51){++++}-{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+0x1f1/0xff0 drivers/scsi/scsi_lib.c:304 read_capacity_16+0x21a/0xe20 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+0x8ee/0xfa0 drivers/scsi/sd.c:4010 call_driver_probe drivers/base/dd.c:579 [inline] really_probe+0x23e/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+0x157/0x1e0 drivers/base/bus.c:459 __device_attach_async_helper+0x1d3/0x290 drivers/base/dd.c:987 async_run_entry_fn+0x9c/0x530 kernel/async.c:129 process_one_work+0x958/0x1b30 kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x6c8/0xf00 kernel/workqueue.c:3391 kthread+0x2c1/0x3a0 kernel/kthread.c:389 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 -> #2 (&q->limits_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x175/0x9c0 kernel/locking/mutex.c:752 queue_limits_start_update include/linux/blkdev.h:945 [inline] loop_reconfigure_limits+0x2da/0x8d0 drivers/block/loop.c:1003 loop_set_block_size drivers/block/loop.c:1473 [inline] lo_simple_ioctl drivers/block/loop.c:1496 [inline] lo_ioctl+0x8f4/0x18a0 drivers/block/loop.c:1559 lo_compat_ioctl+0xb9/0x170 drivers/block/loop.c:1692 compat_blkdev_ioctl+0x2f7/0x750 block/ioctl.c:749 __do_compat_sys_ioctl+0x1cb/0x2c0 fs/ioctl.c:1004 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #1 (&q->q_usage_counter(io)#24){++++}-{0:0}: bio_queue_enter block/blk.h:75 [inline] blk_mq_submit_bio+0x1fbe/0x24b0 block/blk-mq.c:3092 __submit_bio+0x384/0x540 block/blk-core.c:629 __submit_bio_noacct_mq block/blk-core.c:710 [inline] submit_bio_noacct_nocheck+0x6fb/0xd70 block/blk-core.c:739 submit_bio_noacct+0x93a/0x1e10 block/blk-core.c:868 mpage_bio_submit_read fs/mpage.c:75 [inline] mpage_readahead+0x41d/0x590 fs/mpage.c:377 read_pages+0x1a8/0xdc0 mm/readahead.c:160 page_cache_ra_unbounded+0x3c0/0x6c0 mm/readahead.c:290 do_page_cache_ra mm/readahead.c:320 [inline] page_cache_ra_order+0x7d9/0xc90 mm/readahead.c:520 page_cache_sync_ra+0x4b4/0x9c0 mm/readahead.c:608 page_cache_sync_readahead include/linux/pagemap.h:1394 [inline] filemap_get_pages+0xd7c/0x1be0 mm/filemap.c:2547 filemap_splice_read+0x5cc/0xd00 mm/filemap.c:2923 do_splice_read fs/splice.c:985 [inline] do_splice_read+0x282/0x370 fs/splice.c:959 splice_direct_to_actor+0x2a4/0xa40 fs/splice.c:1089 do_splice_direct_actor fs/splice.c:1207 [inline] do_splice_direct+0x178/0x250 fs/splice.c:1233 do_sendfile+0xaed/0xe30 fs/read_write.c:1363 __do_compat_sys_sendfile fs/read_write.c:1445 [inline] __se_compat_sys_sendfile fs/read_write.c:1428 [inline] __ia32_compat_sys_sendfile+0x1e7/0x230 fs/read_write.c:1428 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #0 (mapping.invalidate_lock#2){.+.+}-{3:3}: 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+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:873 [inline] filemap_fault+0x2e2/0x2820 mm/filemap.c:3333 __do_fault+0x10a/0x490 mm/memory.c:4882 do_read_fault mm/memory.c:5297 [inline] do_fault mm/memory.c:5431 [inline] do_pte_missing+0xec5/0x3e70 mm/memory.c:3965 handle_pte_fault mm/memory.c:5766 [inline] __handle_mm_fault+0x100a/0x2a10 mm/memory.c:5909 handle_mm_fault+0x3fa/0xaa0 mm/memory.c:6077 do_user_addr_fault+0x7a3/0x13f0 arch/x86/mm/fault.c:1389 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 __get_user_4+0x1a/0x30 arch/x86/lib/getuser.S:86 pppoe_ioctl+0x1df/0x610 drivers/net/ppp/pppoe.c:765 pppox_ioctl+0x119/0x280 drivers/net/ppp/pppox.c:93 compat_sock_ioctl+0x17b/0x7e0 net/socket.c:3515 __do_compat_sys_ioctl+0x1cb/0x2c0 fs/ioctl.c:1004 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: mapping.invalidate_lock#2 --> &q->debugfs_mutex --> &mm->mmap_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(&mm->mmap_lock); lock(&q->debugfs_mutex); lock(&mm->mmap_lock); rlock(mapping.invalidate_lock#2); *** DEADLOCK *** 2 locks held by syz.1.231/6872: #0: ffff8880647d6258 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: lock_sock include/net/sock.h:1611 [inline] #0: ffff8880647d6258 (sk_lock-AF_PPPOX){+.+.}-{0:0}, at: pppox_ioctl+0x48/0x280 drivers/net/ppp/pppox.c:73 #1: ffff888022deb118 (&mm->mmap_lock){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:163 [inline] #1: ffff888022deb118 (&mm->mmap_lock){++++}-{3:3}, at: get_mmap_lock_carefully mm/memory.c:6114 [inline] #1: ffff888022deb118 (&mm->mmap_lock){++++}-{3:3}, at: lock_mm_and_find_vma+0x35/0x6a0 mm/memory.c:6174 stack backtrace: CPU: 1 UID: 0 PID: 6872 Comm: syz.1.231 Not tainted 6.12.0-syzkaller-00971-g158f238aa69d #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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+0x250b/0x3ce0 kernel/locking/lockdep.c:5202 lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5825 down_read+0x9a/0x330 kernel/locking/rwsem.c:1524 filemap_invalidate_lock_shared include/linux/fs.h:873 [inline] filemap_fault+0x2e2/0x2820 mm/filemap.c:3333 __do_fault+0x10a/0x490 mm/memory.c:4882 do_read_fault mm/memory.c:5297 [inline] do_fault mm/memory.c:5431 [inline] do_pte_missing+0xec5/0x3e70 mm/memory.c:3965 handle_pte_fault mm/memory.c:5766 [inline] __handle_mm_fault+0x100a/0x2a10 mm/memory.c:5909 handle_mm_fault+0x3fa/0xaa0 mm/memory.c:6077 do_user_addr_fault+0x7a3/0x13f0 arch/x86/mm/fault.c:1389 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 RIP: 0010:__get_user_4+0x1a/0x30 arch/x86/lib/getuser.S:88 Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa 48 ba ff ef ff ff ff 7f 00 00 48 39 c2 48 19 d2 48 09 d0 0f 01 cb <8b> 10 31 c0 0f 01 ca c3 cc cc cc cc 66 2e 0f 1f 84 00 00 00 00 00 RSP: 0018:ffffc90007447d40 EFLAGS: 00050206 RAX: 0000000020000000 RBX: 0000000000000001 RCX: ffffc9000c001000 RDX: 0000000000000000 RSI: ffffffff866066f7 RDI: ffffffff8bb153e0 RBP: 0000000020000000 R08: 0000000000000000 R09: fffffbfff203acd1 R10: ffffffff901d668f R11: 00000000000a201e R12: ffff8880647d6000 R13: ffff8880647d6000 R14: 0000000000000000 R15: ffffffff86606520 pppoe_ioctl+0x1df/0x610 drivers/net/ppp/pppoe.c:765 pppox_ioctl+0x119/0x280 drivers/net/ppp/pppox.c:93 compat_sock_ioctl+0x17b/0x7e0 net/socket.c:3515 __do_compat_sys_ioctl+0x1cb/0x2c0 fs/ioctl.c:1004 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0x73/0x120 arch/x86/entry/common.c:386 do_fast_syscall_32+0x32/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf7fdf579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f574555c EFLAGS: 00000296 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 0000000040047452 RDX: 0000000020000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000296 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: 90 nop 1: 90 nop 2: 90 nop 3: 90 nop 4: 90 nop 5: 90 nop 6: 90 nop 7: 90 nop 8: 90 nop 9: 90 nop a: 90 nop b: 90 nop c: 90 nop d: 90 nop e: 90 nop f: 90 nop 10: f3 0f 1e fa endbr64 14: 48 ba ff ef ff ff ff movabs $0x7fffffffefff,%rdx 1b: 7f 00 00 1e: 48 39 c2 cmp %rax,%rdx 21: 48 19 d2 sbb %rdx,%rdx 24: 48 09 d0 or %rdx,%rax 27: 0f 01 cb stac * 2a: 8b 10 mov (%rax),%edx <-- trapping instruction 2c: 31 c0 xor %eax,%eax 2e: 0f 01 ca clac 31: c3 ret 32: cc int3 33: cc int3 34: cc int3 35: cc int3 36: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 3d: 00 00 00