==================================================================
BUG: KASAN: slab-use-after-free in instrument_atomic_read include/linux/instrumented.h:68 [inline]
BUG: KASAN: slab-use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
BUG: KASAN: slab-use-after-free in snd_usbmidi_error_timer+0x15d/0x660 sound/usb/midi.c:355
Read of size 4 at addr ffff888026d1ff10 by task syz.2.56/6075
CPU: 1 UID: 0 PID: 6075 Comm: syz.2.56 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
Call Trace:
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:378 [inline]
print_report+0xca/0x240 mm/kasan/report.c:482
kasan_report+0x118/0x150 mm/kasan/report.c:595
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:189
instrument_atomic_read include/linux/instrumented.h:68 [inline]
atomic_read include/linux/atomic/atomic-instrumented.h:32 [inline]
snd_usbmidi_error_timer+0x15d/0x660 sound/usb/midi.c:355
call_timer_fn+0x17b/0x5f0 kernel/time/timer.c:1747
expire_timers kernel/time/timer.c:1798 [inline]
__run_timers kernel/time/timer.c:2372 [inline]
__run_timer_base+0x61a/0x860 kernel/time/timer.c:2384
run_timer_base kernel/time/timer.c:2393 [inline]
run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2403
handle_softirqs+0x283/0x870 kernel/softirq.c:579
__do_softirq kernel/softirq.c:613 [inline]
invoke_softirq kernel/softirq.c:453 [inline]
__irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680
irq_exit_rcu+0x9/0x30 kernel/softirq.c:696
instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline]
sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050
asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702
RIP: 0010:arch_test_and_set_bit arch/x86/include/asm/bitops.h:137 [inline]
RIP: 0010:arch_test_and_set_bit_lock arch/x86/include/asm/bitops.h:143 [inline]
RIP: 0010:test_and_set_bit_lock include/asm-generic/bitops/instrumented-lock.h:58 [inline]
RIP: 0010:folio_trylock include/linux/pagemap.h:1096 [inline]
RIP: 0010:next_uptodate_folio+0x38f/0x5d0 mm/filemap.c:3614
Code: 83 e6 01 31 ff e8 31 38 c8 ff 49 83 e5 01 0f 85 11 02 00 00 4c 89 e7 be 08 00 00 00 e8 4a b3 2b 00 31 f6 f0 49 0f ba 2c 24 00 <41> 0f 93 c5 40 0f 92 c6 bf 02 00 00 00 e8 1f 36 c8 ff 45 84 ed 75
RSP: 0000:ffffc9000466f9b8 EFLAGS: 00000246
RAX: ffffffff81f77a01 RBX: 00000000000000df RCX: ffffffff81f77a56
RDX: 0000000000000001 RSI: 0000000000000000 RDI: ffffea0001d22580
RBP: 1ffffd40003a44b1 R08: ffffea0001d22587 R09: 1ffffd40003a44b0
R10: dffffc0000000000 R11: fffff940003a44b1 R12: ffffea0001d22580
R13: 0000000000000000 R14: ffffea0001d22588 R15: ffffc9000466fb40
filemap_map_pages+0x102b/0x1740 mm/filemap.c:3789
do_fault_around mm/memory.c:5531 [inline]
do_read_fault mm/memory.c:5564 [inline]
do_fault mm/memory.c:5707 [inline]
do_pte_missing mm/memory.c:4234 [inline]
handle_pte_fault mm/memory.c:6052 [inline]
__handle_mm_fault+0x34ac/0x5440 mm/memory.c:6195
handle_mm_fault+0x40a/0x8e0 mm/memory.c:6364
do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1336
handle_page_fault arch/x86/mm/fault.c:1476 [inline]
exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
RIP: 0023:0xf706eb9b
Code: 24 14 83 e9 01 c1 e1 0e 89 f0 89 fa 0f ac fe 03 0f ac d0 06 8d 14 0b 89 f1 25 ff 3f 00 00 83 e1 07 01 d0 ba 01 00 00 00 d3 e2 <84> 90 20 20 00 00 0f 85 69 fd ff ff e9 0a fe ff ff e8 0f 3c fe ff
RSP: 002b:00000000f751f9e0 EFLAGS: 00010202
RAX: 000000000c30aa5b RBX: 000000000c230000 RCX: 0000000000000004
RDX: 0000000000000010 RSI: 00000000f03f52dc RDI: 00000000ffffffff
RBP: 00000000f7f25610 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Allocated by task 9:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:388 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405
kasan_kmalloc include/linux/kasan.h:260 [inline]
__do_kmalloc_node mm/slub.c:4376 [inline]
__kmalloc_noprof+0x27a/0x4f0 mm/slub.c:4388
kmalloc_noprof include/linux/slab.h:909 [inline]
usb_alloc_urb+0x46/0x150 drivers/usb/core/urb.c:75
snd_usbmidi_in_endpoint_create+0xb4/0xa30 sound/usb/midi.c:1348
snd_usbmidi_create_endpoints_midiman sound/usb/midi.c:2363 [inline]
__snd_usbmidi_create+0x2223/0x2a70 sound/usb/midi.c:2646
snd_usb_midi_v2_create+0x43e6/0x4660 sound/usb/midi2.c:1178
usb_audio_probe+0xb78/0x1e10 sound/usb/card.c:976
usb_probe_interface+0x668/0xc30 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26a/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x251/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
usb_set_configuration+0x1a87/0x20e0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250
usb_probe_device+0x1c4/0x390 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26a/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x251/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
usb_new_device+0xa39/0x16f0 drivers/usb/core/hub.c:2694
hub_port_connect drivers/usb/core/hub.c:5566 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5706 [inline]
port_event drivers/usb/core/hub.c:5870 [inline]
hub_event+0x2958/0x4a20 drivers/usb/core/hub.c:5952
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x70e/0x8a0 kernel/kthread.c:463
ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Freed by task 9:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576
poison_slab_object mm/kasan/common.c:243 [inline]
__kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275
kasan_slab_free include/linux/kasan.h:233 [inline]
slab_free_hook mm/slub.c:2422 [inline]
slab_free mm/slub.c:4695 [inline]
kfree+0x18e/0x440 mm/slub.c:4894
free_urb_and_buffer sound/usb/midi.c:1309 [inline]
snd_usbmidi_in_endpoint_delete+0xde/0x680 sound/usb/midi.c:1322
snd_usbmidi_free sound/usb/midi.c:1530 [inline]
snd_usbmidi_rawmidi_free+0xae/0x160 sound/usb/midi.c:1591
snd_rawmidi_free+0x3bc/0x410 sound/core/rawmidi.c:1934
snd_rawmidi_dev_free+0x38/0x50 sound/core/rawmidi.c:1945
__snd_device_free+0x1d2/0x2e0 sound/core/device.c:76
snd_device_free_all+0xcf/0x180 sound/core/device.c:233
snd_card_do_free sound/core/init.c:587 [inline]
release_card_device+0x75/0x1b0 sound/core/init.c:153
device_release+0x9c/0x1c0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x22b/0x480 lib/kobject.c:737
snd_card_free_when_closed sound/core/init.c:618 [inline]
snd_card_free+0x110/0x190 sound/core/init.c:650
usb_audio_probe+0x193f/0x1e10 sound/usb/card.c:1034
usb_probe_interface+0x668/0xc30 drivers/usb/core/driver.c:396
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26a/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x251/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
usb_set_configuration+0x1a87/0x20e0 drivers/usb/core/message.c:2210
usb_generic_driver_probe+0x8d/0x150 drivers/usb/core/generic.c:250
usb_probe_device+0x1c4/0x390 drivers/usb/core/driver.c:291
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x26a/0x9e0 drivers/base/dd.c:659
__driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:801
driver_probe_device+0x4f/0x430 drivers/base/dd.c:831
__device_attach_driver+0x2ce/0x530 drivers/base/dd.c:959
bus_for_each_drv+0x251/0x2e0 drivers/base/bus.c:462
__device_attach+0x2b8/0x400 drivers/base/dd.c:1031
bus_probe_device+0x185/0x260 drivers/base/bus.c:537
device_add+0x7b6/0xb50 drivers/base/core.c:3689
usb_new_device+0xa39/0x16f0 drivers/usb/core/hub.c:2694
hub_port_connect drivers/usb/core/hub.c:5566 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5706 [inline]
port_event drivers/usb/core/hub.c:5870 [inline]
hub_event+0x2958/0x4a20 drivers/usb/core/hub.c:5952
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x70e/0x8a0 kernel/kthread.c:463
ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
The buggy address belongs to the object at ffff888026d1ff00
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 16 bytes inside of
freed 192-byte region [ffff888026d1ff00, ffff888026d1ffc0)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x26d1f
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000000 ffff88801a4413c0 dead000000000100 dead000000000122
raw: 0000000000000000 0000000000100010 00000000f5000000 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1, tgid 1 (swapper/0), ts 9693441177, free_ts 9693107974
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851
prep_new_page mm/page_alloc.c:1859 [inline]
get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858
__alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148
alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
alloc_slab_page mm/slub.c:2492 [inline]
allocate_slab+0x8a/0x370 mm/slub.c:2660
new_slab mm/slub.c:2714 [inline]
___slab_alloc+0xbeb/0x1420 mm/slub.c:3901
__slab_alloc mm/slub.c:3992 [inline]
__slab_alloc_node mm/slub.c:4067 [inline]
slab_alloc_node mm/slub.c:4228 [inline]
__do_kmalloc_node mm/slub.c:4375 [inline]
__kvmalloc_node_noprof+0x429/0x5f0 mm/slub.c:5067
bucket_table_alloc lib/rhashtable.c:186 [inline]
rhashtable_init_noprof+0x4ee/0xbb0 lib/rhashtable.c:1075
rhltable_init_noprof+0x1e/0x60 lib/rhashtable.c:1104
sta_info_init+0x54/0x130 net/mac80211/sta_info.c:1623
ieee80211_alloc_hw_nm+0x7f0/0x1f20 net/mac80211/main.c:911
mac80211_hwsim_new_radio+0x1ee/0x5340 drivers/net/wireless/virtual/mac80211_hwsim.c:5195
init_mac80211_hwsim+0x45e/0x580 drivers/net/wireless/virtual/mac80211_hwsim.c:6920
do_one_initcall+0x233/0x820 init/main.c:1269
do_initcall_level+0x104/0x190 init/main.c:1331
do_initcalls+0x59/0xa0 init/main.c:1347
page last free pid 918 tgid 918 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
free_pages_prepare mm/page_alloc.c:1395 [inline]
__free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895
vfree+0x25a/0x400 mm/vmalloc.c:3434
delayed_vfree_work+0x55/0x80 mm/vmalloc.c:3353
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319
worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400
kthread+0x70e/0x8a0 kernel/kthread.c:463
ret_from_fork+0x439/0x7d0 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
Memory state around the buggy address:
ffff888026d1fe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888026d1fe80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888026d1ff00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888026d1ff80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff888026d20000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
----------------
Code disassembly (best guess):
0: 83 e6 01 and $0x1,%esi
3: 31 ff xor %edi,%edi
5: e8 31 38 c8 ff call 0xffc8383b
a: 49 83 e5 01 and $0x1,%r13
e: 0f 85 11 02 00 00 jne 0x225
14: 4c 89 e7 mov %r12,%rdi
17: be 08 00 00 00 mov $0x8,%esi
1c: e8 4a b3 2b 00 call 0x2bb36b
21: 31 f6 xor %esi,%esi
23: f0 49 0f ba 2c 24 00 lock btsq $0x0,(%r12)
* 2a: 41 0f 93 c5 setae %r13b <-- trapping instruction
2e: 40 0f 92 c6 setb %sil
32: bf 02 00 00 00 mov $0x2,%edi
37: e8 1f 36 c8 ff call 0xffc8365b
3c: 45 84 ed test %r13b,%r13b
3f: 75 .byte 0x75