==================================================================
BUG: KASAN: use-after-free in rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183
Read of size 2 at addr ffff88805f38382a by task syz.5.911/9240
CPU: 1 PID: 9240 Comm: syz.5.911 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:finish_lock_switch+0x134/0x280 kernel/sched/core.c:4785
Code: be ff ff ff ff e8 cc 3e 4e 08 85 c0 74 4a 4d 85 ff 75 66 0f 1f 44 00 00 48 89 df e8 c6 9a 57 08 e8 11 80 2a 00 fb 48 83 c4 08 <5b> 41 5c 41 5d 41 5e 41 5f 5d c3 48 89 df e8 99 10 fe ff 43 80 3c
RSP: 0018:ffffc90002f0f2c8 EFLAGS: 00000282
RAX: 866d74682379b400 RBX: ffff8880b913a300 RCX: 866d74682379b400
RDX: dffffc0000000000 RSI: ffffffff8a0b11c0 RDI: ffffffff8a59a900
RBP: 1ffff1101722760b R08: dffffc0000000000 R09: ffffed1017227461
R10: ffffed1017227461 R11: 1ffff11017227460 R12: 1ffff110172275b9
R13: dffffc0000000000 R14: ffff8880b913adc8 R15: 0000000000000000
finish_task_switch+0x12f/0x640 kernel/sched/core.c:4902
context_switch kernel/sched/core.c:5033 [inline]
__schedule+0x11c0/0x43b0 kernel/sched/core.c:6376
schedule+0x11b/0x1e0 kernel/sched/core.c:6459
schedule_timeout+0x97/0x280 kernel/time/timer.c:1890
unix_wait_for_peer+0x1e5/0x2e0 net/unix/af_unix.c:1304
unix_dgram_sendmsg+0x106f/0x1890 net/unix/af_unix.c:1899
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x5a2/0x8c0 net/socket.c:2436
___sys_sendmsg+0x1f0/0x260 net/socket.c:2490
__sys_sendmmsg+0x27c/0x4a0 net/socket.c:2576
__do_sys_sendmmsg net/socket.c:2605 [inline]
__se_sys_sendmmsg net/socket.c:2602 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2602
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:0x7f076d87f929
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:00007f076b6e7038 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007f076daa6fa0 RCX: 00007f076d87f929
RDX: 0000000000000651 RSI: 0000200000000000 RDI: 0000000000000004
RBP: 00007f076d901b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f076daa6fa0 R15: 00007ffdc093c3c8
Allocated by task 6446:
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:745
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 9012:
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+0x3e5/0x430 net/rose/rose_route.c:522
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
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
__call_rcu kernel/rcu/tree.c:3007 [inline]
call_rcu+0x179/0x920 kernel/rcu/tree.c:3087
fib6_info_release include/net/ip6_fib.h:339 [inline]
nsim_rt6_release drivers/net/netdevsim/fib.c:513 [inline]
nsim_fib6_event_fini+0xf5/0x1c0 drivers/net/netdevsim/fib.c:839
nsim_fib_event drivers/net/netdevsim/fib.c:889 [inline]
nsim_fib_event_work+0x3c3/0x3240 drivers/net/netdevsim/fib.c:1483
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
The buggy address belongs to the object at ffff88805f383800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 42 bytes inside of
512-byte region [ffff88805f383800, ffff88805f383a00)
The buggy address belongs to the page:
page:ffffea00017ce000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805f381000 pfn:0x5f380
head:ffffea00017ce000 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea000081ef08 ffffea0000883308 ffff888016841c80
raw: ffff88805f381000 000000000010000f 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 4178, ts 55584615720, free_ts 16407829146
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]
fib6_info_alloc+0x2e/0xe0 net/ipv6/ip6_fib.c:155
ip6_route_info_create+0x44f/0x1210 net/ipv6/route.c:3769
ip6_route_add+0x24/0x130 net/ipv6/route.c:3865
addrconf_add_mroute net/ipv6/addrconf.c:2511 [inline]
addrconf_add_dev+0x250/0x350 net/ipv6/addrconf.c:2529
inet6_addr_add+0x18d/0x9c0 net/ipv6/addrconf.c:2967
inet6_rtm_newaddr+0x5d7/0x840 net/ipv6/addrconf.c:4957
rtnetlink_rcv_msg+0x9b9/0xe60 net/core/rtnetlink.c:5650
netlink_rcv_skb+0x1e0/0x430 net/netlink/af_netlink.c:2489
netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
netlink_unicast+0x77c/0x920 net/netlink/af_netlink.c:1337
netlink_sendmsg+0x8ab/0xbc0 net/netlink/af_netlink.c:1905
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
__sys_sendto+0x423/0x580 net/socket.c:2063
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_contig_range+0x96/0xf0 mm/page_alloc.c:9393
destroy_args+0xef/0x8b0 mm/debug_vm_pgtable.c:1018
debug_vm_pgtable+0x318/0x370 mm/debug_vm_pgtable.c:1331
do_one_initcall+0x1ee/0x680 init/main.c:1302
do_initcall_level+0x137/0x1f0 init/main.c:1375
do_initcalls+0x4b/0x90 init/main.c:1391
kernel_init_freeable+0x3ce/0x560 init/main.c:1615
kernel_init+0x19/0x1b0 init/main.c:1506
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
Memory state around the buggy address:
ffff88805f383700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88805f383780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88805f383800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88805f383880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805f383900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: be ff ff ff ff mov $0xffffffff,%esi
5: e8 cc 3e 4e 08 call 0x84e3ed6
a: 85 c0 test %eax,%eax
c: 74 4a je 0x58
e: 4d 85 ff test %r15,%r15
11: 75 66 jne 0x79
13: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
18: 48 89 df mov %rbx,%rdi
1b: e8 c6 9a 57 08 call 0x8579ae6
20: e8 11 80 2a 00 call 0x2a8036
25: fb sti
26: 48 83 c4 08 add $0x8,%rsp
* 2a: 5b pop %rbx <-- trapping instruction
2b: 41 5c pop %r12
2d: 41 5d pop %r13
2f: 41 5e pop %r14
31: 41 5f pop %r15
33: 5d pop %rbp
34: c3 ret
35: 48 89 df mov %rbx,%rdi
38: e8 99 10 fe ff call 0xfffe10d6
3d: 43 rex.XB
3e: 80 .byte 0x80
3f: 3c .byte 0x3c