syzbot


KASAN: use-after-free Read in tw_timer_handler

Status: auto-obsoleted due to no activity on 2025/09/13 00:41
Reported-by: syzbot+df389216c9cf4eb640fd@syzkaller.appspotmail.com
First crash: 95d, last: 61d
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in tw_timer_handler 19 3 90d 97d 0/2 auto-obsoleted due to no activity on 2025/09/14 02:09
linux-4.14 KASAN: use-after-free Read in tw_timer_handler 19 4 2070d 2175d 0/1 auto-closed as invalid on 2020/05/12 09:52
Last patch testing requests (2)
Created Duration User Patch Repo Result
2025/09/13 00:19 11m retest repro android13-5.10-lts OK log
2025/07/04 21:38 15m retest repro android13-5.10-lts report log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tw_timer_handler+0x8f/0xf0 include/net/net_namespace.h:-1
Read of size 8 at addr ffff88810fea3b50 by task syz.4.1431/6092

CPU: 0 PID: 6092 Comm: syz.4.1431 Tainted: G        W         5.10.238-syzkaller-00008-g59e9a7228857 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <IRQ>
 __dump_stack+0x21/0x24 lib/dump_stack.c:77
 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118
 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:435 [inline]
 kasan_report+0xe2/0x130 mm/kasan/report.c:452
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309
 tw_timer_handler+0x8f/0xf0 include/net/net_namespace.h:-1
 call_timer_fn+0x38/0x290 kernel/time/timer.c:1450
 expire_timers kernel/time/timer.c:1495 [inline]
 __run_timers+0x639/0x9a0 kernel/time/timer.c:1789
 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1802
 __do_softirq+0x255/0x563 kernel/softirq.c:309
 asm_call_irq_on_stack+0xf/0x20
 </IRQ>
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
 do_softirq_own_stack+0x60/0x80 arch/x86/kernel/irq_64.c:77
 invoke_softirq kernel/softirq.c:405 [inline]
 __irq_exit_rcu+0x128/0x150 kernel/softirq.c:435
 irq_exit_rcu+0x9/0x10 kernel/softirq.c:447
 sysvec_apic_timer_interrupt+0xbf/0xe0 arch/x86/kernel/apic/apic.c:1106
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:635
RIP: 0033:0x7f7afdaafd38
Code: 9e fd ff ff 41 8d 34 04 49 8b 47 10 48 39 f0 72 6e 48 63 cd 48 01 c1 49 39 4f 08 72 4c 8d 4d ff 85 ed 74 33 66 0f 1f 44 00 00 <48> 39 f0 72 1b 4d 8b 07 49 89 c1 49 29 f1 47 0f b6 0c 08 45 84 c9
RSP: 002b:00007f7afc2554a0 EFLAGS: 00000202
RAX: 00000000002ef852 RBX: 00007f7afc255540 RCX: 00000000000000a7
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 00007f7afc2555e0
RBP: 0000000000000102 R08: 00007f7af3e36000 R09: 0000000000000000
R10: 0000000000000000 R11: 00007f7afc255550 R12: 0000000000000001
R13: 00007f7afdc8b3a0 R14: 0000000000000000 R15: 00007f7afc2555e0

Allocated by task 3223:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:45 [inline]
 set_alloc_info mm/kasan/common.c:430 [inline]
 __kasan_slab_alloc+0xbd/0xf0 mm/kasan/common.c:463
 kasan_slab_alloc include/linux/kasan.h:244 [inline]
 slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:583
 slab_alloc_node mm/slub.c:2947 [inline]
 slab_alloc mm/slub.c:2955 [inline]
 kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2960
 kmem_cache_zalloc include/linux/slab.h:654 [inline]
 net_alloc net/core/net_namespace.c:421 [inline]
 copy_net_ns+0x13f/0x520 net/core/net_namespace.c:473
 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:231
 ksys_unshare+0x4ac/0x7d0 kernel/fork.c:3156
 __do_sys_unshare kernel/fork.c:3224 [inline]
 __se_sys_unshare kernel/fork.c:3222 [inline]
 __x64_sys_unshare+0x38/0x40 kernel/fork.c:3222
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Freed by task 9:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4a/0x70 mm/kasan/common.c:45
 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370
 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:362
 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370
 kasan_slab_free include/linux/kasan.h:220 [inline]
 slab_free_hook mm/slub.c:1595 [inline]
 slab_free_freelist_hook+0xc5/0x190 mm/slub.c:1621
 slab_free mm/slub.c:3203 [inline]
 kmem_cache_free+0x100/0x2d0 mm/slub.c:3219
 net_free net/core/net_namespace.c:449 [inline]
 net_drop_ns net/core/net_namespace.c:456 [inline]
 cleanup_net+0xae3/0xb70 net/core/net_namespace.c:630
 process_one_work+0x6e1/0xba0 kernel/workqueue.c:2301
 worker_thread+0xa6a/0x13b0 kernel/workqueue.c:2447
 kthread+0x346/0x3d0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298

