syzbot


KASAN: slab-use-after-free Read in rose_timer_expiry

Status: upstream: reported on 2025/07/09 17:47
Reported-by: syzbot+5f4d957714be889a3ee2@syzkaller.appspotmail.com
First crash: 2d06h, last: 2d06h
Similar bugs (5)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in rose_timer_expiry (3) hams 19 739 11h27m 53d 0/29 upstream: reported on 2025/05/19 14:23
upstream KASAN: slab-use-after-free Read in rose_timer_expiry (2) hams 19 158 58d 182d 28/29 fixed on 2025/05/14 23:24
upstream KASAN: slab-use-after-free Read in rose_timer_expiry hams 19 5 423d 433d 0/29 closed as invalid on 2024/06/04 18:05
linux-5.15 KASAN: use-after-free Read in rose_timer_expiry 19 72 10h50m 70d 0/3 upstream: reported on 2025/05/02 15:02
linux-6.1 KASAN: use-after-free Read in rose_timer_expiry 19 27 3h14m 69d 0/3 upstream: reported on 2025/05/03 12:30

Sample crash report:
==================================================================
BUG: KASAN: slab-use-after-free in rose_timer_expiry+0x46a/0x4b0 net/rose/rose_timer.c:183
Read of size 2 at addr ffff888067cbb02a by task syz.1.3063/17557

CPU: 1 PID: 17557 Comm: syz.1.3063 Not tainted 6.6.96-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <IRQ>
 dump_stack_lvl+0x16c/0x230 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0xac/0x230 mm/kasan/report.c:475
 kasan_report+0x117/0x150 mm/kasan/report.c:588
 rose_timer_expiry+0x46a/0x4b0 net/rose/rose_timer.c:183
 call_timer_fn+0x16e/0x530 kernel/time/timer.c:1700
 expire_timers kernel/time/timer.c:1751 [inline]
 __run_timers+0x52d/0x7d0 kernel/time/timer.c:2022
 run_timer_softirq+0x67/0xf0 kernel/time/timer.c:2035
 handle_softirqs+0x280/0x820 kernel/softirq.c:578
 __do_softirq kernel/softirq.c:612 [inline]
 invoke_softirq kernel/softirq.c:452 [inline]
 __irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661
 irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0xa9/0x110 kernel/locking/spinlock.c:194
Code: 74 05 e8 3a e8 13 f7 48 c7 44 24 20 00 00 00 00 9c 8f 44 24 20 f6 44 24 21 02 75 4b f7 c3 00 02 00 00 74 01 fb bf 01 00 00 00 <e8> 82 52 e3 f6 65 8b 05 93 a8 8b 75 85 c0 74 3c 48 c7 04 24 0e 36
RSP: 0018:ffffc9000480f740 EFLAGS: 00000206
RAX: c92ba00d15cdf900 RBX: 0000000000000a02 RCX: c92ba00d15cdf900
RDX: dffffc0000000000 RSI: ffffffff8aaab2c0 RDI: 0000000000000001
RBP: ffffc9000480f7c0 R08: ffffffff8e4a7faf R09: 1ffffffff1c94ff5
R10: dffffc0000000000 R11: fffffbfff1c94ff6 R12: dffffc0000000000
R13: 0000000025c00001 R14: ffff8880b8f297c0 R15: 1ffff92000901ee8
 __try_to_del_timer_sync+0x1d4/0x280 kernel/time/timer.c:1421
 __timer_delete_sync+0x1ff/0x2c0 kernel/time/timer.c:1573
 timer_delete_sync kernel/time/timer.c:1628 [inline]
 del_timer_sync include/linux/timer.h:200 [inline]
 schedule_timeout+0x16a/0x280 kernel/time/timer.c:2168
 snd_rawmidi_write+0x398/0xb10 sound/core/rawmidi.c:1674
 do_loop_readv_writev fs/read_write.c:-1 [inline]
 do_iter_write+0x50e/0xc70 fs/read_write.c:862
 vfs_writev fs/read_write.c:933 [inline]
 do_writev+0x252/0x410 fs/read_write.c:976
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f734fb8e929
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:00007f7350959038 EFLAGS: 00000246 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007f734fdb5fa0 RCX: 00007f734fb8e929
RDX: 0000000000000002 RSI: 0000200000000840 RDI: 0000000000000005
RBP: 00007f734fc10b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f734fdb5fa0 R15: 00007ffc510e9398
 </TASK>

