==================================================================
BUG: KASAN: use-after-free in rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183
Read of size 2 at addr ffff8880223d002a by task syz.0.1312/9339
CPU: 1 PID: 9339 Comm: syz.0.1312 Not tainted 5.15.189-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:__debug_check_no_obj_freed lib/debugobjects.c:962 [inline]
RIP: 0010:debug_check_no_obj_freed+0x131/0x530 lib/debugobjects.c:1003
Code: 48 b9 eb 83 b5 80 46 86 c8 61 48 0f af c1 48 c1 e8 2f 83 e0 f8 48 8d 9c c0 80 76 26 96 48 8d bc c0 88 76 26 96 48 89 7c 24 10 aa c7 d2 05 48 89 44 24 08 48 89 d8 48 c1 e8 03 48 ba 00 00 00
RSP: 0018:ffffc900031bfa20 EFLAGS: 00000202
RAX: 000000000001de80 RBX: ffffffff96374900 RCX: 61c8864680b583eb
RDX: dffffc0000000000 RSI: ffffffff8a0b15c0 RDI: ffffffff96374908
RBP: 0000000000000000 R08: dffffc0000000000 R09: fffffbfff1ff6e1f
R10: fffffbfff1ff6e1f R11: 1ffffffff1ff6e1e R12: ffffc900156d0000
R13: ffffc900152d0000 R14: ffffc900153d8000 R15: 00000000000002f8
__vunmap+0x27e/0xa40 mm/vmalloc.c:2607
kcov_mmap+0x89/0x120 kernel/kcov.c:498
call_mmap include/linux/fs.h:2177 [inline]
mmap_file+0x5d/0xb0 mm/util.c:1092
__mmap_region mm/mmap.c:1792 [inline]
mmap_region+0xd0d/0x15e0 mm/mmap.c:2929
do_mmap+0x77a/0xdf0 mm/mmap.c:1582
vm_mmap_pgoff+0x1b2/0x2b0 mm/util.c:551
ksys_mmap_pgoff+0x542/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:0x7fae4670f9e3
Code: f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 41 89 ca 41 f7 c1 ff 0f 00 00 75 14 b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 25 c3 0f 1f 40 00 48 c7 c0 a8 ff ff ff 64 c7
RSP: 002b:00007ffed4893388 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fae469372d8 RCX: 00007fae4670f9e3
RDX: 0000000000000003 RSI: 0000000000400000 RDI: 00007fae44114000
RBP: 00007fae46937240 R08: 00000000000000db R09: 0000000000000000
R10: 0000000000000011 R11: 0000000000000246 R12: 00007fae46936fa0
R13: 00007fae46937240 R14: 0000000000001a5e R15: 0000000000000002
Allocated by task 7137:
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]
rose_add_node+0x227/0xdb0 net/rose/rose_route.c:85
rose_rt_ioctl+0x9db/0xe20 net/rose/rose_route.c:738
rose_ioctl+0x27a/0x790 net/rose/af_rose.c:1372
sock_do_ioctl+0xd3/0x2f0 net/socket.c:1140
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 9175:
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
rose_rt_device_down+0x4e2/0x530 net/rose/rose_route.c:515
rose_device_event+0x5ec/0x680 net/rose/af_rose.c:247
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
The buggy address belongs to the object at ffff8880223d0000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 42 bytes inside of
512-byte region [ffff8880223d0000, ffff8880223d0200)
The buggy address belongs to the page:
page:ffffea000088f400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x223d0
head:ffffea000088f400 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888016841c80
raw: 0000000000000000 0000000000100010 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4182, ts 66408426728, free_ts 63892790373
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]
__kmalloc_node_track_caller+0x1fc/0x3a0 mm/slub.c:4958
kmalloc_reserve net/core/skbuff.c:356 [inline]
pskb_expand_head+0x127/0x10f0 net/core/skbuff.c:1709
netlink_trim+0x180/0x220 net/netlink/af_netlink.c:1299
netlink_broadcast_filtered+0x7c/0x1170 net/netlink/af_netlink.c:1511
netlink_broadcast net/netlink/af_netlink.c:1556 [inline]
nlmsg_multicast include/net/netlink.h:1033 [inline]
nlmsg_notify+0xec/0x1a0 net/netlink/af_netlink.c:2550
fib_table_insert+0x987/0x1b20 net/ipv4/fib_trie.c:1379
fib_magic+0x2c1/0x390 net/ipv4/fib_frontend.c:1106
fib_add_ifaddr+0x389/0x5e0 net/ipv4/fib_frontend.c:1143
fib_netdev_event+0x35c/0x480 net/ipv4/fib_frontend.c:1488
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
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
__vunmap+0x8ab/0xa40 mm/vmalloc.c:2621
kcov_put kernel/kcov.c:417 [inline]
kcov_close+0x27/0x50 kernel/kcov.c:519
__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
Memory state around the buggy address:
ffff8880223cff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880223cff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880223d0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880223d0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880223d0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
vkms_vblank_simulate: vblank timer overrun
----------------
Code disassembly (best guess):
0: 48 b9 eb 83 b5 80 46 movabs $0x61c8864680b583eb,%rcx
7: 86 c8 61
a: 48 0f af c1 imul %rcx,%rax
e: 48 c1 e8 2f shr $0x2f,%rax
12: 83 e0 f8 and $0xfffffff8,%eax
15: 48 8d 9c c0 80 76 26 lea -0x69d98980(%rax,%rax,8),%rbx
1c: 96
1d: 48 8d bc c0 88 76 26 lea -0x69d98978(%rax,%rax,8),%rdi
24: 96
25: 48 89 7c 24 10 mov %rdi,0x10(%rsp)
* 2a: e8 aa c7 d2 05 call 0x5d2c7d9 <-- trapping instruction
2f: 48 89 44 24 08 mov %rax,0x8(%rsp)
34: 48 89 d8 mov %rbx,%rax
37: 48 c1 e8 03 shr $0x3,%rax
3b: 48 rex.W
3c: ba .byte 0xba
3d: 00 00 add %al,(%rax)