usbtmc 8-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:910 [inline] BUG: KASAN: slab-use-after-free in usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:907 Write of size 4 at addr ffff888100eba110 by task syz-executor/6317 CPU: 3 UID: 0 PID: 6317 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) 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:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:194 [inline] kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:200 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:910 [inline] usb_anchor_suspend_wakeups+0x28/0x40 drivers/usb/core/urb.c:907 __usb_hcd_giveback_urb+0x220/0x610 drivers/usb/core/hcd.c:1648 usb_hcd_giveback_urb+0x39b/0x450 drivers/usb/core/hcd.c:1745 dummy_timer+0x1809/0x3a00 drivers/usb/gadget/udc/dummy_hcd.c:1995 __run_hrtimer kernel/time/hrtimer.c:1777 [inline] __hrtimer_run_queues+0x202/0xad0 kernel/time/hrtimer.c:1841 hrtimer_run_softirq+0x17d/0x350 kernel/time/hrtimer.c:1858 handle_softirqs+0x219/0x8e0 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1052 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1052 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 RIP: 0010:finish_task_switch.isra.0+0x22a/0xc10 kernel/sched/core.c:5193 Code: fb 09 00 00 44 8b 05 49 2f f8 0e 45 85 c0 0f 85 be 01 00 00 4c 89 e7 e8 a4 f6 ff ff e8 bf d3 3a 00 fb 65 48 8b 1d ee 99 17 12 <48> 8d bb 58 16 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 RSP: 0018:ffffc9000489fa20 EFLAGS: 00000206 RAX: 0000000000035ad1 RBX: ffff88802577a480 RCX: ffffffff81c4e8df RDX: 0000000000000000 RSI: ffffffff8da2c165 RDI: ffffffff8bf073c0 RBP: ffffc9000489fa68 R08: 0000000000000001 R09: 0000000000000001 R10: ffffffff908214d7 R11: 0000000000000001 R12: ffff88806a73a380 R13: ffff8880290f0000 R14: ffff88806a53a380 R15: ffff88806a73b1b0 context_switch kernel/sched/core.c:5328 [inline] __schedule+0x1198/0x5de0 kernel/sched/core.c:6929 __schedule_loop kernel/sched/core.c:7011 [inline] schedule+0xe7/0x3a0 kernel/sched/core.c:7026 do_nanosleep+0x219/0x580 kernel/time/hrtimer.c:2116 hrtimer_nanosleep+0x155/0x380 kernel/time/hrtimer.c:2163 common_nsleep+0xa1/0xd0 kernel/time/posix-timers.c:1352 __do_sys_clock_nanosleep kernel/time/posix-timers.c:1398 [inline] __se_sys_clock_nanosleep kernel/time/posix-timers.c:1375 [inline] __x64_sys_clock_nanosleep+0x34d/0x4a0 kernel/time/posix-timers.c:1375 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fc095db27c5 Code: 24 0c 89 3c 24 48 89 4c 24 18 e8 06 55 ff ff 4c 8b 54 24 18 48 8b 54 24 10 41 89 c0 8b 74 24 0c 8b 3c 24 b8 e6 00 00 00 0f 05 <44> 89 c7 48 89 04 24 e8 5f 55 ff ff 48 8b 04 24 48 83 c4 28 f7 d8 RSP: 002b:00007ffe744e65b0 EFLAGS: 00000293 ORIG_RAX: 00000000000000e6 RAX: ffffffffffffffda RBX: 0000000000000006 RCX: 00007fc095db27c5 RDX: 00007ffe744e65f0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffe744e664c R08: 0000000000000000 R09: 00007fc096bd1000 R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000032 R13: 0000000000018070 R14: 0000000000017db9 R15: 00007ffe744e66a0 Allocated by task 6488: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 poison_kmalloc_redzone mm/kasan/common.c:400 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:417 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] usbtmc_open+0xa9/0x9b0 drivers/usb/class/usbtmc.c:175 usb_open+0x189/0x220 drivers/usb/core/file.c:47 chrdev_open+0x234/0x6a0 fs/char_dev.c:414 do_dentry_open+0x982/0x1530 fs/open.c:965 vfs_open+0x82/0x3f0 fs/open.c:1097 do_open fs/namei.c:3975 [inline] path_openat+0x1de4/0x2cb0 fs/namei.c:4134 do_filp_open+0x20b/0x470 fs/namei.c:4161 do_sys_openat2+0x11b/0x1d0 fs/open.c:1437 do_sys_open fs/open.c:1452 [inline] __do_sys_openat fs/open.c:1468 [inline] __se_sys_openat fs/open.c:1463 [inline] __x64_sys_openat+0x174/0x210 fs/open.c:1463 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 6488: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 __kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:587 kasan_save_free_info mm/kasan/kasan.h:406 [inline] poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2543 [inline] slab_free mm/slub.c:6642 [inline] kfree+0x2b8/0x6d0 mm/slub.c:6849 usbtmc_release+0x271/0x380 drivers/usb/class/usbtmc.c:261 __fput+0x402/0xb70 fs/file_table.c:468 task_work_run+0x150/0x240 kernel/task_work.c:227 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop+0xec/0x130 kernel/entry/common.c:43 exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline] do_syscall_64+0x426/0xfa0 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888100eba000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 272 bytes inside of freed 1024-byte region [ffff888100eba000, ffff888100eba400) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x100eb8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000040 ffff88801b442dc0 0000000000000000 dead000000000001 raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 057ff00000000040 ffff88801b442dc0 0000000000000000 dead000000000001 head: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000 head: 057ff00000000003 ffffea000403ae01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 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 1, tgid 1 (swapper/0), ts 2406492005, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1845 prep_new_page mm/page_alloc.c:1853 [inline] get_page_from_freelist+0x10a3/0x3a30 mm/page_alloc.c:3879 __alloc_frozen_pages_noprof+0x25f/0x2470 mm/page_alloc.c:5178 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3059 [inline] allocate_slab mm/slub.c:3232 [inline] new_slab+0x24a/0x360 mm/slub.c:3286 ___slab_alloc+0xd79/0x1a50 mm/slub.c:4655 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4778 __slab_alloc_node mm/slub.c:4854 [inline] slab_alloc_node mm/slub.c:5276 [inline] __do_kmalloc_node mm/slub.c:5649 [inline] __kvmalloc_node_noprof+0x5aa/0x9c0 mm/slub.c:7112 bucket_table_alloc.isra.0+0x88/0x460 lib/rhashtable.c:186 rhashtable_init_noprof+0x41a/0x7e0 lib/rhashtable.c:1075 netlink_proto_init+0xbc/0x320 net/netlink/af_netlink.c:2937 do_one_initcall+0x123/0x6e0 init/main.c:1283 do_initcall_level init/main.c:1345 [inline] do_initcalls init/main.c:1361 [inline] do_basic_setup init/main.c:1380 [inline] kernel_init_freeable+0x5c8/0x920 init/main.c:1593 kernel_init+0x1c/0x2b0 init/main.c:1483 ret_from_fork+0x675/0x7d0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page_owner free stack trace missing Memory state around the buggy address: ffff888100eba000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888100eba080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888100eba100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888100eba180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888100eba200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 00 00 add %al,(%rax) 2: 44 8b 05 49 2f f8 0e mov 0xef82f49(%rip),%r8d # 0xef82f52 9: 45 85 c0 test %r8d,%r8d c: 0f 85 be 01 00 00 jne 0x1d0 12: 4c 89 e7 mov %r12,%rdi 15: e8 a4 f6 ff ff call 0xfffff6be 1a: e8 bf d3 3a 00 call 0x3ad3de 1f: fb sti 20: 65 48 8b 1d ee 99 17 mov %gs:0x121799ee(%rip),%rbx # 0x12179a16 27: 12 * 28: 48 8d bb 58 16 00 00 lea 0x1658(%rbx),%rdi <-- trapping instruction 2f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 36: fc ff df 39: 48 89 fa mov %rdi,%rdx 3c: 48 rex.W 3d: c1 .byte 0xc1