================================================================== BUG: KASAN: use-after-free in ax25_heartbeat_expiry+0x10c/0x130 net/ax25/ax25_timer.c:125 Read of size 4 at addr ffff8880245eec50 by task kworker/0:1H/150 CPU: 0 PID: 150 Comm: kworker/0:1H Not tainted 5.15.185-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: events_highpri snd_vmidi_output_work Call Trace: dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106 print_address_description+0x60/0x2d0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xdf/0x130 mm/kasan/report.c:451 ax25_heartbeat_expiry+0x10c/0x130 net/ax25/ax25_timer.c:125 call_timer_fn+0x16c/0x530 kernel/time/timer.c:1451 expire_timers kernel/time/timer.c:1496 [inline] __run_timers+0x525/0x7c0 kernel/time/timer.c:1767 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780 handle_softirqs+0x328/0x820 kernel/softirq.c:576 __do_softirq kernel/softirq.c:610 [inline] invoke_softirq kernel/softirq.c:450 [inline] __irq_exit_rcu+0x12f/0x220 kernel/softirq.c:659 irq_exit_rcu+0x5/0x20 kernel/softirq.c:671 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline] sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1108 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0xa5/0x100 kernel/locking/spinlock.c:194 Code: 74 05 e8 3e 14 d3 f7 48 c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f6 44 24 21 02 75 4b f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 06 94 a6 f7 65 8b 05 a7 a3 57 76 85 c0 74 3c 48 c7 04 24 0e 36 RSP: 0018:ffffc900017afa60 EFLAGS: 00000206 RAX: b9b1805498026700 RBX: 0000000000000a02 RCX: b9b1805498026700 RDX: dffffc0000000000 RSI: ffffffff8a0b11c0 RDI: 0000000000000001 RBP: ffffc900017afae8 R08: dffffc0000000000 R09: fffffbfff1ff3640 R10: fffffbfff1ff3640 R11: 1ffffffff1ff363f R12: dffffc0000000000 R13: 0000000000000000 R14: ffff88806380e020 R15: 1ffff920002f5f4c spin_unlock_irqrestore include/linux/spinlock.h:418 [inline] snd_midi_event_encode_byte+0x7da/0xca0 sound/core/seq/seq_midi_event.c:239 snd_vmidi_output_work+0x1e8/0x400 sound/core/seq/seq_virmidi.c:153 process_one_work+0x863/0x1000 kernel/workqueue.c:2310 worker_thread+0xaa8/0x12a0 kernel/workqueue.c:2457 kthread+0x436/0x520 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 5866: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb5/0xf0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:604 [inline] kzalloc include/linux/slab.h:735 [inline] ax25_dev_device_up+0x50/0x580 net/ax25/ax25_dev.c:55 ax25_device_event+0x483/0x4f0 net/ax25/af_ax25.c:139 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:391 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline] call_netdevice_notifiers net/core/dev.c:2075 [inline] __dev_notify_flags+0x178/0x2d0 net/core/dev.c:-1 dev_change_flags+0xe3/0x1a0 net/core/dev.c:8929 dev_ifsioc+0x147/0xe70 net/core/dev_ioctl.c:324 dev_ioctl+0x55f/0xe50 net/core/dev_ioctl.c:587 sock_do_ioctl+0x222/0x2f0 net/socket.c:1154 sock_ioctl+0x4ed/0x6e0 net/socket.c:1257 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 7601: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xea/0x170 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0xef/0x2a0 mm/slub.c:4559 ax25_dev_put include/net/ax25.h:302 [inline] ax25_release+0x661/0x870 net/ax25/af_ax25.c:1062 __sock_release net/socket.c:649 [inline] sock_close+0xd5/0x240 net/socket.c:1336 __fput+0x234/0x930 fs/file_table.c:311 task_work_run+0x125/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x10f/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3d0 kernel/workqueue.c:1366 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559 queue_work include/linux/workqueue.h:512 [inline] loop_queue_work drivers/block/loop.c:1068 [inline] loop_queue_rq+0x9d8/0xac0 drivers/block/loop.c:2202 __blk_mq_issue_directly block/blk-mq.c:2014 [inline] __blk_mq_try_issue_directly+0x497/0x810 block/blk-mq.c:2070 blk_mq_try_issue_directly+0xaf/0x270 block/blk-mq.c:2101 blk_mq_submit_bio+0xf17/0x17b0 block/blk-mq.c:-1 __submit_bio+0x7bd/0x810 block/blk-core.c:917 __submit_bio_noacct_mq block/blk-core.c:997 [inline] submit_bio_noacct+0x5f1/0x6d0 block/blk-core.c:1027 submit_bio+0x2be/0x560 block/blk-core.c:1089 submit_bh fs/buffer.c:3062 [inline] block_read_full_page+0x8eb/0xd10 fs/buffer.c:2341 do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1 btrfs_read_dev_one_super+0x230/0x390 fs/btrfs/disk-io.c:3769 btrfs_read_dev_super fs/btrfs/disk-io.c:3800 [inline] open_ctree+0x960/0x3250 fs/btrfs/disk-io.c:3213 btrfs_fill_super+0x1c2/0x2e0 fs/btrfs/super.c:1387 btrfs_mount_root+0x857/0x8c0 fs/btrfs/super.c:1751 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 fc_mount fs/namespace.c:996 [inline] vfs_kern_mount+0xba/0x150 fs/namespace.c:1026 btrfs_mount+0x2d7/0xa50 fs/btrfs/super.c:1811 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x24a/0xa40 fs/namespace.c:3010 do_mount fs/namespace.c:3353 [inline] __do_sys_mount fs/namespace.c:3561 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3538 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Second to last potentially related work creation: kasan_save_stack+0x35/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xb8/0x100 mm/kasan/generic.c:348 insert_work+0x54/0x3d0 kernel/workqueue.c:1366 __queue_work+0x9c5/0xd50 kernel/workqueue.c:1532 queue_work_on+0x11d/0x1d0 kernel/workqueue.c:1559 queue_work include/linux/workqueue.h:512 [inline] loop_queue_work drivers/block/loop.c:1068 [inline] loop_queue_rq+0x9d8/0xac0 drivers/block/loop.c:2202 __blk_mq_issue_directly block/blk-mq.c:2014 [inline] __blk_mq_try_issue_directly+0x497/0x810 block/blk-mq.c:2070 blk_mq_try_issue_directly+0xaf/0x270 block/blk-mq.c:2101 blk_mq_submit_bio+0xf17/0x17b0 block/blk-mq.c:-1 __submit_bio+0x7bd/0x810 block/blk-core.c:917 __submit_bio_noacct_mq block/blk-core.c:997 [inline] submit_bio_noacct+0x5f1/0x6d0 block/blk-core.c:1027 submit_bio+0x2be/0x560 block/blk-core.c:1089 submit_bh fs/buffer.c:3062 [inline] block_read_full_page+0x8eb/0xd10 fs/buffer.c:2341 do_read_cache_page+0x8a1/0x1030 mm/filemap.c:-1 btrfs_read_dev_one_super+0x230/0x390 fs/btrfs/disk-io.c:3769 btrfs_get_bdev_and_sb+0x16a/0x1e0 fs/btrfs/volumes.c:520 btrfs_open_one_device fs/btrfs/volumes.c:656 [inline] open_fs_devices+0x1cc/0xd10 fs/btrfs/volumes.c:1307 btrfs_mount_root+0x4e0/0x8c0 fs/btrfs/super.c:1725 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 fc_mount fs/namespace.c:996 [inline] vfs_kern_mount+0xba/0x150 fs/namespace.c:1026 btrfs_mount+0x2d7/0xa50 fs/btrfs/super.c:1811 legacy_get_tree+0xe6/0x180 fs/fs_context.c:611 vfs_get_tree+0x88/0x270 fs/super.c:1530 do_new_mount+0x24a/0xa40 fs/namespace.c:3010 do_mount fs/namespace.c:3353 [inline] __do_sys_mount fs/namespace.c:3561 [inline] __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3538 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff8880245eec00 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 80 bytes inside of 192-byte region [ffff8880245eec00, ffff8880245eecc0) The buggy address belongs to the page: page:ffffea0000917b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x245ee flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000200000001 ffff888016841a00 raw: 0000000000000000 0000000000100010 00000001ffffffff 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 0x12c00(GFP_NOIO|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 12970431760, free_ts 0 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5474 alloc_page_interleave+0x24/0x1e0 mm/mempolicy.c:2031 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xc0/0x4b0 mm/slub.c:1975 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0x1cd/0x330 mm/slub.c:4403 kmalloc include/linux/slab.h:609 [inline] usb_alloc_urb+0x3f/0x140 drivers/usb/core/urb.c:74 usb_internal_control_msg drivers/usb/core/message.c:95 [inline] usb_control_msg+0x115/0x3e0 drivers/usb/core/message.c:153 usb_control_msg_send drivers/usb/core/message.c:213 [inline] usb_set_configuration+0x1194/0x1fd0 drivers/usb/core/message.c:2106 usb_generic_driver_probe+0x89/0x150 drivers/usb/core/generic.c:238 usb_probe_device+0x139/0x270 drivers/usb/core/driver.c:293 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x284/0xc80 drivers/base/dd.c:595 __driver_probe_device+0x18c/0x330 drivers/base/dd.c:755 driver_probe_device+0x4f/0x420 drivers/base/dd.c:785 __device_attach_driver+0x2b0/0x500 drivers/base/dd.c:907 bus_for_each_drv+0x175/0x200 drivers/base/bus.c:429 page_owner free stack trace missing Memory state around the buggy address: ffff8880245eeb00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880245eeb80: 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880245eec00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880245eec80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880245eed00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ---------------- Code disassembly (best guess): 0: 74 05 je 0x7 2: e8 3e 14 d3 f7 call 0xf7d31445 7: 48 c7 44 24 20 00 00 movq $0x0,0x20(%rsp) e: 00 00 10: 9c pushf 11: 8f 44 24 20 pop 0x20(%rsp) 15: f6 44 24 21 02 testb $0x2,0x21(%rsp) 1a: 75 4b jne 0x67 1c: f7 c3 00 02 00 00 test $0x200,%ebx 22: 74 01 je 0x25 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 06 94 a6 f7 call 0xf7a69435 <-- trapping instruction 2f: 65 8b 05 a7 a3 57 76 mov %gs:0x7657a3a7(%rip),%eax # 0x7657a3dd 36: 85 c0 test %eax,%eax 38: 74 3c je 0x76 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 04 24 add $0x24,%al 3e: 0e (bad) 3f: 36 ss