==================================================================
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 ffff88807e567110 by task kworker/1:7/5593
CPU: 1 PID: 5593 Comm: kworker/1:7 Not tainted 6.6.0-syzkaller-14651-gd2f51b3516da #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Workqueue: usb_hub_wq hub_event
Call Trace:
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xc4/0x620 mm/kasan/report.c:475
kasan_report+0xda/0x110 mm/kasan/report.c:588
check_region_inline mm/kasan/generic.c:181 [inline]
kasan_check_range+0xef/0x190 mm/kasan/generic.c:187
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+0x217/0x5c0 drivers/usb/core/hcd.c:1637
usb_hcd_giveback_urb+0x389/0x430 drivers/usb/core/hcd.c:1733
dummy_timer+0x1415/0x35f0 drivers/usb/gadget/udc/dummy_hcd.c:1987
call_timer_fn+0x193/0x580 kernel/time/timer.c:1700
expire_timers kernel/time/timer.c:1751 [inline]
__run_timers+0x764/0xb10 kernel/time/timer.c:2022
run_timer_softirq+0x58/0xd0 kernel/time/timer.c:2035
__do_softirq+0x21a/0x968 kernel/softirq.c:553
invoke_softirq kernel/softirq.c:427 [inline]
__irq_exit_rcu kernel/softirq.c:632 [inline]
irq_exit_rcu+0xb7/0x120 kernel/softirq.c:644
sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1076
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:645
RIP: 0010:console_flush_all+0xa0c/0xd50 kernel/printk/printk.c:2973
Code: e8 99 98 23 00 9c 5b 81 e3 00 02 00 00 31 ff 48 89 de e8 57 d4 1c 00 48 85 db 0f 85 74 01 00 00 e8 b9 d8 1c 00 fb 48 8b 04 24 <4c> 89 fa 83 e2 07 0f b6 00 38 d0 7f 08 84 c0 0f 85 4b 02 00 00 41
RSP: 0018:ffffc9000a68f298 EFLAGS: 00000293
RAX: fffff520014d1e7a RBX: 0000000000000000 RCX: ffffffff816bc3b9
RDX: ffff88804d3f3b80 RSI: ffffffff816bc3c7 RDI: 0000000000000007
RBP: dffffc0000000000 R08: 0000000000000007 R09: 0000000000000000
R10: 0000000000000000 R11: 205d333935355420 R12: 0000000000000000
R13: ffffffff8db944d8 R14: ffffffff8db94480 R15: ffffc9000a68f3d0
console_unlock+0x10c/0x260 kernel/printk/printk.c:3036
vprintk_emit+0x17f/0x5f0 kernel/printk/printk.c:2303
dev_vprintk_emit drivers/base/core.c:4850 [inline]
dev_printk_emit+0xfb/0x140 drivers/base/core.c:4861
__dev_printk+0xf5/0x270 drivers/base/core.c:4873
_dev_notice+0xe5/0x120 drivers/base/core.c:4918
usb_parse_endpoint drivers/usb/core/config.c:455 [inline]
usb_parse_interface drivers/usb/core/config.c:582 [inline]
usb_parse_configuration drivers/usb/core/config.c:795 [inline]
usb_get_configuration+0x34ac/0x5640 drivers/usb/core/config.c:944
usb_enumerate_device drivers/usb/core/hub.c:2431 [inline]
usb_new_device+0x1173/0x19f0 drivers/usb/core/hub.c:2569
hub_port_connect drivers/usb/core/hub.c:5463 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5603 [inline]
port_event drivers/usb/core/hub.c:5763 [inline]
hub_event+0x2dac/0x4e10 drivers/usb/core/hub.c:5845
process_one_work+0x884/0x15c0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
Allocated by task 6117:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
____kasan_kmalloc mm/kasan/common.c:374 [inline]
__kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383
kmalloc include/linux/slab.h:600 [inline]
kzalloc include/linux/slab.h:721 [inline]
usbtmc_open+0xa6/0x9b0 drivers/usb/class/usbtmc.c:175
usb_open+0x20f/0x2e0 drivers/usb/core/file.c:47
chrdev_open+0x26d/0x6e0 fs/char_dev.c:414
do_dentry_open+0x8d4/0x18d0 fs/open.c:948
do_open fs/namei.c:3622 [inline]
path_openat+0x1d4e/0x2c40 fs/namei.c:3779
do_filp_open+0x1de/0x430 fs/namei.c:3809
do_sys_openat2+0x176/0x1e0 fs/open.c:1440
do_sys_open fs/open.c:1455 [inline]
__do_sys_openat fs/open.c:1471 [inline]
__se_sys_openat fs/open.c:1466 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1466
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Freed by task 6117:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
kasan_set_track+0x25/0x30 mm/kasan/common.c:52
kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522
____kasan_slab_free mm/kasan/common.c:236 [inline]
____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200
kasan_slab_free include/linux/kasan.h:164 [inline]
slab_free_hook mm/slub.c:1800 [inline]
slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826
slab_free mm/slub.c:3809 [inline]
__kmem_cache_free+0xc0/0x180 mm/slub.c:3822
usbtmc_release+0x285/0x390 drivers/usb/class/usbtmc.c:261
__fput+0x270/0xbb0 fs/file_table.c:394
task_work_run+0x14d/0x240 kernel/task_work.c:180
resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
exit_to_user_mode_prepare+0x215/0x240 kernel/entry/common.c:204
__syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline]
syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296
do_syscall_64+0x4b/0x110 arch/x86/entry/common.c:88
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Last potentially related work creation:
kasan_save_stack+0x33/0x50 mm/kasan/common.c:45
__kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492
kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3386
neigh_destroy+0x435/0x670 net/core/neighbour.c:911
neigh_release include/net/neighbour.h:445 [inline]
neigh_cleanup_and_release+0x1fe/0x280 net/core/neighbour.c:103
neigh_del net/core/neighbour.c:225 [inline]
neigh_remove_one+0x3ac/0x4c0 net/core/neighbour.c:246
neigh_forced_gc net/core/neighbour.c:277 [inline]
neigh_alloc net/core/neighbour.c:478 [inline]
___neigh_create+0x169b/0x2a20 net/core/neighbour.c:641
ip6_finish_output2+0x10e7/0x1830 net/ipv6/ip6_output.c:128
__ip6_finish_output net/ipv6/ip6_output.c:211 [inline]
ip6_finish_output+0x3c7/0xf70 net/ipv6/ip6_output.c:222
NF_HOOK_COND include/linux/netfilter.h:303 [inline]
ip6_output+0x1e2/0x530 net/ipv6/ip6_output.c:243
dst_output include/net/dst.h:451 [inline]
NF_HOOK include/linux/netfilter.h:314 [inline]
ndisc_send_skb+0xa0c/0x18e0 net/ipv6/ndisc.c:509
ndisc_send_ns+0xc7/0x140 net/ipv6/ndisc.c:667
addrconf_dad_work+0xc82/0x14b0 net/ipv6/addrconf.c:4225
process_one_work+0x884/0x15c0 kernel/workqueue.c:2630
process_scheduled_works kernel/workqueue.c:2703 [inline]
worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784
kthread+0x33c/0x440 kernel/kthread.c:388
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147
ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:242
The buggy address belongs to the object at ffff88807e567000
which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 272 bytes inside of
freed 1024-byte region [ffff88807e567000, ffff88807e567400)
The buggy address belongs to the physical page:
page:ffffea0001f95800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e560
head:ffffea0001f95800 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888013041dc0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000080100010 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4841, tgid 4841 (dhcpcd-run-hook), ts 30276214487, free_ts 30266964873
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1537
prep_new_page mm/page_alloc.c:1544 [inline]
get_page_from_freelist+0xa25/0x36c0 mm/page_alloc.c:3312
__alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4568
alloc_pages_mpol+0x258/0x5f0 mm/mempolicy.c:2133
alloc_slab_page mm/slub.c:1870 [inline]
allocate_slab+0x251/0x380 mm/slub.c:2017
new_slab mm/slub.c:2070 [inline]
___slab_alloc+0x8c7/0x1580 mm/slub.c:3223
__slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322
__slab_alloc_node mm/slub.c:3375 [inline]
slab_alloc_node mm/slub.c:3468 [inline]
__kmem_cache_alloc_node+0x131/0x310 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc+0x4f/0x100 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
load_elf_phdrs+0x103/0x210 fs/binfmt_elf.c:526
load_elf_binary+0x14d8/0x4e30 fs/binfmt_elf.c:955
search_binary_handler fs/exec.c:1737 [inline]
exec_binprm fs/exec.c:1779 [inline]
bprm_execve fs/exec.c:1854 [inline]
bprm_execve+0x7f9/0x1a90 fs/exec.c:1810
do_execveat_common.isra.0+0x5d3/0x740 fs/exec.c:1962
do_execve fs/exec.c:2036 [inline]
__do_sys_execve fs/exec.c:2112 [inline]
__se_sys_execve fs/exec.c:2107 [inline]
__x64_sys_execve+0x8c/0xb0 fs/exec.c:2107
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1137 [inline]
free_unref_page_prepare+0x4f8/0xa90 mm/page_alloc.c:2347
free_unref_page+0x33/0x3b0 mm/page_alloc.c:2487
__unfreeze_partials+0x21d/0x240 mm/slub.c:2655
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook mm/slab.h:763 [inline]
slab_alloc_node mm/slub.c:3478 [inline]
__kmem_cache_alloc_node+0x195/0x310 mm/slub.c:3517
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc+0x4f/0x100 mm/slab_common.c:1020
kmalloc include/linux/slab.h:604 [inline]
tomoyo_realpath_from_path+0xb9/0x710 security/tomoyo/realpath.c:251
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x26f/0x450 security/tomoyo/file.c:822
security_inode_getattr+0xf1/0x150 security/security.c:2153
vfs_getattr fs/stat.c:169 [inline]
vfs_fstat+0x4f/0xc0 fs/stat.c:194
vfs_fstatat+0x130/0x140 fs/stat.c:291
__do_sys_newfstatat+0x98/0x110 fs/stat.c:459
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3f/0x110 arch/x86/entry/common.c:82
entry_SYSCALL_64_after_hwframe+0x63/0x6b
Memory state around the buggy address:
ffff88807e567000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807e567080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88807e567100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807e567180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807e567200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: e8 99 98 23 00 call 0x23989e
5: 9c pushf
6: 5b pop %rbx
7: 81 e3 00 02 00 00 and $0x200,%ebx
d: 31 ff xor %edi,%edi
f: 48 89 de mov %rbx,%rsi
12: e8 57 d4 1c 00 call 0x1cd46e
17: 48 85 db test %rbx,%rbx
1a: 0f 85 74 01 00 00 jne 0x194
20: e8 b9 d8 1c 00 call 0x1cd8de
25: fb sti
26: 48 8b 04 24 mov (%rsp),%rax
* 2a: 4c 89 fa mov %r15,%rdx <-- trapping instruction
2d: 83 e2 07 and $0x7,%edx
30: 0f b6 00 movzbl (%rax),%eax
33: 38 d0 cmp %dl,%al
35: 7f 08 jg 0x3f
37: 84 c0 test %al,%al
39: 0f 85 4b 02 00 00 jne 0x28a
3f: 41 rex.B