================================================================== BUG: KASAN: slab-out-of-bounds in MON_OFF2HDR drivers/usb/mon/mon_bin.c:207 [inline] BUG: KASAN: slab-out-of-bounds in mon_bin_flush+0x12a/0x260 drivers/usb/mon/mon_bin.c:884 Read of size 8 at addr ffff8881dce004b8 by task syz-executor293/328 CPU: 1 PID: 328 Comm: syz-executor293 Not tainted 5.4.197-syzkaller-00011-gf3665979a8e7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1d5 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 MON_OFF2HDR drivers/usb/mon/mon_bin.c:207 [inline] mon_bin_flush+0x12a/0x260 drivers/usb/mon/mon_bin.c:884 mon_bin_ioctl+0x68e/0xd00 drivers/usb/mon/mon_bin.c:1091 do_vfs_ioctl+0x6d1/0x15b0 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f08cecadb49 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffeee469608 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f08cecadb49 RDX: 00000000200005c0 RSI: 00000000c0109207 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000470 R11: 0000000000000246 R12: 00007ffeee469638 R13: 00007ffeee469650 R14: 00007ffeee469690 R15: 0000000000000001 Allocated by task 330: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x131/0x1e0 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0xfb/0x280 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xb5/0x4d0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1060 [inline] alloc_uevent_skb+0x73/0x220 lib/kobject_uevent.c:290 uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline] kobject_uevent_net_broadcast+0x343/0x550 lib/kobject_uevent.c:409 kobject_uevent_env+0x552/0x700 lib/kobject_uevent.c:593 device_add+0x7a7/0xbc0 drivers/base/core.c:2889 usb_set_configuration+0x1875/0x1e10 drivers/usb/core/message.c:2029 generic_probe+0x83/0x140 drivers/usb/core/generic.c:210 really_probe+0x74c/0x1100 drivers/base/dd.c:570 driver_probe_device+0xe3/0x240 drivers/base/dd.c:748 bus_for_each_drv+0x118/0x180 drivers/base/bus.c:430 __device_attach+0x280/0x3d0 drivers/base/dd.c:923 bus_probe_device+0xbb/0x1f0 drivers/base/bus.c:490 device_add+0x89c/0xbc0 drivers/base/core.c:2908 usb_new_device+0xdd2/0x15f0 drivers/usb/core/hub.c:2563 hub_port_connect drivers/usb/core/hub.c:5182 [inline] hub_port_connect_change drivers/usb/core/hub.c:5301 [inline] port_event drivers/usb/core/hub.c:5447 [inline] hub_event+0x279e/0x4a80 drivers/usb/core/hub.c:5529 process_one_work+0x6ca/0xc40 kernel/workqueue.c:2287 worker_thread+0xae0/0x1440 kernel/workqueue.c:2433 kthread+0x2d8/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 Freed by task 155: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x178/0x240 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook+0x80/0x150 mm/slub.c:1494 slab_free mm/slub.c:3080 [inline] kfree+0xc6/0x260 mm/slub.c:4071 skb_release_all net/core/skbuff.c:675 [inline] __kfree_skb+0x55/0x170 net/core/skbuff.c:689 skb_free_datagram+0x24/0xd0 net/core/datagram.c:329 netlink_recvmsg+0x549/0xff0 net/netlink/af_netlink.c:2011 sock_recvmsg_nosec net/socket.c:872 [inline] sock_recvmsg net/socket.c:890 [inline] ____sys_recvmsg net/socket.c:2519 [inline] ___sys_recvmsg net/socket.c:2560 [inline] __sys_recvmsg+0x43f/0x6e0 net/socket.c:2607 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff8881dce00000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 184 bytes to the right of 1024-byte region [ffff8881dce00000, ffff8881dce00400) The buggy address belongs to the page: page:ffffea0007738000 refcount:1 mapcount:0 mapping:ffff8881f5c02280 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02280 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857 alloc_slab_page+0x39/0x3e0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x450 mm/slub.c:1749 new_slab_objects mm/slub.c:2506 [inline] ___slab_alloc+0x320/0x4b0 mm/slub.c:2667 __slab_alloc+0x5a/0x90 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0x129/0x240 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] usb_create_ep_devs+0x56/0x230 drivers/usb/core/endpoint.c:156 usb_new_device+0xed5/0x15f0 drivers/usb/core/hub.c:2591 hub_port_connect drivers/usb/core/hub.c:5182 [inline] hub_port_connect_change drivers/usb/core/hub.c:5301 [inline] port_event drivers/usb/core/hub.c:5447 [inline] hub_event+0x279e/0x4a80 drivers/usb/core/hub.c:5529 process_one_work+0x6ca/0xc40 kernel/workqueue.c:2287 worker_thread+0xae0/0x1440 kernel/workqueue.c:2433 kthread+0x2d8/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 page_owner free stack trace missing Memory state around the buggy address: ffff8881dce00380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dce00400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881dce00480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881dce00500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881dce00580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 328 Comm: syz-executor293 Tainted: G B 5.4.197-syzkaller-00011-gf3665979a8e7 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 RIP: 0010:mon_bin_flush+0x140/0x260 drivers/usb/mon/mon_bin.c:885 Code: e8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 ef e8 36 14 d0 fe 48 8b 45 00 81 e3 ff 0f 00 00 4c 8d 74 03 24 4c 89 f0 48 c1 e8 03 <42> 0f b6 04 28 84 c0 75 78 41 8b 36 83 c6 40 4c 89 e7 e8 b9 fd ff RSP: 0018:ffff8881dd01fd10 EFLAGS: 00010007 RAX: 000000000000010c RBX: 0000000000000840 RCX: 0000000000000002 RDX: 0000000000000001 RSI: 0000000000000046 RDI: 0000000000000001 RBP: ffff8881dce004b8 R08: dffffc0000000000 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881dd6eb000 R13: dffffc0000000000 R14: 0000000000000864 R15: ffff8881dd6eb018 FS: 0000555555ed5300(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000088 CR3: 00000001dd757000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: mon_bin_ioctl+0x68e/0xd00 drivers/usb/mon/mon_bin.c:1091 do_vfs_ioctl+0x6d1/0x15b0 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xd4/0x110 fs/ioctl.c:747 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f08cecadb49 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 18 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffeee469608 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f08cecadb49 RDX: 00000000200005c0 RSI: 00000000c0109207 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000470 R11: 0000000000000246 R12: 00007ffeee469638 R13: 00007ffeee469650 R14: 00007ffeee469690 R15: 0000000000000001 Modules linked in: ---[ end trace 569e8ae3aa868e22 ]--- RIP: 0010:mon_bin_flush+0x140/0x260 drivers/usb/mon/mon_bin.c:885 Code: e8 48 c1 e8 03 42 80 3c 28 00 74 08 48 89 ef e8 36 14 d0 fe 48 8b 45 00 81 e3 ff 0f 00 00 4c 8d 74 03 24 4c 89 f0 48 c1 e8 03 <42> 0f b6 04 28 84 c0 75 78 41 8b 36 83 c6 40 4c 89 e7 e8 b9 fd ff RSP: 0018:ffff8881dd01fd10 EFLAGS: 00010007 RAX: 000000000000010c RBX: 0000000000000840 RCX: 0000000000000002 RDX: 0000000000000001 RSI: 0000000000000046 RDI: 0000000000000001 RBP: ffff8881dce004b8 R08: dffffc0000000000 R09: fffffbfff0d3170d R10: fffffbfff0d3170d R11: 1ffffffff0d3170c R12: ffff8881dd6eb000 R13: dffffc0000000000 R14: 0000000000000864 R15: ffff8881dd6eb018 FS: 0000555555ed5300(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020000088 CR3: 00000001dd757000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: e8 48 c1 e8 03 callq 0x3e8c14d 5: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) a: 74 08 je 0x14 c: 48 89 ef mov %rbp,%rdi f: e8 36 14 d0 fe callq 0xfed0144a 14: 48 8b 45 00 mov 0x0(%rbp),%rax 18: 81 e3 ff 0f 00 00 and $0xfff,%ebx 1e: 4c 8d 74 03 24 lea 0x24(%rbx,%rax,1),%r14 23: 4c 89 f0 mov %r14,%rax 26: 48 c1 e8 03 shr $0x3,%rax * 2a: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 75 78 jne 0xab 33: 41 8b 36 mov (%r14),%esi 36: 83 c6 40 add $0x40,%esi 39: 4c 89 e7 mov %r12,%rdi 3c: e8 .byte 0xe8 3d: b9 .byte 0xb9 3e: fd std 3f: ff .byte 0xff