================================================================== BUG: KASAN: use-after-free in rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183 Read of size 2 at addr ffff88805733642a by task kworker/u4:6/4342 CPU: 1 PID: 4342 Comm: kworker/u4:6 Not tainted 6.1.142-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Workqueue: loop3 loop_workfn Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x220 mm/kasan/report.c:427 kasan_report+0x10b/0x140 mm/kasan/report.c:531 rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183 call_timer_fn+0x1a0/0x670 kernel/time/timer.c:1504 expire_timers kernel/time/timer.c:1549 [inline] __run_timers+0x525/0x7c0 kernel/time/timer.c:1820 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833 handle_softirqs+0x2a1/0x920 kernel/softirq.c:596 __do_softirq kernel/softirq.c:630 [inline] invoke_softirq kernel/softirq.c:470 [inline] __irq_exit_rcu+0x12f/0x220 kernel/softirq.c:679 irq_exit_rcu+0x5/0x20 kernel/softirq.c:691 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1118 [inline] sysvec_apic_timer_interrupt+0xa0/0xc0 arch/x86/kernel/apic/apic.c:1118 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:691 RIP: 0010:finish_task_switch+0x26a/0x8f0 kernel/sched/core.c:5123 Code: 0f 84 3b 01 00 00 48 85 db 0f 85 5a 01 00 00 0f 1f 44 00 00 4c 8b 75 d0 4c 89 e7 e8 30 68 c1 08 e8 8b c1 2e 00 fb 4c 8b 65 c0 <49> 8d bc 24 f8 15 00 00 48 89 f8 48 c1 e8 03 42 0f b6 04 28 84 c0 RSP: 0018:ffffc90004977658 EFLAGS: 00000282 RAX: 824b033d14f71a00 RBX: 0000000000000000 RCX: 824b033d14f71a00 RDX: dffffc0000000000 RSI: ffffffff8a6bffe0 RDI: ffffffff8abf14a0 RBP: ffffc900049776b0 R08: dffffc0000000000 R09: fffffbfff2117269 R10: fffffbfff2117269 R11: 1ffffffff2117268 R12: ffff88801a323b80 R13: dffffc0000000000 R14: ffff888024021dc0 R15: ffff8880b8f3b550 context_switch kernel/sched/core.c:5247 [inline] __schedule+0x10f1/0x40d0 kernel/sched/core.c:6561 preempt_schedule_common+0x82/0xd0 kernel/sched/core.c:6730 preempt_schedule+0xa7/0xb0 kernel/sched/core.c:6754 preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34 blk_mq_raise_softirq block/blk-mq.c:1196 [inline] blk_mq_complete_request_remote+0x523/0x690 block/blk-mq.c:1218 blk_mq_complete_request+0x15/0xa0 block/blk-mq.c:1234 loop_handle_cmd drivers/block/loop.c:1924 [inline] loop_process_work+0x17c8/0x1e40 drivers/block/loop.c:1942 process_one_work+0x898/0x1160 kernel/workqueue.c:2292 worker_thread+0xaa2/0x1250 kernel/workqueue.c:2439 kthread+0x29d/0x330 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 7476: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x8e/0xa0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] kernfs_fop_open+0x3f1/0xcc0 fs/kernfs/file.c:672 do_dentry_open+0x7e9/0x10d0 fs/open.c:882 do_open fs/namei.c:3626 [inline] path_openat+0x25c6/0x2e70 fs/namei.c:3783 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810 do_sys_openat2+0x142/0x490 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __x64_sys_openat+0x135/0x160 fs/open.c:1345 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888057336400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 42 bytes inside of 512-byte region [ffff888057336400, ffff888057336600) The buggy address belongs to the physical page: page:ffffea00015ccd00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888057337c00 pfn:0x57334 head:ffffea00015ccd00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001eec608 ffffea0000b50608 ffff888017441c80 raw: ffff888057337c00 0000000000100002 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 4253, tgid 4253 (syz-executor), ts 77479473155, free_ts 21886080333 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 alloc_slab_page+0x5d/0x160 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x87/0x2c0 mm/slub.c:1992 ___slab_alloc+0xbc6/0x1220 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x1a0/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node_track_caller+0x9e/0x230 mm/slab_common.c:956 kmalloc_reserve net/core/skbuff.c:446 [inline] __alloc_skb+0x22a/0x7e0 net/core/skbuff.c:515 alloc_skb include/linux/skbuff.h:1271 [inline] nlmsg_new include/net/netlink.h:991 [inline] netlink_ack+0x372/0x1100 net/netlink/af_netlink.c:2430 netlink_rcv_skb+0x263/0x420 net/netlink/af_netlink.c:2499 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline] netlink_unicast+0x74c/0x8c0 net/netlink/af_netlink.c:1337 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1859 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] __sys_sendto+0x44f/0x5c0 net/socket.c:2153 __do_sys_sendto net/socket.c:2165 [inline] __se_sys_sendto net/socket.c:2161 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2161 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] free_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479 free_contig_range+0x9d/0x150 mm/page_alloc.c:9574 destroy_args+0xef/0x8bf mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x32a/0x37e mm/debug_vm_pgtable.c:1354 do_one_initcall+0x214/0x7a0 init/main.c:1298 do_initcall_level+0x137/0x1e4 init/main.c:1371 do_initcalls+0x4b/0x8a init/main.c:1387 kernel_init_freeable+0x3fa/0x5ac init/main.c:1626 kernel_init+0x19/0x1b0 init/main.c:1514 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff888057336300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888057336380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888057336400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888057336480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057336500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 0f 84 3b 01 00 00 je 0x141 6: 48 85 db test %rbx,%rbx 9: 0f 85 5a 01 00 00 jne 0x169 f: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1) 14: 4c 8b 75 d0 mov -0x30(%rbp),%r14 18: 4c 89 e7 mov %r12,%rdi 1b: e8 30 68 c1 08 call 0x8c16850 20: e8 8b c1 2e 00 call 0x2ec1b0 25: fb sti 26: 4c 8b 65 c0 mov -0x40(%rbp),%r12 * 2a: 49 8d bc 24 f8 15 00 lea 0x15f8(%r12),%rdi <-- trapping instruction 31: 00 32: 48 89 f8 mov %rdi,%rax 35: 48 c1 e8 03 shr $0x3,%rax 39: 42 0f b6 04 28 movzbl (%rax,%r13,1),%eax 3e: 84 c0 test %al,%al