================================================================== BUG: KASAN: slab-out-of-bounds in mcp2221_raw_event+0xf98/0x1030 drivers/hid/hid-mcp2221.c:852 Read of size 1 at addr ffff8881207dbfff by task syz-executor/9875 CPU: 0 UID: 0 PID: 9875 Comm: syz-executor Not tainted 6.13.0-rc4-syzkaller-00088-g594c82329eef #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 mcp2221_raw_event+0xf98/0x1030 drivers/hid/hid-mcp2221.c:852 __hid_input_report.constprop.0+0x312/0x440 drivers/hid/hid-core.c:2111 hid_irq_in+0x35e/0x870 drivers/hid/usbhid/hid-core.c:285 __usb_hcd_giveback_urb+0x389/0x6e0 drivers/usb/core/hcd.c:1650 usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1734 dummy_timer+0x17f7/0x3960 drivers/usb/gadget/udc/dummy_hcd.c:1993 __run_hrtimer kernel/time/hrtimer.c:1739 [inline] __hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1803 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1820 handle_softirqs+0x206/0x8d0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xfa/0x160 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0x90/0xb0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:syscall_enter_from_user_mode_work include/linux/entry-common.h:166 [inline] RIP: 0010:syscall_enter_from_user_mode include/linux/entry-common.h:199 [inline] RIP: 0010:do_syscall_64+0x9a/0x250 arch/x86/entry/common.c:79 Code: 00 48 8b 7d 08 e8 f6 44 00 00 0f 1f 44 00 00 0f 1f 44 00 00 90 e8 76 41 72 fa 90 90 e8 ff 42 72 fa fb 65 48 8b 05 66 fe 12 79 <48> 8b 50 08 f6 c2 3f 0f 85 3c 01 00 00 90 90 41 81 fc d2 01 00 00 RSP: 0018:ffffc9000187ff28 EFLAGS: 00000202 RAX: ffff88811d023a80 RBX: ffffc9000187ff58 RCX: 1ffffffff14abb81 RDX: 0000000000000000 RSI: ffffffff8727fee0 RDI: ffffffff874735a0 RBP: ffffc9000187ff48 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff8a561517 R11: 0000000000000000 R12: 000000000000003d R13: 000000000000003d R14: 0000000000000000 R15: 0000000000000000 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f254fd9bf53 Code: 00 00 0f 1f 44 00 00 31 c9 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 80 3d f1 05 1d 00 00 49 89 ca 74 14 b8 3d 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 5d c3 0f 1f 40 00 48 83 ec 28 89 54 24 14 48 RSP: 002b:00007ffd52da0b28 EFLAGS: 00000202 ORIG_RAX: 000000000000003d RAX: ffffffffffffffda RBX: 00000000000000fd RCX: 00007f254fd9bf53 RDX: 0000000040000001 RSI: 00007ffd52da0b5c RDI: 00000000ffffffff RBP: 00007ffd52da0b5c R08: 0000000000032420 R09: 00007f254fc1a000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000032 R13: 0000000000105a05 R14: 00007ffd52da0bb0 R15: 0000000000000bb8 Allocated by task 11026: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x6e/0x70 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] kmem_cache_alloc_bulk_noprof+0x3ec/0xab0 mm/slub.c:5129 mt_alloc_bulk lib/maple_tree.c:181 [inline] mas_alloc_nodes+0x2f1/0x8b0 lib/maple_tree.c:1275 mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1335 mas_node_count lib/maple_tree.c:1349 [inline] mas_wr_preallocate lib/maple_tree.c:4270 [inline] mas_insert lib/maple_tree.c:4303 [inline] mas_alloc_cyclic+0xacf/0x1680 lib/maple_tree.c:4365 mtree_alloc_cyclic+0x172/0x1e0 lib/maple_tree.c:6523 simple_offset_add+0xc4/0x160 fs/libfs.c:293 shmem_mknod+0x123/0x240 mm/shmem.c:3684 lookup_open.isra.0+0x1158/0x14b0 fs/namei.c:3649 open_last_lookups fs/namei.c:3748 [inline] path_openat+0x904/0x2d60 fs/namei.c:3984 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 Freed by task 11026: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x37/0x50 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x133/0x470 mm/slub.c:4715 mt_free_one lib/maple_tree.c:186 [inline] mas_destroy+0x5a2/0x9e0 lib/maple_tree.c:5602 mas_alloc_cyclic+0xe9e/0x1680 lib/maple_tree.c:4375 mtree_alloc_cyclic+0x172/0x1e0 lib/maple_tree.c:6523 simple_offset_add+0xc4/0x160 fs/libfs.c:293 shmem_mknod+0x123/0x240 mm/shmem.c:3684 lookup_open.isra.0+0x1158/0x14b0 fs/namei.c:3649 open_last_lookups fs/namei.c:3748 [inline] path_openat+0x904/0x2d60 fs/namei.c:3984 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 The buggy address belongs to the object at ffff8881207dbe00 which belongs to the cache maple_node of size 256 The buggy address is located 255 bytes to the right of allocated 256-byte region [ffff8881207dbe00, ffff8881207dbf00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8881207da600 pfn:0x1207da head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x200000000000040(head|node=0|zone=2) page_type: f5(slab) raw: 0200000000000040 ffff888100091000 ffffea0004dbc080 dead000000000002 raw: ffff8881207da600 0000000000100005 00000001f5000000 0000000000000000 head: 0200000000000040 ffff888100091000 ffffea0004dbc080 dead000000000002 head: ffff8881207da600 0000000000100005 00000001f5000000 0000000000000000 head: 0200000000000001 ffffea000481f681 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 12629, tgid 12629 (modprobe), ts 926925567640, free_ts 923467376453 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0xe76/0x2b90 mm/page_alloc.c:3476 __alloc_pages_noprof+0x21c/0x22a0 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0xeb/0x400 mm/mempolicy.c:2269 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab mm/slub.c:2589 [inline] new_slab+0x2c9/0x410 mm/slub.c:2642 ___slab_alloc+0xd1d/0x16e0 mm/slub.c:3830 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] kmem_cache_alloc_noprof+0x1fd/0x3b0 mm/slub.c:4175 mt_alloc_one lib/maple_tree.c:176 [inline] mas_alloc_nodes+0x18b/0x8b0 lib/maple_tree.c:1253 mas_node_count_gfp+0x105/0x130 lib/maple_tree.c:1335 mas_preallocate+0x53f/0xce0 lib/maple_tree.c:5545 vma_iter_prealloc mm/vma.h:349 [inline] __split_vma+0x474/0x1130 mm/vma.c:447 vms_gather_munmap_vmas+0x391/0x16b0 mm/vma.c:1288 __mmap_prepare mm/vma.c:2241 [inline] __mmap_region+0x31e/0x2620 mm/vma.c:2443 mmap_region+0x127/0x320 mm/mmap.c:1348 do_mmap+0xc00/0xfc0 mm/mmap.c:496 page last free pid 5224 tgid 5224 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_unref_page+0x661/0xe40 mm/page_alloc.c:2659 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4e/0x120 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x4e/0x70 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] __kmalloc_cache_noprof+0x153/0x3e0 mm/slub.c:4324 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] kobject_uevent_env+0x265/0x1870 lib/kobject_uevent.c:540 __device_release_driver drivers/base/dd.c:1285 [inline] device_release_driver_internal+0x51b/0x610 drivers/base/dd.c:1296 bus_remove_device+0x22f/0x420 drivers/base/bus.c:576 device_del+0x396/0x9f0 drivers/base/core.c:3854 usb_disable_device+0x36c/0x7f0 drivers/usb/core/message.c:1418 usb_disconnect+0x2e1/0x920 drivers/usb/core/hub.c:2304 hub_port_connect drivers/usb/core/hub.c:5361 [inline] hub_port_connect_change drivers/usb/core/hub.c:5661 [inline] port_event drivers/usb/core/hub.c:5821 [inline] hub_event+0x1bed/0x4f40 drivers/usb/core/hub.c:5903 process_one_work+0x9c5/0x1ba0 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 Memory state around the buggy address: ffff8881207dbe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881207dbf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881207dbf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881207dc000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881207dc080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 00 48 8b add %cl,-0x75(%rax) 3: 7d 08 jge 0xd 5: e8 f6 44 00 00 call 0x4500 a: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) f: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 14: 90 nop 15: e8 76 41 72 fa call 0xfa724190 1a: 90 nop 1b: 90 nop 1c: e8 ff 42 72 fa call 0xfa724320 21: fb sti 22: 65 48 8b 05 66 fe 12 mov %gs:0x7912fe66(%rip),%rax # 0x7912fe90 29: 79 * 2a: 48 8b 50 08 mov 0x8(%rax),%rdx <-- trapping instruction 2e: f6 c2 3f test $0x3f,%dl 31: 0f 85 3c 01 00 00 jne 0x173 37: 90 nop 38: 90 nop 39: 41 81 fc d2 01 00 00 cmp $0x1d2,%r12d