================================================================== BUG: KASAN: use-after-free in rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183 Read of size 2 at addr ffff8880246aac2a by task syz.5.601/7158 CPU: 1 PID: 7158 Comm: syz.5.601 Not tainted 5.15.186-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 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 rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183 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:should_fail+0x0/0x4c0 lib/fault-inject.c:104 Code: 80 e1 07 80 c1 03 38 c1 0f 8c 6c ff ff ff 48 89 df e8 04 b3 c5 fd e9 5f ff ff ff 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 <55> 41 57 41 56 41 55 41 54 53 48 83 ec 18 49 89 f6 48 89 fb 49 bc RSP: 0018:ffffc9000340f108 EFLAGS: 00000283 RAX: 0000000000000001 RBX: 0000000001100cca RCX: 0000000000000000 RDX: ffff88802bb10000 RSI: 0000000000000001 RDI: ffffffff8c1dd2c0 RBP: 0000000000000001 R08: dffffc0000000000 R09: fffffbfff1ad1586 R10: fffffbfff1ad1586 R11: 1ffffffff1ad1585 R12: 0000000000000000 R13: ffff88802bb1002c R14: 0000000000000008 R15: 1ffff92000681e38 prepare_alloc_pages+0x1e4/0x5f0 mm/page_alloc.c:5250 __alloc_pages+0x10e/0x470 mm/page_alloc.c:5463 alloc_pages_vma+0x393/0x7c0 mm/mempolicy.c:2146 shmem_alloc_page mm/shmem.c:1586 [inline] shmem_alloc_and_acct_page+0x427/0xb70 mm/shmem.c:1611 shmem_getpage_gfp+0x14f4/0x2d40 mm/shmem.c:1906 shmem_fault+0x1a9/0x520 mm/shmem.c:2118 __do_fault+0x141/0x330 mm/memory.c:3928 do_read_fault mm/memory.c:4264 [inline] do_fault mm/memory.c:4392 [inline] handle_pte_fault mm/memory.c:4650 [inline] __handle_mm_fault mm/memory.c:4785 [inline] handle_mm_fault+0x2949/0x43c0 mm/memory.c:4883 faultin_page mm/gup.c:976 [inline] __get_user_pages+0x93e/0x11c0 mm/gup.c:1197 populate_vma_page_range+0x213/0x290 mm/gup.c:1529 __mm_populate+0x26f/0x3a0 mm/gup.c:1638 mm_populate include/linux/mm.h:2635 [inline] vm_mmap_pgoff+0x203/0x2b0 mm/util.c:556 ksys_mmap_pgoff+0x140/0x780 mm/mmap.c:1631 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 RIP: 0033:0x7fc320ebb929 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc31ed23038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009 RAX: ffffffffffffffda RBX: 00007fc3210e2fa0 RCX: 00007fc320ebb929 RDX: b635773f06ebbeee RSI: 0000000000b36000 RDI: 0000200000000000 RBP: 00007fc320f3db39 R08: ffffffffffffffff R09: 0000000000000000 R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fc3210e2fa0 R15: 00007ffe33e53f18 Allocated by task 6823: 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] snd_rawmidi_runtime_create sound/core/rawmidi.c:148 [inline] open_substream+0xaf/0x6c0 sound/core/rawmidi.c:306 rawmidi_open_priv+0x94/0x660 sound/core/rawmidi.c:352 snd_rawmidi_kernel_open+0x1a2/0x240 sound/core/rawmidi.c:392 midisynth_subscribe+0xd8/0x320 sound/core/seq/seq_midi.c:177 subscribe_port sound/core/seq/seq_ports.c:412 [inline] check_and_subscribe_port+0x669/0xb30 sound/core/seq/seq_ports.c:495 snd_seq_port_connect+0x1d4/0x430 sound/core/seq/seq_ports.c:576 snd_seq_ioctl_subscribe_port+0x32c/0x6f0 sound/core/seq/seq_clientmgr.c:1490 snd_seq_oss_midi_open+0x4c0/0x7c0 sound/core/seq/oss/seq_oss_midi.c:374 snd_seq_oss_midi_open_all+0x55/0xc0 sound/core/seq/oss/seq_oss_midi.c:301 snd_seq_oss_open+0x8df/0xe40 sound/core/seq/oss/seq_oss_init.c:263 odev_open+0x63/0x90 sound/core/seq/oss/seq_oss.c:128 chrdev_open+0x597/0x670 fs/char_dev.c:414 do_dentry_open+0x7ff/0xf80 fs/open.c:826 do_open fs/namei.c:3608 [inline] path_openat+0x2682/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1280 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 ffff8880246aac00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 42 bytes inside of 512-byte region [ffff8880246aac00, ffff8880246aae00) The buggy address belongs to the page: page:ffffea000091aa00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880246a8800 pfn:0x246a8 head:ffffea000091aa00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000184c008 ffffea0000947708 ffff888016841c80 raw: ffff8880246a8800 000000000010000b 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4170, ts 69573314395, free_ts 27037877355 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_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] kzalloc include/linux/slab.h:735 [inline] new_dir fs/proc/proc_sysctl.c:955 [inline] get_subdir fs/proc/proc_sysctl.c:1000 [inline] __register_sysctl_table+0xa1f/0x1230 fs/proc/proc_sysctl.c:1349 neigh_sysctl_register+0x9a1/0xa80 net/core/neighbour.c:3718 addrconf_sysctl_register+0xac/0x1b0 net/ipv6/addrconf.c:7150 ipv6_add_dev+0xbf3/0x1190 net/ipv6/addrconf.c:454 addrconf_notify+0x66f/0xf00 net/ipv6/addrconf.c:3582 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] register_netdevice+0x1275/0x16b0 net/core/dev.c:10428 veth_newlink+0x668/0xda0 drivers/net/veth.c:1683 __rtnl_newlink net/core/rtnetlink.c:3524 [inline] rtnl_newlink+0x114c/0x17d0 net/core/rtnetlink.c:3572 rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650 netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2489 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317 free_unref_page+0x94/0x280 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] __unfreeze_partials+0x1a5/0x200 mm/slub.c:2507 put_cpu_partial+0x12d/0x190 mm/slub.c:2587 qlist_free_all+0x35/0x90 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x150/0x160 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xd0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc+0x127/0x330 mm/slub.c:4403 kmalloc include/linux/slab.h:609 [inline] tomoyo_realpath_from_path+0x118/0x610 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_check_open_permission+0x183/0x360 security/tomoyo/file.c:771 security_file_open+0x5e/0xa0 security/security.c:1668 do_dentry_open+0x322/0xf80 fs/open.c:813 do_open fs/namei.c:3608 [inline] path_openat+0x2682/0x2f30 fs/namei.c:3742 do_filp_open+0x1b3/0x3e0 fs/namei.c:3769 do_sys_openat2+0x142/0x4a0 fs/open.c:1253 Memory state around the buggy address: ffff8880246aab00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880246aab80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880246aac00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880246aac80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880246aad00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 80 e1 07 and $0x7,%cl 3: 80 c1 03 add $0x3,%cl 6: 38 c1 cmp %al,%cl 8: 0f 8c 6c ff ff ff jl 0xffffff7a e: 48 89 df mov %rbx,%rdi 11: e8 04 b3 c5 fd call 0xfdc5b31a 16: e9 5f ff ff ff jmp 0xffffff7a 1b: 66 2e 0f 1f 84 00 00 cs nopw 0x0(%rax,%rax,1) 22: 00 00 00 25: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) * 2a: 55 push %rbp <-- trapping instruction 2b: 41 57 push %r15 2d: 41 56 push %r14 2f: 41 55 push %r13 31: 41 54 push %r12 33: 53 push %rbx 34: 48 83 ec 18 sub $0x18,%rsp 38: 49 89 f6 mov %rsi,%r14 3b: 48 89 fb mov %rdi,%rbx 3e: 49 rex.WB 3f: bc .byte 0xbc