================================ WARNING: inconsistent lock state 6.0.0-rc6-syzkaller-00321-g105a36f3694e-dirty #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. swapper/1/0 [HC0[0]:SC1[1]:HE0:SE0] takes: ffffffff8c0be7e0 (fs_reclaim){+.?.}-{0:0}, at: might_alloc include/linux/sched/mm.h:273 [inline] ffffffff8c0be7e0 (fs_reclaim){+.?.}-{0:0}, at: slab_pre_alloc_hook.constprop.0+0x19d/0x580 mm/slab.h:700 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __fs_reclaim_acquire mm/page_alloc.c:4674 [inline] fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4688 dma_resv_lockdep+0x342/0x545 drivers/dma-buf/dma-resv.c:753 do_one_initcall+0xfe/0x650 init/main.c:1296 do_initcall_level init/main.c:1369 [inline] do_initcalls init/main.c:1385 [inline] do_basic_setup init/main.c:1404 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1623 kernel_init+0x1a/0x1d0 init/main.c:1512 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 irq event stamp: 330269 hardirqs last enabled at (330268): [] kfree+0x25b/0x390 mm/slab.c:3787 hardirqs last disabled at (330269): [] might_alloc include/linux/sched/mm.h:272 [inline] hardirqs last disabled at (330269): [] slab_pre_alloc_hook.constprop.0+0x196/0x580 mm/slab.h:700 softirqs last enabled at (330252): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (330252): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 softirqs last disabled at (330265): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (330265): [] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(fs_reclaim); lock(fs_reclaim); *** DEADLOCK *** 1 lock held by swapper/1/0: #0: ffffffff91228508 (&fsnotify_mark_srcu){....}-{0:0}, at: fsnotify+0x2f4/0x1680 fs/notify/fsnotify.c:544 stack backtrace: CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.0.0-rc6-syzkaller-00321-g105a36f3694e-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_usage_bug kernel/locking/lockdep.c:3961 [inline] valid_state kernel/locking/lockdep.c:3973 [inline] mark_lock_irq kernel/locking/lockdep.c:4176 [inline] mark_lock.part.0.cold+0x18/0xd8 kernel/locking/lockdep.c:4632 mark_lock kernel/locking/lockdep.c:4596 [inline] mark_usage kernel/locking/lockdep.c:4527 [inline] __lock_acquire+0x11d9/0x56d0 kernel/locking/lockdep.c:5007 lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __fs_reclaim_acquire mm/page_alloc.c:4674 [inline] fs_reclaim_acquire+0x115/0x160 mm/page_alloc.c:4688 might_alloc include/linux/sched/mm.h:273 [inline] slab_pre_alloc_hook.constprop.0+0x19d/0x580 mm/slab.h:700 slab_alloc mm/slab.c:3278 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc+0x4e/0x3b0 mm/slab.c:3491 fanotify_alloc_fid_event fs/notify/fanotify/fanotify.c:580 [inline] fanotify_alloc_event fs/notify/fanotify/fanotify.c:813 [inline] fanotify_handle_event+0x1130/0x3f40 fs/notify/fanotify/fanotify.c:948 send_to_group fs/notify/fsnotify.c:360 [inline] fsnotify+0xafb/0x1680 fs/notify/fsnotify.c:570 __fsnotify_parent+0x62f/0xa60 fs/notify/fsnotify.c:230 fsnotify_parent include/linux/fsnotify.h:77 [inline] fsnotify_file include/linux/fsnotify.h:99 [inline] fsnotify_access include/linux/fsnotify.h:309 [inline] __io_complete_rw_common+0x485/0x720 io_uring/rw.c:195 io_complete_rw+0x1a/0x1f0 io_uring/rw.c:228 iomap_dio_complete_work fs/iomap/direct-io.c:144 [inline] iomap_dio_bio_end_io+0x438/0x5e0 fs/iomap/direct-io.c:178 bio_endio+0x5f9/0x780 block/bio.c:1564 req_bio_endio block/blk-mq.c:695 [inline] blk_update_request+0x3fc/0x1300 block/blk-mq.c:825 scsi_end_request+0x7a/0x9a0 drivers/scsi/scsi_lib.c:541 scsi_io_completion+0x173/0x1f70 drivers/scsi/scsi_lib.c:971 scsi_complete+0x122/0x3b0 drivers/scsi/scsi_lib.c:1438 blk_complete_reqs+0xad/0xe0 block/blk-mq.c:1022 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 common_interrupt+0xa9/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:640 RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline] RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline] RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline] RIP: 0010:acpi_safe_halt+0x6f/0xb0 drivers/acpi/processor_idle.c:113 Code: f7 84 db 74 06 5b e9 90 08 f8 f7 e8 8b 08 f8 f7 e8 e6 7f fe f7 66 90 e8 7f 08 f8 f7 0f 00 2d c8 85 d1 00 e8 73 08 f8 f7 fb f4 <9c> 5b 81 e3 00 02 00 00 fa 31 ff 48 89 de e8 3e 05 f8 f7 48 85 db RSP: 0018:ffffc9000038fd20 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff8880121f0200 RSI: ffffffff8983319d RDI: 0000000000000000 RBP: ffff888145a07864 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: 0000000000000001 R14: ffff888145a07800 R15: ffff88801c0f6804 acpi_idle_do_entry drivers/acpi/processor_idle.c:555 [inline] acpi_idle_enter+0x524/0x6a0 drivers/acpi/processor_idle.c:692 cpuidle_enter_state+0x1ab/0xd30 drivers/cpuidle/cpuidle.c:239 cpuidle_enter+0x4a/0xa0 drivers/cpuidle/cpuidle.c:356 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x3e8/0x590 kernel/sched/idle.c:303 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:400 start_secondary+0x21d/0x2b0 arch/x86/kernel/smpboot.c:262 secondary_startup_64_no_verify+0xce/0xdb BUG: sleeping function called from invalid context at include/linux/sched/mm.h:277 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 0, name: swapper/1 preempt_count: 101, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. Preemption disabled at: [<0000000000000000>] 0x0 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 6.0.0-rc6-syzkaller-00321-g105a36f3694e-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 __might_resched.cold+0x222/0x26b kernel/sched/core.c:9892 might_alloc include/linux/sched/mm.h:277 [inline] slab_pre_alloc_hook.constprop.0+0x175/0x580 mm/slab.h:700 slab_alloc mm/slab.c:3278 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc+0x4e/0x3b0 mm/slab.c:3491 fanotify_alloc_fid_event fs/notify/fanotify/fanotify.c:580 [inline] fanotify_alloc_event fs/notify/fanotify/fanotify.c:813 [inline] fanotify_handle_event+0x1130/0x3f40 fs/notify/fanotify/fanotify.c:948 send_to_group fs/notify/fsnotify.c:360 [inline] fsnotify+0xafb/0x1680 fs/notify/fsnotify.c:570 __fsnotify_parent+0x62f/0xa60 fs/notify/fsnotify.c:230 fsnotify_parent include/linux/fsnotify.h:77 [inline] fsnotify_file include/linux/fsnotify.h:99 [inline] fsnotify_access include/linux/fsnotify.h:309 [inline] __io_complete_rw_common+0x485/0x720 io_uring/rw.c:195 io_complete_rw+0x1a/0x1f0 io_uring/rw.c:228 iomap_dio_complete_work fs/iomap/direct-io.c:144 [inline] iomap_dio_bio_end_io+0x438/0x5e0 fs/iomap/direct-io.c:178 bio_endio+0x5f9/0x780 block/bio.c:1564 req_bio_endio block/blk-mq.c:695 [inline] blk_update_request+0x3fc/0x1300 block/blk-mq.c:825 scsi_end_request+0x7a/0x9a0 drivers/scsi/scsi_lib.c:541 scsi_io_completion+0x173/0x1f70 drivers/scsi/scsi_lib.c:971 scsi_complete+0x122/0x3b0 drivers/scsi/scsi_lib.c:1438 blk_complete_reqs+0xad/0xe0 block/blk-mq.c:1022 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 common_interrupt+0xa9/0xc0 arch/x86/kernel/irq.c:240 asm_common_interrupt+0x22/0x40 arch/x86/include/asm/idtentry.h:640 RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline] RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline] RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline] RIP: 0010:acpi_safe_halt+0x6f/0xb0 drivers/acpi/processor_idle.c:113 Code: f7 84 db 74 06 5b e9 90 08 f8 f7 e8 8b 08 f8 f7 e8 e6 7f fe f7 66 90 e8 7f 08 f8 f7 0f 00 2d c8 85 d1 00 e8 73 08 f8 f7 fb f4 <9c> 5b 81 e3 00 02 00 00 fa 31 ff 48 89 de e8 3e 05 f8 f7 48 85 db RSP: 0018:ffffc9000038fd20 EFLAGS: 00000293 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff8880121f0200 RSI: ffffffff8983319d RDI: 0000000000000000 RBP: ffff888145a07864 R08: 0000000000000001 R09: 0000000000000001 R10: 0000000000000000 R11: 0000000000000001 R12: 0000000000000001 R13: 0000000000000001 R14: ffff888145a07800 R15: ffff88801c0f6804 acpi_idle_do_entry drivers/acpi/processor_idle.c:555 [inline] acpi_idle_enter+0x524/0x6a0 drivers/acpi/processor_idle.c:692 cpuidle_enter_state+0x1ab/0xd30 drivers/cpuidle/cpuidle.c:239 cpuidle_enter+0x4a/0xa0 drivers/cpuidle/cpuidle.c:356 call_cpuidle kernel/sched/idle.c:155 [inline] cpuidle_idle_call kernel/sched/idle.c:236 [inline] do_idle+0x3e8/0x590 kernel/sched/idle.c:303 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:400 start_secondary+0x21d/0x2b0 arch/x86/kernel/smpboot.c:262 secondary_startup_64_no_verify+0xce/0xdb ---------------- Code disassembly (best guess): 0: f7 84 db 74 06 5b e9 testl $0xf7f80890,-0x16a4f98c(%rbx,%rbx,8) 7: 90 08 f8 f7 b: e8 8b 08 f8 f7 callq 0xf7f8089b 10: e8 e6 7f fe f7 callq 0xf7fe7ffb 15: 66 90 xchg %ax,%ax 17: e8 7f 08 f8 f7 callq 0xf7f8089b 1c: 0f 00 2d c8 85 d1 00 verw 0xd185c8(%rip) # 0xd185eb 23: e8 73 08 f8 f7 callq 0xf7f8089b 28: fb sti 29: f4 hlt * 2a: 9c pushfq <-- trapping instruction 2b: 5b pop %rbx 2c: 81 e3 00 02 00 00 and $0x200,%ebx 32: fa cli 33: 31 ff xor %edi,%edi 35: 48 89 de mov %rbx,%rsi 38: e8 3e 05 f8 f7 callq 0xf7f8057b 3d: 48 85 db test %rbx,%rbx