microsoft 0003:045E:07DA.0005: hid_field_extract() called with n (128) > 32! (udevd) ================================================================================ UBSAN: shift-out-of-bounds in drivers/hid/hid-core.c:1323:20 shift exponent 127 is too large for 32-bit type 'int' CPU: 1 PID: 1178 Comm: udevd Not tainted 5.19.0-syzkaller-13666-gffcf9c5700e4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 ubsan_epilogue+0xb/0x50 lib/ubsan.c:151 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x187 lib/ubsan.c:322 snto32 drivers/hid/hid-core.c:1323 [inline] snto32.cold+0x19/0x48 drivers/hid/hid-core.c:1313 hid_input_fetch_field drivers/hid/hid-core.c:1572 [inline] hid_process_report drivers/hid/hid-core.c:1665 [inline] hid_report_raw_event+0x88b/0x1280 drivers/hid/hid-core.c:1998 hid_input_report+0x360/0x4c0 drivers/hid/hid-core.c:2065 hid_irq_in+0x50e/0x690 drivers/hid/usbhid/hid-core.c:284 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1671 usb_hcd_giveback_urb+0x380/0x430 drivers/usb/core/hcd.c:1754 dummy_timer+0x11ff/0x32c0 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1c0/0x9a9 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x113/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:core_kernel_text+0x49/0x90 kernel/extable.c:71 Code: ff 85 c0 41 89 c4 75 4c 48 c7 c0 84 5f de 88 48 ba 00 00 00 00 00 fc ff df 48 89 c1 83 e0 07 48 c1 e9 03 83 c0 03 0f b6 14 11 <38> d0 7c 04 84 d2 75 2f 83 3d 9c 30 c1 07 01 76 07 44 89 e0 5b 41 RSP: 0018:ffffc90000577528 EFLAGS: 00000202 RAX: 0000000000000007 RBX: 00007f4976c48003 RCX: 1ffffffff11bcbf0 RDX: 0000000000000000 RSI: ffffffff8100716c RDI: 0000000000000007 RBP: 00007f4976c48003 R08: 0000000000000007 R09: ffffffffff600000 R10: 00007f4976c48000 R11: 0000000000052040 R12: 0000000000000000 R13: 0000000000000000 R14: ffff8881132a5580 R15: ffffea0004df1200 kernel_text_address+0xd/0x60 kernel/extable.c:99 __kernel_text_address+0x9/0x30 kernel/extable.c:79 unwind_get_return_address arch/x86/kernel/unwind_orc.c:318 [inline] unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:313 arch_stack_walk+0x93/0xe0 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x14a/0x1b0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook mm/slub.c:1780 [inline] slab_free mm/slub.c:3534 [inline] kfree+0xca/0x5c0 mm/slub.c:4562 skb_free_head net/core/skbuff.c:658 [inline] skb_release_data+0x6b3/0x7f0 net/core/skbuff.c:687 skb_release_all net/core/skbuff.c:752 [inline] __kfree_skb net/core/skbuff.c:766 [inline] consume_skb net/core/skbuff.c:930 [inline] consume_skb+0xc2/0x160 net/core/skbuff.c:924 __unix_dgram_recvmsg+0x428/0xb80 net/unix/af_unix.c:2487 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] ____sys_recvmsg+0x2c7/0x600 net/socket.c:2701 ___sys_recvmsg+0xf2/0x180 net/socket.c:2743 __sys_recvmsg+0xf0/0x1c0 net/socket.c:2773 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4976c48003 ================================ WARNING: inconsistent lock state 5.19.0-syzkaller-13666-gffcf9c5700e4 #0 Not tainted -------------------------------- inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage. udevd/1178 [HC0[0]:SC1[1]:HE0:SE0] takes: ffffffff87b854d8 (vmap_area_lock){+.?.}-{2:2}, at: spin_lock include/linux/spinlock.h:349 [inline] ffffffff87b854d8 (vmap_area_lock){+.?.}-{2:2}, at: find_vmap_area+0x1c/0x130 mm/vmalloc.c:1836 {SOFTIRQ-ON-W} state was registered at: lock_acquire kernel/locking/lockdep.c:5666 [inline] lock_acquire+0x1ab/0x570 kernel/locking/lockdep.c:5631 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:349 [inline] alloc_vmap_area+0xa0b/0x1d50 mm/vmalloc.c:1617 __get_vm_area_node+0x142/0x3f0 mm/vmalloc.c:2484 get_vm_area_caller+0x43/0x50 mm/vmalloc.c:2537 __ioremap_caller.constprop.0+0x292/0x600 arch/x86/mm/ioremap.c:280 acpi_os_ioremap include/acpi/acpi_io.h:13 [inline] acpi_map drivers/acpi/osl.c:296 [inline] acpi_os_map_iomem+0x463/0x550 drivers/acpi/osl.c:355 acpi_tb_acquire_table+0xd8/0x209 drivers/acpi/acpica/tbdata.c:142 acpi_tb_validate_table drivers/acpi/acpica/tbdata.c:317 [inline] acpi_tb_validate_table+0x50/0x8c drivers/acpi/acpica/tbdata.c:308 acpi_tb_verify_temp_table+0x84/0x674 drivers/acpi/acpica/tbdata.c:504 acpi_reallocate_root_table+0x374/0x3e0 drivers/acpi/acpica/tbxface.c:180 acpi_early_init+0x13a/0x438 drivers/acpi/bus.c:1214 start_kernel+0x3cf/0x48f init/main.c:1099 secondary_startup_64_no_verify+0xce/0xdb irq event stamp: 1004159 hardirqs last enabled at (1004158): [] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline] hardirqs last enabled at (1004158): [] _raw_spin_unlock_irq+0x1f/0x40 kernel/locking/spinlock.c:202 hardirqs last disabled at (1004159): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (1004159): [] _raw_spin_lock_irqsave+0x4e/0x50 kernel/locking/spinlock.c:162 softirqs last enabled at (1002536): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last enabled at (1002536): [] __irq_exit_rcu+0x113/0x170 kernel/softirq.c:650 softirqs last disabled at (1004155): [] invoke_softirq kernel/softirq.c:445 [inline] softirqs last disabled at (1004155): [] __irq_exit_rcu+0x113/0x170 kernel/softirq.c:650 other info that might help us debug this: Possible unsafe locking scenario: CPU0 ---- lock(vmap_area_lock); lock(vmap_area_lock); *** DEADLOCK *** 2 locks held by udevd/1178: #0: ffff888110e75d70 (&u->iolock){+.+.}-{3:3}, at: __unix_dgram_recvmsg+0x226/0xb80 net/unix/af_unix.c:2404 #1: ffffc90000178d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: lockdep_copy_map include/linux/lockdep.h:31 [inline] #1: ffffc90000178d70 ((&dum_hcd->timer)){+.-.}-{0:0}, at: call_timer_fn+0xd5/0x6b0 kernel/time/timer.c:1464 stack backtrace: CPU: 1 PID: 1178 Comm: udevd Not tainted 5.19.0-syzkaller-13666-gffcf9c5700e4 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/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 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:349 [inline] find_vmap_area+0x1c/0x130 mm/vmalloc.c:1836 check_heap_object mm/usercopy.c:176 [inline] __check_object_size mm/usercopy.c:250 [inline] __check_object_size+0x1f8/0x700 mm/usercopy.c:212 check_object_size include/linux/thread_info.h:199 [inline] __copy_from_user_inatomic include/linux/uaccess.h:62 [inline] copy_from_user_nmi arch/x86/lib/usercopy.c:47 [inline] copy_from_user_nmi+0xcb/0x130 arch/x86/lib/usercopy.c:31 copy_code arch/x86/kernel/dumpstack.c:91 [inline] show_opcodes+0x59/0xb0 arch/x86/kernel/dumpstack.c:121 show_iret_regs+0xd/0x33 arch/x86/kernel/dumpstack.c:149 __show_regs+0x1e/0x60 arch/x86/kernel/process_64.c:74 show_trace_log_lvl+0x25b/0x2ba arch/x86/kernel/dumpstack.c:292 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 ubsan_epilogue+0xb/0x50 lib/ubsan.c:151 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x187 lib/ubsan.c:322 snto32 drivers/hid/hid-core.c:1323 [inline] snto32.cold+0x19/0x48 drivers/hid/hid-core.c:1313 hid_input_fetch_field drivers/hid/hid-core.c:1572 [inline] hid_process_report drivers/hid/hid-core.c:1665 [inline] hid_report_raw_event+0x88b/0x1280 drivers/hid/hid-core.c:1998 hid_input_report+0x360/0x4c0 drivers/hid/hid-core.c:2065 hid_irq_in+0x50e/0x690 drivers/hid/usbhid/hid-core.c:284 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1671 usb_hcd_giveback_urb+0x380/0x430 drivers/usb/core/hcd.c:1754 dummy_timer+0x11ff/0x32c0 drivers/usb/gadget/udc/dummy_hcd.c:1988 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1c0/0x9a9 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x113/0x170 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:core_kernel_text+0x49/0x90 kernel/extable.c:71 Code: ff 85 c0 41 89 c4 75 4c 48 c7 c0 84 5f de 88 48 ba 00 00 00 00 00 fc ff df 48 89 c1 83 e0 07 48 c1 e9 03 83 c0 03 0f b6 14 11 <38> d0 7c 04 84 d2 75 2f 83 3d 9c 30 c1 07 01 76 07 44 89 e0 5b 41 RSP: 0018:ffffc90000577528 EFLAGS: 00000202 RAX: 0000000000000007 RBX: 00007f4976c48003 RCX: 1ffffffff11bcbf0 RDX: 0000000000000000 RSI: ffffffff8100716c RDI: 0000000000000007 RBP: 00007f4976c48003 R08: 0000000000000007 R09: ffffffffff600000 R10: 00007f4976c48000 R11: 0000000000052040 R12: 0000000000000000 R13: 0000000000000000 R14: ffff8881132a5580 R15: ffffea0004df1200 kernel_text_address+0xd/0x60 kernel/extable.c:99 __kernel_text_address+0x9/0x30 kernel/extable.c:79 unwind_get_return_address arch/x86/kernel/unwind_orc.c:318 [inline] unwind_get_return_address+0x51/0x90 arch/x86/kernel/unwind_orc.c:313 arch_stack_walk+0x93/0xe0 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x14a/0x1b0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1754 [inline] slab_free_freelist_hook mm/slub.c:1780 [inline] slab_free mm/slub.c:3534 [inline] kfree+0xca/0x5c0 mm/slub.c:4562 skb_free_head net/core/skbuff.c:658 [inline] skb_release_data+0x6b3/0x7f0 net/core/skbuff.c:687 skb_release_all net/core/skbuff.c:752 [inline] __kfree_skb net/core/skbuff.c:766 [inline] consume_skb net/core/skbuff.c:930 [inline] consume_skb+0xc2/0x160 net/core/skbuff.c:924 __unix_dgram_recvmsg+0x428/0xb80 net/unix/af_unix.c:2487 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] ____sys_recvmsg+0x2c7/0x600 net/socket.c:2701 ___sys_recvmsg+0xf2/0x180 net/socket.c:2743 __sys_recvmsg+0xf0/0x1c0 net/socket.c:2773 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f4976c48003 Code: 8b 15 79 fe 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 2f 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 89 54 24 1c 48 RSP: 002b:00007fff2bd8f658 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f4976c48003 RDX: 0000000000000040 RSI: 00007fff2bd8f720 RDI: 0000000000000009 RBP: 00007fff2bd8f720 R08: 00000000059f3721 R09: 00007fff2bdb7080 R10: 00007fff2bdb7090 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000bd0c R14: 0000000000000000 R15: 0000000000000000 Code: 8b 15 79 fe 0b 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b5 0f 1f 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 2f 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 89 54 24 1c 48 RSP: 002b:00007fff2bd8f658 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 0000000000000001 RCX: 00007f4976c48003 RDX: 0000000000000040 RSI: 00007fff2bd8f720 RDI: 0000000000000009 RBP: 00007fff2bd8f720 R08: 00000000059f3721 R09: 00007fff2bdb7080 R10: 00007fff2bdb7090 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000bd0c R14: 0000000000000000 R15: 0000000000000000 ================================================================================ ---------------- Code disassembly (best guess): 0: ff 85 c0 41 89 c4 incl -0x3b76be40(%rbp) 6: 75 4c jne 0x54 8: 48 c7 c0 84 5f de 88 mov $0xffffffff88de5f84,%rax f: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx 16: fc ff df 19: 48 89 c1 mov %rax,%rcx 1c: 83 e0 07 and $0x7,%eax 1f: 48 c1 e9 03 shr $0x3,%rcx 23: 83 c0 03 add $0x3,%eax 26: 0f b6 14 11 movzbl (%rcx,%rdx,1),%edx * 2a: 38 d0 cmp %dl,%al <-- trapping instruction 2c: 7c 04 jl 0x32 2e: 84 d2 test %dl,%dl 30: 75 2f jne 0x61 32: 83 3d 9c 30 c1 07 01 cmpl $0x1,0x7c1309c(%rip) # 0x7c130d5 39: 76 07 jbe 0x42 3b: 44 89 e0 mov %r12d,%eax 3e: 5b pop %rbx 3f: 41 rex.B