Allocated by task 17557:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 ____kasan_kmalloc mm/kasan/common.c:374 [inline]
 __kasan_kmalloc+0x8f/0xa0 mm/kasan/common.c:383
 kmalloc include/linux/slab.h:600 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 alloc_workqueue+0x151/0x13c0 kernel/workqueue.c:4717
 xfs_pwork_init+0xff/0x3a0 fs/xfs/xfs_pwork.c:74
 xfs_iwalk_threaded+0x114/0x650 fs/xfs/xfs_iwalk.c:656
 xfs_qm_quotacheck+0x2aa/0x6b0 fs/xfs/xfs_qm.c:1337
 xfs_qm_mount_quotas+0x33e/0x600 fs/xfs/xfs_qm.c:1473
 xfs_mountfs+0x1641/0x1d20 fs/xfs/xfs_mount.c:962
 xfs_fs_fill_super+0x112f/0x13a0 fs/xfs/xfs_super.c:1738
 get_tree_bdev+0x3e4/0x510 fs/super.c:1591
 vfs_get_tree+0x8c/0x280 fs/super.c:1764
 do_new_mount+0x24b/0xa40 fs/namespace.c:3366
 do_mount fs/namespace.c:3706 [inline]
 __do_sys_mount fs/namespace.c:3915 [inline]
 __se_sys_mount+0x2da/0x3c0 fs/namespace.c:3892
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 15237:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4e/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:522
 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:164 [inline]
 slab_free_hook mm/slub.c:1806 [inline]
 slab_free_freelist_hook+0x130/0x1b0 mm/slub.c:1832
 slab_free mm/slub.c:3816 [inline]
 __kmem_cache_free+0xba/0x1f0 mm/slub.c:3829
 rcu_do_batch kernel/rcu/tree.c:2194 [inline]
 rcu_core+0xcc4/0x1720 kernel/rcu/tree.c:2467
 handle_softirqs+0x280/0x820 kernel/softirq.c:578
 __do_softirq kernel/softirq.c:612 [inline]
 invoke_softirq kernel/softirq.c:452 [inline]
 __irq_exit_rcu+0xc7/0x190 kernel/softirq.c:661
 irq_exit_rcu+0x9/0x20 kernel/softirq.c:673
 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1088 [inline]
 sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1088
 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:687

Last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
 __call_rcu_common kernel/rcu/tree.c:2717 [inline]
 call_rcu+0x14f/0x920 kernel/rcu/tree.c:2833
 kthread_worker_fn+0x4d4/0xa90 kernel/kthread.c:843
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Second to last potentially related work creation:
 kasan_save_stack+0x3e/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:492
 kvfree_call_rcu+0xee/0x780 kernel/rcu/tree.c:3448
 ipv6_mc_destroy_dev+0x3c1/0x590 net/ipv6/mcast.c:2815
 addrconf_ifdown+0x139f/0x1880 net/ipv6/addrconf.c:3974
 addrconf_notify+0x6c6/0x1010 net/ipv6/addrconf.c:-1
 notifier_call_chain+0x197/0x390 kernel/notifier.c:93
 call_netdevice_notifiers_extack net/core/dev.c:2064 [inline]
 call_netdevice_notifiers net/core/dev.c:2078 [inline]
 unregister_netdevice_many_notify+0xf36/0x1810 net/core/dev.c:11074
 unregister_netdevice_many net/core/dev.c:11130 [inline]
 default_device_exit_batch+0x9cb/0xa60 net/core/dev.c:11608
 ops_exit_list net/core/net_namespace.c:178 [inline]
 cleanup_net+0x77f/0xb90 net/core/net_namespace.c:652
 process_one_work kernel/workqueue.c:2634 [inline]
 process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

The buggy address belongs to the object at ffff888067cbb000
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 42 bytes inside of
 freed 512-byte region [ffff888067cbb000, ffff888067cbb200)