The buggy address belongs to the object at ffff88810fea39c0
 which belongs to the cache net_namespace of size 4672
The buggy address is located 400 bytes inside of
 4672-byte region [ffff88810fea39c0, ffff88810fea4c00)
The buggy address belongs to the page:
page:ffffea00043fa800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10fea0
head:ffffea00043fa800 order:3 compound_mapcount:0 compound_pincount:0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000100000001 ffff888107fdc900
raw: 0000000000000000 0000000000060006 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 921, ts 44248960805, free_ts 44114673335
 set_page_owner include/linux/page_owner.h:35 [inline]
 post_alloc_hook mm/page_alloc.c:2456 [inline]
 prep_new_page+0x179/0x180 mm/page_alloc.c:2462
 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254
 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5357
 alloc_slab_page mm/slub.c:-1 [inline]
 allocate_slab mm/slub.c:1808 [inline]
 new_slab+0x84/0x3f0 mm/slub.c:1869
 new_slab_objects mm/slub.c:2627 [inline]
 ___slab_alloc+0x2a6/0x450 mm/slub.c:2791
 __slab_alloc+0x63/0xa0 mm/slub.c:2831
 slab_alloc_node mm/slub.c:2913 [inline]
 slab_alloc mm/slub.c:2955 [inline]
 kmem_cache_alloc+0x1af/0x2e0 mm/slub.c:2960
 kmem_cache_zalloc include/linux/slab.h:654 [inline]
 net_alloc net/core/net_namespace.c:421 [inline]
 copy_net_ns+0x13f/0x520 net/core/net_namespace.c:473
 create_new_namespaces+0x3a2/0x650 kernel/nsproxy.c:110
 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:179
 copy_process+0x11b8/0x32c0 kernel/fork.c:2271
 kernel_clone+0x23f/0x940 kernel/fork.c:2650
 __do_sys_clone kernel/fork.c:2776 [inline]
 __se_sys_clone kernel/fork.c:2760 [inline]
 __x64_sys_clone+0x176/0x1d0 kernel/fork.c:2760
 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:28 [inline]
 free_pages_prepare mm/page_alloc.c:1349 [inline]
 __free_pages_ok+0x7fc/0x820 mm/page_alloc.c:1629
 free_the_page mm/page_alloc.c:5418 [inline]
 __free_pages+0xdd/0x380 mm/page_alloc.c:5427
 __free_slab+0xcf/0x190 mm/slub.c:1894
 free_slab mm/slub.c:1909 [inline]
 discard_slab+0x29/0x40 mm/slub.c:1915
 __slab_free+0x313/0x3a0 mm/slub.c:3131
 do_slab_free mm/slub.c:3191 [inline]
 ___cache_free+0x111/0x130 mm/slub.c:3210
 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157
 qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x14a/0x160 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xf0 mm/kasan/common.c:440
 kasan_slab_alloc include/linux/kasan.h:244 [inline]
 slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:583
 slab_alloc_node mm/slub.c:2947 [inline]
 slab_alloc mm/slub.c:2955 [inline]
 kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2960
 kmem_cache_zalloc include/linux/slab.h:654 [inline]
 __delayacct_tsk_init+0x2c/0xa0 kernel/delayacct.c:36
 delayacct_tsk_init include/linux/delayacct.h:102 [inline]
 copy_process+0x9f3/0x32c0 kernel/fork.c:2157
 kernel_clone+0x23f/0x940 kernel/fork.c:2650
 __do_sys_clone3 kernel/fork.c:2934 [inline]
 __se_sys_clone3 kernel/fork.c:2918 [inline]
 __x64_sys_clone3+0x296/0x2f0 kernel/fork.c:2918

Memory state around the buggy address:
 ffff88810fea3a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810fea3a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88810fea3b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff88810fea3b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88810fea3c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (10):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/14 10:26 android13-5.10-lts 59e9a7228857 3cda49cf .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/07/07 11:21 android13-5.10-lts 59e9a7228857 4f67c4ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/20 01:15 android13-5.10-lts d76d4cd0623a ed3e87f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/17 14:54 android13-5.10-lts d76d4cd0623a cfebc887 .config console log report syz / log [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/17 08:26 android13-5.10-lts d76d4cd0623a cfebc887 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/15 12:36 android13-5.10-lts d76d4cd0623a 5f4b362d .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/13 04:46 android13-5.10-lts d76d4cd0623a 98683f8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/12 20:34 android13-5.10-lts d76d4cd0623a 98683f8f .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/11 01:37 android13-5.10-lts d76d4cd0623a 5d7e17ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
2025/06/10 23:39 android13-5.10-lts d76d4cd0623a 5d7e17ca .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-10 KASAN: use-after-free Read in tw_timer_handler
* Struck through repros no longer work on HEAD.