usbtmc 10-1:16.0: usbtmc_read_bulk_cb - nonzero read bulk status received: -71 ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline] BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups drivers/usb/core/urb.c:927 [inline] BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:924 Write of size 4 at addr ffff88804b881910 by task syz.5.601/8496 CPU: 2 UID: 0 PID: 8496 Comm: syz.5.601 Not tainted 6.12.0-syzkaller-00233-g9fb2cfa4635a #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 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:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0xef/0x1a0 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_inc include/linux/atomic/atomic-instrumented.h:435 [inline] usb_anchor_suspend_wakeups drivers/usb/core/urb.c:927 [inline] usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:924 __usb_hcd_giveback_urb+0x223/0x6e0 drivers/usb/core/hcd.c:1636 usb_hcd_giveback_urb+0x396/0x450 drivers/usb/core/hcd.c:1734 dummy_timer+0x17f0/0x3930 drivers/usb/gadget/udc/dummy_hcd.c:1993 __run_hrtimer kernel/time/hrtimer.c:1691 [inline] __hrtimer_run_queues+0x20a/0xae0 kernel/time/hrtimer.c:1755 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1772 handle_softirqs+0x213/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu kernel/softirq.c:637 [inline] irq_exit_rcu+0xbb/0x120 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:refill_stock+0x17d/0x220 mm/memcontrol.c:1830 Code: ea 03 80 3c 02 00 0f 85 ac 00 00 00 48 03 1c ed 80 8b a6 8d 48 89 df e8 61 b0 ff ff e8 2c ee 9d ff 9c 58 f6 c4 02 75 1b fb 5b <5d> 41 5c 41 5d 41 5e c3 cc cc cc cc 5b 5d 41 5c 41 5d 41 5e e9 9a RSP: 0018:ffffc90006647b50 EFLAGS: 00000246 RAX: 0000000000000006 RBX: ffff888045fc4000 RCX: 1ffffffff20be9d1 RDX: 0000000000000000 RSI: ffffffff8b6cd180 RDI: ffffffff8bd1c960 RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff905f90cf R11: 0000000000000000 R12: ffff888045fc4000 R13: 0000000000000001 R14: 0000000000000002 R15: ffff8880442c4088 obj_cgroup_uncharge_pages+0x4e/0x230 mm/memcontrol.c:2606 __memcg_kmem_uncharge_page+0xdd/0x290 mm/memcontrol.c:2680 memcg_kmem_uncharge_page include/linux/memcontrol.h:1749 [inline] exit_task_stack_account+0x98/0xf0 kernel/fork.c:568 do_exit+0x1c8a/0x2d70 kernel/exit.c:979 do_group_exit+0xd3/0x2a0 kernel/exit.c:1087 get_signal+0x25fb/0x2770 kernel/signal.c:2918 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f4f0b97e759 Code: Unable to access opcode bytes at 0x7f4f0b97e72f. RSP: 002b:00007f4f0c75a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: fffffffffffffff5 RBX: 00007f4f0bb35f80 RCX: 00007f4f0b97e759 RDX: 0000000020000040 RSI: 00000000c0145b0e RDI: 0000000000000006 RBP: 00007f4f0b9f175e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f4f0bb35f80 R15: 00007ffcfb30e748 Allocated by task 8496: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:394 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] usbtmc_open+0xa6/0x9b0 drivers/usb/class/usbtmc.c:175 usb_open+0x186/0x220 drivers/usb/core/file.c:47 chrdev_open+0x237/0x6a0 fs/char_dev.c:414 do_dentry_open+0x6ca/0x1530 fs/open.c:941 vfs_open+0x82/0x3f0 fs/open.c:1071 do_open fs/namei.c:3828 [inline] path_openat+0x1e6a/0x2d60 fs/namei.c:3987 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1398 do_sys_open fs/open.c:1413 [inline] __do_sys_openat fs/open.c:1429 [inline] __se_sys_openat fs/open.c:1424 [inline] __x64_sys_openat+0x175/0x210 fs/open.c:1424 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 8496: 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:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x14f/0x4b0 mm/slub.c:4727 usbtmc_release+0x271/0x380 drivers/usb/class/usbtmc.c:261 __fput+0x3f8/0xb60 fs/file_table.c:450 task_work_run+0x14e/0x250 kernel/task_work.c:239 get_signal+0x1ca/0x2770 kernel/signal.c:2691 arch_do_signal_or_restart+0x90/0x7e0 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x150/0x2a0 kernel/entry/common.c:218 do_syscall_64+0xda/0x250 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88804b881800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 272 bytes inside of freed 1024-byte region [ffff88804b881800, ffff88804b881c00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x4b880 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b042dc0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 00fff00000000040 ffff88801b042dc0 dead000000000100 dead000000000122 head: 0000000000000000 0000000080100010 00000001f5000000 0000000000000000 head: 00fff00000000003 ffffea00012e2001 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5943, tgid 5943 (syz-executor), ts 46226920113, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25a0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2c9/0x410 mm/slub.c:2631 ___slab_alloc+0xdac/0x1880 mm/slub.c:3818 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_node_noprof+0x357/0x430 mm/slub.c:4270 __kvmalloc_node_noprof+0xad/0x1a0 mm/util.c:658 bucket_table_alloc.isra.0+0x86/0x460 lib/rhashtable.c:186 rhashtable_init_noprof+0x41a/0x7e0 lib/rhashtable.c:1071 ioam6_net_init+0xb1/0x170 net/ipv6/ioam6.c:974 ops_init+0x1df/0x5f0 net/core/net_namespace.c:139 setup_net+0x21f/0x860 net/core/net_namespace.c:356 copy_net_ns+0x2b4/0x6b0 net/core/net_namespace.c:494 create_new_namespaces+0x3ea/0xad0 kernel/nsproxy.c:110 page_owner free stack trace missing Memory state around the buggy address: ffff88804b881800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804b881880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804b881900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804b881980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804b881a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 03 80 3c 02 00 0f add 0xf00023c(%rax),%eax 6: 85 ac 00 00 00 48 03 test %ebp,0x3480000(%rax,%rax,1) d: 1c ed sbb $0xed,%al f: 80 8b a6 8d 48 89 df orb $0xdf,-0x76b7725a(%rbx) 16: e8 61 b0 ff ff call 0xffffb07c 1b: e8 2c ee 9d ff call 0xff9dee4c 20: 9c pushf 21: 58 pop %rax 22: f6 c4 02 test $0x2,%ah 25: 75 1b jne 0x42 27: fb sti 28: 5b pop %rbx * 29: 5d pop %rbp <-- trapping instruction 2a: 41 5c pop %r12 2c: 41 5d pop %r13 2e: 41 5e pop %r14 30: c3 ret 31: cc int3 32: cc int3 33: cc int3 34: cc int3 35: 5b pop %rbx 36: 5d pop %rbp 37: 41 5c pop %r12 39: 41 5d pop %r13 3b: 41 5e pop %r14 3d: e9 .byte 0xe9 3e: 9a (bad)