==================================================================
BUG: KASAN: use-after-free in rose_timer_expiry+0x470/0x490 net/rose/rose_timer.c:183
Read of size 2 at addr ffff88805d05482a by task syz.0.877/7187
CPU: 1 PID: 7187 Comm: syz.0.877 Not tainted 5.15.189-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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:lock_acquire+0x1f2/0x3f0 kernel/locking/lockdep.c:5627
Code: 00 9c 8f 84 24 80 00 00 00 f6 84 24 81 00 00 00 02 0f 85 f6 00 00 00 41 f7 c6 00 02 00 00 74 01 fb 48 c7 44 24 60 0e 36 e0 45 <4b> c7 44 3d 00 00 00 00 00 66 43 c7 44 3d 09 00 00 43 c6 44 3d 0b
RSP: 0018:ffffc9000349f620 EFLAGS: 00000206
RAX: 0000000000000001 RBX: 0000000000000000 RCX: f0e43c46d9d62a00
RDX: 0000000000000000 RSI: ffffffff8a0b2860 RDI: ffffffff8a599340
RBP: ffffc9000349f738 R08: dffffc0000000000 R09: fffffbfff1ff6e19
R10: fffffbfff1ff6e19 R11: 1ffffffff1ff6e18 R12: ffff88807daf8558
R13: 1ffff92000693ed0 R14: 0000000000000246 R15: dffffc0000000000
__raw_spin_lock include/linux/spinlock_api_smp.h:142 [inline]
_raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154
spin_lock include/linux/spinlock.h:363 [inline]
filemap_map_pages+0xb7d/0x1390 mm/filemap.c:3324
do_fault_around mm/memory.c:4243 [inline]
do_read_fault mm/memory.c:4258 [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+0x2580/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:0x7fa2ff9cbbe9
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:00007fa2fdc33038 EFLAGS: 00000246 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 00007fa2ffbf2fa0 RCX: 00007fa2ff9cbbe9
RDX: b635773f06ebbeef RSI: 0000000000b36000 RDI: 0000200000000000
RBP: 00007fa2ffa4ee19 R08: ffffffffffffffff R09: 0000000000000000
R10: 0000000000008031 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa2ffbf3038 R14: 00007fa2ffbf2fa0 R15: 00007ffc678505f8
Allocated by task 4175:
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_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
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]
kmem_cache_alloc+0x100/0x290 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:725 [inline]
__alloc_file+0x25/0x240 fs/file_table.c:132
alloc_empty_file+0x90/0x180 fs/file_table.c:181
path_openat+0xfc/0x2f30 fs/namei.c:3728
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
Freed by task 14:
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]
kmem_cache_free+0x8f/0x210 mm/slub.c:3515
rcu_do_batch kernel/rcu/tree.c:2523 [inline]
rcu_core+0x962/0x15d0 kernel/rcu/tree.c:2763
handle_softirqs+0x328/0x820 kernel/softirq.c:576
run_ksoftirqd+0x98/0xf0 kernel/softirq.c:943
smpboot_thread_fn+0x4f6/0x970 kernel/smpboot.c:164
kthread+0x436/0x520 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
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:3011 [inline]
call_rcu+0x182/0x930 kernel/rcu/tree.c:3091
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
Second to 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
task_work_add+0x2f/0x1d0 kernel/task_work.c:38
fput_many+0xde/0x1a0 fs/file_table.c:367
path_openat+0x2974/0x2f30 fs/namei.c:3751
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 ffff88805d054780
which belongs to the cache filp of size 464
The buggy address is located 170 bytes inside of
464-byte region [ffff88805d054780, ffff88805d054950)
The buggy address belongs to the page:
page:ffffea0001741500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5d054
head:ffffea0001741500 order:1 compound_mapcount:0
memcg:ffff88807e083981
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff8880169e98c0
raw: 0000000000000000 00000000000c000c 00000001ffffffff ffff88807e083981
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 4175, ts 249204249852, free_ts 246201536154
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]
kmem_cache_alloc+0x195/0x290 mm/slub.c:3233
kmem_cache_zalloc include/linux/slab.h:725 [inline]
__alloc_file+0x25/0x240 fs/file_table.c:132
alloc_empty_file+0x90/0x180 fs/file_table.c:181
path_openat+0xfc/0x2f30 fs/namei.c:3728
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
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
kasan_depopulate_vmalloc_pte+0x67/0x80 mm/kasan/shadow.c:375
apply_to_pte_range mm/memory.c:2573 [inline]
apply_to_pmd_range mm/memory.c:2617 [inline]
apply_to_pud_range mm/memory.c:2653 [inline]
apply_to_p4d_range mm/memory.c:2689 [inline]
__apply_to_page_range+0x95c/0xc80 mm/memory.c:2725
kasan_release_vmalloc+0x93/0xb0 mm/kasan/shadow.c:485
__purge_vmap_area_lazy+0xc6e/0x18f0 mm/vmalloc.c:1704
_vm_unmap_aliases+0x410/0x4a0 mm/vmalloc.c:2107
change_page_attr_set_clr+0x311/0xc10 arch/x86/mm/pat/set_memory.c:1740
change_page_attr_clear arch/x86/mm/pat/set_memory.c:1797 [inline]
set_memory_ro+0x89/0xd0 arch/x86/mm/pat/set_memory.c:1943
bpf_jit_binary_lock_ro include/linux/filter.h:899 [inline]
bpf_int_jit_compile+0xc4a8/0xcc80 arch/x86/net/bpf_jit_comp.c:2478
bpf_prog_select_runtime+0x74f/0xaa0 kernel/bpf/core.c:1934
bpf_migrate_filter net/core/filter.c:1307 [inline]
bpf_prepare_filter+0x1014/0x11c0 net/core/filter.c:1355
sk_attach_filter+0x20/0x140 net/core/filter.c:1539
sock_setsockopt+0x14f3/0x2270 net/core/sock.c:1168
__sys_setsockopt+0x2f6/0x3d0 net/socket.c:2199
__do_sys_setsockopt net/socket.c:2214 [inline]
__se_sys_setsockopt net/socket.c:2211 [inline]
__x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2211
Memory state around the buggy address:
ffff88805d054700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88805d054780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805d054800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88805d054880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88805d054900: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
0: 00 9c 8f 84 24 80 00 add %bl,0x802484(%rdi,%rcx,4)
7: 00 00 add %al,(%rax)
9: f6 84 24 81 00 00 00 testb $0x2,0x81(%rsp)
10: 02
11: 0f 85 f6 00 00 00 jne 0x10d
17: 41 f7 c6 00 02 00 00 test $0x200,%r14d
1e: 74 01 je 0x21
20: fb sti
21: 48 c7 44 24 60 0e 36 movq $0x45e0360e,0x60(%rsp)
28: e0 45
* 2a: 4b c7 44 3d 00 00 00 movq $0x0,0x0(%r13,%r15,1) <-- trapping instruction
31: 00 00
33: 66 43 c7 44 3d 09 00 movw $0x0,0x9(%r13,%r15,1)
3a: 00
3b: 43 rex.XB
3c: c6 .byte 0xc6
3d: 44 rex.R
3e: 3d .byte 0x3d
3f: 0b .byte 0xb