The buggy address belongs to the physical page:
page:ffffea00019f2e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x67cb8
head:ffffea00019f2e00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0
anon flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017841c80 0000000000000000 dead000000000001
raw: 0000000000000000 0000000080100010 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 1128, tgid 1128 (kworker/u4:8), ts 134107379422, free_ts 118630262759
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x1cd/0x210 mm/page_alloc.c:1554
 prep_new_page mm/page_alloc.c:1561 [inline]
 get_page_from_freelist+0x195c/0x19f0 mm/page_alloc.c:3191
 __alloc_pages+0x1e3/0x460 mm/page_alloc.c:4457
 alloc_slab_page+0x5d/0x170 mm/slub.c:1876
 allocate_slab mm/slub.c:2023 [inline]
 new_slab+0x87/0x2e0 mm/slub.c:2076
 ___slab_alloc+0xc6d/0x12f0 mm/slub.c:3230
 __slab_alloc mm/slub.c:3329 [inline]
 __slab_alloc_node mm/slub.c:3382 [inline]
 slab_alloc_node mm/slub.c:3475 [inline]
 __kmem_cache_alloc_node+0x1a2/0x260 mm/slub.c:3524
 __do_kmalloc_node mm/slab_common.c:1006 [inline]
 __kmalloc+0xa4/0x240 mm/slab_common.c:1020
 kmalloc include/linux/slab.h:604 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 fib6_info_alloc+0x32/0xe0 net/ipv6/ip6_fib.c:155
 ip6_route_info_create+0x44f/0x1200 net/ipv6/route.c:3793
 addrconf_f6i_alloc+0x1c6/0x400 net/ipv6/route.c:4621
 ipv6_add_addr+0x576/0x1090 net/ipv6/addrconf.c:1129
 addrconf_add_linklocal+0x289/0x6b0 net/ipv6/addrconf.c:3285
 addrconf_addr_gen+0x4ac/0x5a0 net/ipv6/addrconf.c:3416
 addrconf_init_auto_addrs+0x719/0xb40 net/ipv6/addrconf.c:-1
 addrconf_notify+0xb62/0x1010 net/ipv6/addrconf.c:3718
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1154 [inline]
 free_unref_page_prepare+0x7ce/0x8e0 mm/page_alloc.c:2336
 free_unref_page+0x32/0x2e0 mm/page_alloc.c:2429
 kasan_depopulate_vmalloc_pte+0x75/0x90 mm/kasan/shadow.c:427
 apply_to_pte_range mm/memory.c:2603 [inline]
 apply_to_pmd_range mm/memory.c:2647 [inline]
 apply_to_pud_range mm/memory.c:2683 [inline]
 apply_to_p4d_range mm/memory.c:2719 [inline]
 __apply_to_page_range+0x84c/0xd50 mm/memory.c:2755
 kasan_release_vmalloc+0x97/0xb0 mm/kasan/shadow.c:544
 __purge_vmap_area_lazy+0x1640/0x1990 mm/vmalloc.c:1770
 drain_vmap_area_work+0x40/0xd0 mm/vmalloc.c:1804
 process_one_work kernel/workqueue.c:2634 [inline]
 process_scheduled_works+0xa45/0x15b0 kernel/workqueue.c:2711
 worker_thread+0xa55/0xfc0 kernel/workqueue.c:2792
 kthread+0x2fa/0x390 kernel/kthread.c:388
 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152
 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293

Memory state around the buggy address:
 ffff888067cbaf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888067cbaf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888067cbb000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff888067cbb080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888067cbb100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
   0:	74 05                	je     0x7
   2:	e8 3a e8 13 f7       	call   0xf713e841
   7:	48 c7 44 24 20 00 00 	movq   $0x0,0x20(%rsp)
   e:	00 00
  10:	9c                   	pushf
  11:	8f 44 24 20          	pop    0x20(%rsp)
  15:	f6 44 24 21 02       	testb  $0x2,0x21(%rsp)
  1a:	75 4b                	jne    0x67
  1c:	f7 c3 00 02 00 00    	test   $0x200,%ebx
  22:	74 01                	je     0x25
  24:	fb                   	sti
  25:	bf 01 00 00 00       	mov    $0x1,%edi
* 2a:	e8 82 52 e3 f6       	call   0xf6e352b1 <-- trapping instruction
  2f:	65 8b 05 93 a8 8b 75 	mov    %gs:0x758ba893(%rip),%eax        # 0x758ba8c9
  36:	85 c0                	test   %eax,%eax
  38:	74 3c                	je     0x76
  3a:	48                   	rex.W
  3b:	c7                   	.byte 0xc7
  3c:	04 24                	add    $0x24,%al
  3e:	0e                   	(bad)
  3f:	36                   	ss

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/09 17:46 linux-6.6.y a5df3a702b2c f4e5e155 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in rose_timer_expiry
2025/07/09 17:46 linux-6.6.y a5df3a702b2c f4e5e155 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-6-kasan KASAN: slab-use-after-free Read in rose_timer_expiry
* Struck through repros no longer work on HEAD.