==================================================================
BUG: KASAN: use-after-free in rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183
Read of size 2 at addr ffff88807b0f682a by task syz.3.1293/10248
CPU: 0 PID: 10248 Comm: syz.3.1293 Not tainted 6.1.140-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
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:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0x12f/0x220 kernel/softirq.c:661
irq_exit_rcu+0x5/0x20 kernel/softirq.c:673
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 00 ca c0 08 e8 eb 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:ffffc90003f57338 EFLAGS: 00000282
RAX: 79a29a4bc688c600 RBX: 0000000000000000 RCX: 79a29a4bc688c600
RDX: dffffc0000000000 RSI: ffffffff8a6c0000 RDI: ffffffff8abf1260
RBP: ffffc90003f57390 R08: dffffc0000000000 R09: ffffed10171c7549
R10: ffffed10171c7549 R11: 1ffff110171c7548 R12: ffff888079a2d940
R13: dffffc0000000000 R14: ffff888025ed0000 R15: ffff8880b8e3b510
context_switch kernel/sched/core.c:5247 [inline]
__schedule+0x10f1/0x40d0 kernel/sched/core.c:6561
schedule+0xb9/0x180 kernel/sched/core.c:6637
schedule_timeout+0x97/0x280 kernel/time/timer.c:1941
unix_wait_for_peer+0x1e5/0x2e0 net/unix/af_unix.c:1443
unix_dgram_sendmsg+0x102d/0x18d0 net/unix/af_unix.c:2022
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg net/socket.c:730 [inline]
____sys_sendmsg+0x59b/0x970 net/socket.c:2519
___sys_sendmsg+0x21c/0x290 net/socket.c:2573
__sys_sendmmsg+0x272/0x490 net/socket.c:2659
__do_sys_sendmmsg net/socket.c:2688 [inline]
__se_sys_sendmmsg net/socket.c:2685 [inline]
__x64_sys_sendmmsg+0x9c/0xb0 net/socket.c:2685
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
RIP: 0033:0x7fca3f18e969
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:00007fca3ff7d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000133
RAX: ffffffffffffffda RBX: 00007fca3f3b5fa0 RCX: 00007fca3f18e969
RDX: 0000000000000651 RSI: 0000200000000000 RDI: 0000000000000004
RBP: 00007fca3f210ab1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fca3f3b5fa0 R15: 00007ffce75b4438
Allocated by task 4304:
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]
batadv_forw_packet_alloc+0x1e5/0x380 net/batman-adv/send.c:519
batadv_iv_ogm_aggregate_new net/batman-adv/bat_iv_ogm.c:562 [inline]
batadv_iv_ogm_queue_add+0x77b/0xcf0 net/batman-adv/bat_iv_ogm.c:670
batadv_iv_ogm_schedule_buff net/batman-adv/bat_iv_ogm.c:849 [inline]
batadv_iv_ogm_schedule+0xaaf/0xe90 net/batman-adv/bat_iv_ogm.c:868
batadv_iv_send_outstanding_bat_ogm_packet+0x72d/0x840 net/batman-adv/bat_iv_ogm.c:1712
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
Freed by task 47:
kasan_save_stack mm/kasan/common.c:45 [inline]
kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516
____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
kasan_slab_free include/linux/kasan.h:177 [inline]
slab_free_hook mm/slub.c:1724 [inline]
slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1750
slab_free mm/slub.c:3661 [inline]
__kmem_cache_free+0xb6/0x1f0 mm/slub.c:3674
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
Last potentially related work creation:
kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
__kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
insert_work+0x54/0x3c0 kernel/workqueue.c:1361
__queue_work+0xba3/0xfb0 kernel/workqueue.c:1520
call_timer_fn+0x1a0/0x670 kernel/time/timer.c:1504
expire_timers kernel/time/timer.c:1544 [inline]
__run_timers+0x550/0x7c0 kernel/time/timer.c:1820
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1833
handle_softirqs+0x2a1/0x920 kernel/softirq.c:578
__do_softirq kernel/softirq.c:612 [inline]
invoke_softirq kernel/softirq.c:452 [inline]
__irq_exit_rcu+0x12f/0x220 kernel/softirq.c:661
irq_exit_rcu+0x5/0x20 kernel/softirq.c:673
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
The buggy address belongs to the object at ffff88807b0f6800
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 42 bytes inside of
512-byte region [ffff88807b0f6800, ffff88807b0f6a00)
The buggy address belongs to the physical page:
page:ffffea0001ec3d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807b0f4000 pfn:0x7b0f4
head:ffffea0001ec3d00 order:2 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000a13f08 ffffea0001dbc308 ffff888017441c80
raw: ffff88807b0f4000 000000000010000e 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 0x52a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 4262, tgid 4262 (syz-executor), ts 83700513849, free_ts 80184527411
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:5606
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+0xa0/0x240 mm/slab_common.c:949
kmalloc include/linux/slab.h:568 [inline]
kzalloc include/linux/slab.h:699 [inline]
fib6_info_alloc+0x2e/0xe0 net/ipv6/ip6_fib.c:156
ip6_route_info_create+0x44f/0x1210 net/ipv6/route.c:3794
ip6_route_add+0x24/0x130 net/ipv6/route.c:3890
addrconf_prefix_route net/ipv6/addrconf.c:2443 [inline]
fixup_permanent_addr net/ipv6/addrconf.c:3549 [inline]
addrconf_permanent_addr+0x652/0x980 net/ipv6/addrconf.c:3573
addrconf_notify+0x986/0xf40 net/ipv6/addrconf.c:3645
notifier_call_chain kernel/notifier.c:87 [inline]
raw_notifier_call_chain+0xcb/0x160 kernel/notifier.c:455
call_netdevice_notifiers_extack net/core/dev.c:2039 [inline]
call_netdevice_notifiers net/core/dev.c:2053 [inline]
__dev_notify_flags+0x178/0x2d0 net/core/dev.c:-1
dev_change_flags+0xe3/0x1a0 net/core/dev.c:8702
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_slab mm/slub.c:2031 [inline]
discard_slab mm/slub.c:2037 [inline]
__unfreeze_partials+0x1a5/0x200 mm/slub.c:2586
put_cpu_partial+0x17c/0x250 mm/slub.c:2662
qlink_free mm/kasan/quarantine.c:168 [inline]
qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294
__kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305
kasan_slab_alloc include/linux/kasan.h:201 [inline]
slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
slab_alloc_node mm/slub.c:3398 [inline]
kmem_cache_alloc_node+0x14d/0x320 mm/slub.c:3443
__alloc_skb+0xfc/0x7e0 net/core/skbuff.c:505
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
genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
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
Memory state around the buggy address:
ffff88807b0f6700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807b0f6780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88807b0f6800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88807b0f6880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88807b0f6900: 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 00 ca c0 08 call 0x8c0ca20
20: e8 eb c1 2e 00 call 0x2ec210
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