syzbot


KASAN: use-after-free Read in tcp_retransmit_timer (4)

Status: upstream: reported on 2025/03/28 06:41
Reported-by: syzbot+724b6182cd2c88e9450e@syzkaller.appspotmail.com
First crash: 109d, last: 29d
Similar bugs (16)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (3) 19 1 224d 224d 0/3 auto-obsoleted due to no activity on 2025/03/13 12:53
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (3) 19 1 989d 989d 0/1 auto-obsoleted due to no activity on 2023/02/27 17:38
linux-4.14 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 19 5 1528d 1603d 0/1 auto-closed as invalid on 2021/09/06 04:07
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer 19 14 471d 490d 0/3 auto-obsoleted due to no activity on 2024/06/08 21:34
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer (2) 19 13 445d 631d 0/3 auto-obsoleted due to no activity on 2024/08/04 05:25
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer 19 2 2027d 2028d 0/1 auto-closed as invalid on 2020/04/25 09:53
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer (3) 19 4 90d 168d 0/3 upstream: reported on 2025/01/28 00:08
upstream KASAN: use-after-free Read in tcp_retransmit_timer (2) net 19 1 2312d 2312d 0/29 closed as invalid on 2019/04/19 21:45
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (2) 19 1 381d 381d 0/3 auto-obsoleted due to no activity on 2024/10/06 20:00
upstream KASAN: use-after-free Read in tcp_retransmit_timer (5) net 19 C unreliable 16000 956d 1968d 22/29 fixed on 2023/02/24 13:50
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (2) 19 6 1457d 1624d 0/1 auto-closed as invalid on 2021/11/16 03:14
upstream KASAN: use-after-free Read in tcp_retransmit_timer (3) net 19 5 2224d 2243d 0/29 closed as invalid on 2019/07/01 18:06
upstream KASAN: use-after-free Read in tcp_retransmit_timer net 19 4 2355d 2468d 0/29 closed as invalid on 2019/03/10 18:51
linux-4.19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 19 9 1135d 1314d 0/1 auto-obsoleted due to no activity on 2022/10/04 11:51
upstream KASAN: use-after-free Read in tcp_retransmit_timer (4) net 19 2 2168d 2169d 0/29 closed as invalid on 2019/10/03 04:18
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer 19 76 740d 848d 0/3 auto-obsoleted due to no activity on 2023/09/14 02:10

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x720/0x2700 net/ipv4/tcp_timer.c:546
Read of size 8 at addr ffff8880740502c8 by task ksoftirqd/0/15

CPU: 0 PID: 15 Comm: ksoftirqd/0 Not tainted 6.1.141-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 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
 tcp_retransmit_timer+0x720/0x2700 net/ipv4/tcp_timer.c:546
 tcp_write_timer+0x126/0x280 net/ipv4/tcp_timer.c:676
 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:596
 run_ksoftirqd+0x98/0xf0 kernel/softirq.c:963
 smpboot_thread_fn+0x64a/0xa40 kernel/smpboot.c:164
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>

Allocated by task 4256:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:328
 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]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3422
 kmem_cache_zalloc include/linux/slab.h:689 [inline]
 net_alloc net/core/net_namespace.c:423 [inline]
 copy_net_ns+0x13c/0x5b0 net/core/net_namespace.c:495
 create_new_namespaces+0x3d3/0x6f0 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x116/0x160 kernel/nsproxy.c:226
 ksys_unshare+0x4bc/0x890 kernel/fork.c:3277
 __do_sys_unshare kernel/fork.c:3348 [inline]
 __se_sys_unshare kernel/fork.c:3346 [inline]
 __x64_sys_unshare+0x34/0x40 kernel/fork.c:3346
 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

Freed by task 4577:
 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+0xf7/0x290 mm/slub.c:3683
 net_complete_free net/core/net_namespace.c:459 [inline]
 cleanup_net+0x871/0xb80 net/core/net_namespace.c:653
 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
 handle_softirqs+0x2a1/0x920 kernel/softirq.c:596
 __do_softirq kernel/softirq.c:630 [inline]
 invoke_softirq kernel/softirq.c:470 [inline]
 __irq_exit_rcu+0x12f/0x220 kernel/softirq.c:679
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:691
 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

Second to 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
 handle_softirqs+0x2a1/0x920 kernel/softirq.c:596
 run_ksoftirqd+0x98/0xf0 kernel/softirq.c:963
 smpboot_thread_fn+0x64a/0xa40 kernel/smpboot.c:164
 kthread+0x29d/0x330 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

The buggy address belongs to the object at ffff888074050000
 which belongs to the cache net_namespace of size 6976
The buggy address is located 712 bytes inside of
 6976-byte region [ffff888074050000, ffff888074051b40)

The buggy address belongs to the physical page:
page:ffffea0001d01400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74050
head:ffffea0001d01400 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888044241c01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888140009500
raw: 0000000000000000 0000000080040004 00000001ffffffff ffff888044241c01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4256, tgid 4256 (syz-executor), ts 76745566572, free_ts 76647935977
 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:5614
 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]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x1b7/0x2f0 mm/slub.c:3422
 kmem_cache_zalloc include/linux/slab.h:689 [inline]
 net_alloc net/core/net_namespace.c:423 [inline]
 copy_net_ns+0x13c/0x5b0 net/core/net_namespace.c:495
 create_new_namespaces+0x3d3/0x6f0 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x116/0x160 kernel/nsproxy.c:226
 ksys_unshare+0x4bc/0x890 kernel/fork.c:3277
 __do_sys_unshare kernel/fork.c:3348 [inline]
 __se_sys_unshare kernel/fork.c:3346 [inline]
 __x64_sys_unshare+0x34/0x40 kernel/fork.c:3346
 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
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]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3422
 skb_clone+0x1e7/0x370 net/core/skbuff.c:1660
 hci_send_cmd_sync net/bluetooth/hci_core.c:4123 [inline]
 hci_cmd_work+0xdd/0x580 net/bluetooth/hci_core.c:4156
 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

Memory state around the buggy address:
 ffff888074050180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888074050200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888074050280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                              ^
 ffff888074050300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888074050380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/15 21:18 linux-6.1.y 58485ff1a74f 5f4b362d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in tcp_retransmit_timer
2025/04/18 02:58 linux-6.1.y 420102835862 2a20f901 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in tcp_retransmit_timer
2025/03/28 06:40 linux-6.1.y 344a09659766 6c09fb82 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in tcp_retransmit_timer
* Struck through repros no longer work on HEAD.