======================================================== WARNING: possible irq lock inversion dependency detected syzkaller #0 Not tainted -------------------------------------------------------- pr/ttyS0/30 just changed the state of lock: ffff8881191300d8 (&sd->lock){..-.}-{3:3}, at: sensor_hub_raw_event+0x124/0x1340 drivers/hid/hid-sensor-hub.c:550 but this lock took another, SOFTIRQ-unsafe lock in the past: (&k->k_lock){+.+.}-{3:3} and interrupts could create inverse lock ordering between them. other info that might help us debug this: Possible interrupt unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&k->k_lock); local_irq_disable(); lock(&sd->lock); lock(&k->k_lock); lock(&sd->lock); *** DEADLOCK *** locks held by pr/ttyS0/30: 1, last CPU#0: #0: ffffffff898d3958 (console_srcu){....}-{0:0}, at: rcu_try_lock_acquire include/linux/rcupdate.h:314 [inline] #0: ffffffff898d3958 (console_srcu){....}-{0:0}, at: srcu_read_lock_nmisafe include/linux/srcu.h:493 [inline] #0: ffffffff898d3958 (console_srcu){....}-{0:0}, at: console_srcu_read_lock+0x49/0x60 kernel/printk/printk.c:291 the shortest dependencies between 2nd lock and 1st lock: -> (&k->k_lock){+.+.}-{3:3} { HARDIRQ-ON-W at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock include/linux/spinlock_api_smp.h:190 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:173 spin_lock include/linux/spinlock.h:347 [inline] add_tail lib/klist.c:104 [inline] klist_add_tail+0x38/0x150 lib/klist.c:138 bus_add_driver+0x306/0x620 drivers/base/bus.c:780 driver_register+0x1e2/0x360 drivers/base/driver.c:174 faux_bus_init+0x6e/0xc0 drivers/base/faux.c:249 driver_init+0x33/0x60 drivers/base/init.c:35 do_basic_setup init/main.c:1514 [inline] kernel_init_freeable+0x473/0x7b0 init/main.c:1732 kernel_init+0x21/0x1e0 init/main.c:1622 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 SOFTIRQ-ON-W at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock include/linux/spinlock_api_smp.h:190 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:173 spin_lock include/linux/spinlock.h:347 [inline] add_tail lib/klist.c:104 [inline] klist_add_tail+0x38/0x150 lib/klist.c:138 bus_add_driver+0x306/0x620 drivers/base/bus.c:780 driver_register+0x1e2/0x360 drivers/base/driver.c:174 faux_bus_init+0x6e/0xc0 drivers/base/faux.c:249 driver_init+0x33/0x60 drivers/base/init.c:35 do_basic_setup init/main.c:1514 [inline] kernel_init_freeable+0x473/0x7b0 init/main.c:1732 kernel_init+0x21/0x1e0 init/main.c:1622 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock include/linux/spinlock_api_smp.h:190 [inline] _raw_spin_lock+0x2e/0x40 kernel/locking/spinlock.c:173 spin_lock include/linux/spinlock.h:347 [inline] add_tail lib/klist.c:104 [inline] klist_add_tail+0x38/0x150 lib/klist.c:138 bus_add_driver+0x306/0x620 drivers/base/bus.c:780 driver_register+0x1e2/0x360 drivers/base/driver.c:174 faux_bus_init+0x6e/0xc0 drivers/base/faux.c:249 driver_init+0x33/0x60 drivers/base/init.c:35 do_basic_setup init/main.c:1514 [inline] kernel_init_freeable+0x473/0x7b0 init/main.c:1732 kernel_init+0x21/0x1e0 init/main.c:1622 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 } ... key at: [] __key.0+0x0/0x40 ... acquired at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 klist_next+0x86/0x510 lib/klist.c:390 next_device drivers/base/core.c:4028 [inline] device_for_each_child+0xdb/0x1a0 drivers/base/core.c:4106 sensor_hub_remove+0x7d/0xf0 drivers/hid/hid-sensor-hub.c:824 hid_device_remove+0xd1/0x200 drivers/hid/hid-core.c:2897 device_remove+0xcb/0x180 drivers/base/dd.c:617 __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678 device_del+0x376/0x9b0 drivers/base/core.c:3967 hid_remove_device drivers/hid/hid-core.c:3126 [inline] hid_destroy_device+0x19c/0x240 drivers/hid/hid-core.c:3148 usbhid_disconnect+0xa0/0xe0 drivers/hid/usbhid/hid-core.c:1486 usb_unbind_interface+0x1dd/0x9b0 drivers/usb/core/driver.c:460 device_remove drivers/base/dd.c:619 [inline] device_remove+0x12a/0x180 drivers/base/dd.c:611 __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678 device_del+0x376/0x9b0 drivers/base/core.c:3967 usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1484 usb_disconnect+0x2e2/0x9a0 drivers/usb/core/hub.c:2355 hub_port_connect drivers/usb/core/hub.c:5425 [inline] hub_port_connect_change drivers/usb/core/hub.c:5725 [inline] port_event drivers/usb/core/hub.c:5889 [inline] hub_event+0x1d46/0x4510 drivers/usb/core/hub.c:5971 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> (&sd->lock){..-.}-{3:3} { IN-SOFTIRQ-W at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 sensor_hub_raw_event+0x124/0x1340 drivers/hid/hid-sensor-hub.c:550 __hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2175 hid_ctrl+0x4a4/0x560 drivers/hid/usbhid/hid-core.c:486 __usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657 usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741 dummy_timer+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051 __run_hrtimer kernel/time/hrtimer.c:2079 [inline] __hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2136 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2153 handle_softirqs+0x209/0xa00 kernel/softirq.c:669 __do_softirq kernel/softirq.c:703 [inline] invoke_softirq kernel/softirq.c:542 [inline] __irq_exit_rcu+0x17a/0x220 kernel/softirq.c:786 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:210 [inline] _raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:221 nbcon_emit_one+0x15c/0x2b0 kernel/printk/nbcon.c:1165 nbcon_kthread_func+0x5ef/0x7f0 kernel/printk/nbcon.c:1271 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 INITIAL USE at: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 sensor_hub_remove+0x69/0xf0 drivers/hid/hid-sensor-hub.c:823 hid_device_remove+0xd1/0x200 drivers/hid/hid-core.c:2897 device_remove+0xcb/0x180 drivers/base/dd.c:617 __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678 device_del+0x376/0x9b0 drivers/base/core.c:3967 hid_remove_device drivers/hid/hid-core.c:3126 [inline] hid_destroy_device+0x19c/0x240 drivers/hid/hid-core.c:3148 usbhid_disconnect+0xa0/0xe0 drivers/hid/usbhid/hid-core.c:1486 usb_unbind_interface+0x1dd/0x9b0 drivers/usb/core/driver.c:460 device_remove drivers/base/dd.c:619 [inline] device_remove+0x12a/0x180 drivers/base/dd.c:611 __device_release_driver drivers/base/dd.c:1357 [inline] device_release_driver_internal+0x441/0x610 drivers/base/dd.c:1380 bus_remove_device+0x2bc/0x560 drivers/base/bus.c:678 device_del+0x376/0x9b0 drivers/base/core.c:3967 usb_disable_device+0x367/0x810 drivers/usb/core/message.c:1484 usb_disconnect+0x2e2/0x9a0 drivers/usb/core/hub.c:2355 hub_port_connect drivers/usb/core/hub.c:5425 [inline] hub_port_connect_change drivers/usb/core/hub.c:5725 [inline] port_event drivers/usb/core/hub.c:5889 [inline] hub_event+0x1d46/0x4510 drivers/usb/core/hub.c:5971 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3495 process_scheduled_works kernel/workqueue.c:3578 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3659 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 } ... key at: [] __key.104+0x0/0x40 ... acquired at: mark_usage kernel/locking/lockdep.c:4686 [inline] __lock_acquire+0x7f1/0x1f40 kernel/locking/lockdep.c:5242 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 sensor_hub_raw_event+0x124/0x1340 drivers/hid/hid-sensor-hub.c:550 __hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2175 hid_ctrl+0x4a4/0x560 drivers/hid/usbhid/hid-core.c:486 __usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657 usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741 dummy_timer+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051 __run_hrtimer kernel/time/hrtimer.c:2079 [inline] __hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2136 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2153 handle_softirqs+0x209/0xa00 kernel/softirq.c:669 __do_softirq kernel/softirq.c:703 [inline] invoke_softirq kernel/softirq.c:542 [inline] __irq_exit_rcu+0x17a/0x220 kernel/softirq.c:786 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:210 [inline] _raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:221 nbcon_emit_one+0x15c/0x2b0 kernel/printk/nbcon.c:1165 nbcon_kthread_func+0x5ef/0x7f0 kernel/printk/nbcon.c:1271 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 stack backtrace: CPU: 0 UID: 0 PID: 30 Comm: pr/ttyS0 Not tainted syzkaller #0 PREEMPT(lazy) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_irq_inversion_bug.part.0.cold+0x11b/0x13a kernel/locking/lockdep.c:4169 print_irq_inversion_bug kernel/locking/lockdep.c:4120 [inline] check_usage_forwards kernel/locking/lockdep.c:4202 [inline] mark_lock_irq kernel/locking/lockdep.c:4338 [inline] mark_lock+0x7ff/0x1020 kernel/locking/lockdep.c:4797 mark_usage kernel/locking/lockdep.c:4686 [inline] __lock_acquire+0x7f1/0x1f40 kernel/locking/lockdep.c:5242 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:155 [inline] _raw_spin_lock_irqsave+0x3a/0x60 kernel/locking/spinlock.c:181 sensor_hub_raw_event+0x124/0x1340 drivers/hid/hid-sensor-hub.c:550 __hid_input_report.constprop.0+0x319/0x470 drivers/hid/hid-core.c:2175 hid_ctrl+0x4a4/0x560 drivers/hid/usbhid/hid-core.c:486 __usb_hcd_giveback_urb+0x38e/0x610 drivers/usb/core/hcd.c:1657 usb_hcd_giveback_urb+0x3ca/0x4a0 drivers/usb/core/hcd.c:1741 dummy_timer+0xdb5/0x3840 drivers/usb/gadget/udc/dummy_hcd.c:2051 __run_hrtimer kernel/time/hrtimer.c:2079 [inline] __hrtimer_run_queues+0x448/0x9a0 kernel/time/hrtimer.c:2136 hrtimer_run_softirq+0x1ca/0x360 kernel/time/hrtimer.c:2153 handle_softirqs+0x209/0xa00 kernel/softirq.c:669 __do_softirq kernel/softirq.c:703 [inline] invoke_softirq kernel/softirq.c:542 [inline] __irq_exit_rcu+0x17a/0x220 kernel/softirq.c:786 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x8f/0xb0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:211 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x31/0x80 kernel/locking/spinlock.c:221 Code: f5 53 48 8b 74 24 10 48 89 fb 48 83 c7 18 e8 16 b9 f4 f9 48 89 df e8 9e 0f f5 f9 f7 c5 00 02 00 00 75 23 9c 58 f6 c4 02 75 37 01 00 00 00 e8 e5 40 e7 f9 65 48 83 3d 54 37 8e 05 00 74 16 5b RSP: 0018:ffffc90000207cb0 EFLAGS: 00000246 RAX: 0000000000000002 RBX: ffffffff94511ca0 RCX: 0000000000000000 RDX: 0000000000000001 RSI: ffffffff89306960 RDI: ffffffff87d36a00 RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 205d323330365420 R12: 1ffff92000040f99 R13: ffffffff89ed3440 R14: 0000000000000001 R15: dffffc0000000000 nbcon_emit_one+0x15c/0x2b0 kernel/printk/nbcon.c:1165 nbcon_kthread_func+0x5ef/0x7f0 kernel/printk/nbcon.c:1271 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x69f/0xc90 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 ---------------- Code disassembly (best guess): 0: f5 cmc 1: 53 push %rbx 2: 48 8b 74 24 10 mov 0x10(%rsp),%rsi 7: 48 89 fb mov %rdi,%rbx a: 48 83 c7 18 add $0x18,%rdi e: e8 16 b9 f4 f9 call 0xf9f4b929 13: 48 89 df mov %rbx,%rdi 16: e8 9e 0f f5 f9 call 0xf9f50fb9 1b: f7 c5 00 02 00 00 test $0x200,%ebp 21: 75 23 jne 0x46 23: 9c pushf 24: 58 pop %rax 25: f6 c4 02 test $0x2,%ah 28: 75 37 jne 0x61 * 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction 2f: e8 e5 40 e7 f9 call 0xf9e74119 34: 65 48 83 3d 54 37 8e cmpq $0x0,%gs:0x58e3754(%rip) # 0x58e3791 3b: 05 00 3d: 74 16 je 0x55 3f: 5b pop %rbx