syzbot


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

Status: upstream: reported on 2025/01/28 00:08
Reported-by: syzbot+[email protected]
First crash: 147d, last: 69d
Similar bugs (16)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (3) 1 202d 202d 0/3 auto-obsoleted due to no activity on 2025/03/13 12:53
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (4) 3 8d12h 88d 0/3 upstream: reported on 2025/03/28 06:41
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (3) 1 967d 967d 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 5 1507d 1582d 0/1 auto-closed as invalid on 2021/09/06 04:07
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer 14 450d 468d 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) 13 424d 609d 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 2 2005d 2007d 0/1 auto-closed as invalid on 2020/04/25 09:53
upstream KASAN: use-after-free Read in tcp_retransmit_timer (2) net 1 2290d 2290d 0/29 closed as invalid on 2019/04/19 21:45
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (2) 1 360d 360d 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 C unreliable 16000 934d 1947d 22/29 fixed on 2023/02/24 13:50
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (2) 6 1436d 1603d 0/1 auto-closed as invalid on 2021/11/16 03:14
upstream KASAN: use-after-free Read in tcp_retransmit_timer (3) net 5 2202d 2222d 0/29 closed as invalid on 2019/07/01 18:06
upstream KASAN: use-after-free Read in tcp_retransmit_timer net 4 2333d 2447d 0/29 closed as invalid on 2019/03/10 18:51
linux-4.19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 9 1113d 1292d 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 2 2147d 2147d 0/29 closed as invalid on 2019/10/03 04:18
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer 76 719d 826d 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+0x6a1/0x26b0 net/ipv4/tcp_timer.c:542
Read of size 8 at addr ffff88802a3e8258 by task syz.2.2269/13777

CPU: 0 PID: 13777 Comm: syz.2.2269 Not tainted 5.15.180-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
 print_address_description+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 tcp_retransmit_timer+0x6a1/0x26b0 net/ipv4/tcp_timer.c:542
 tcp_write_timer_handler+0x1f7/0x980 net/ipv4/tcp_timer.c:655
 tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:675
 call_timer_fn+0x16d/0x560 kernel/time/timer.c:1451
 expire_timers kernel/time/timer.c:1496 [inline]
 __run_timers+0x67c/0x890 kernel/time/timer.c:1767
 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1780
 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558
 __do_softirq kernel/softirq.c:592 [inline]
 invoke_softirq kernel/softirq.c:432 [inline]
 __irq_exit_rcu+0x157/0x240 kernel/softirq.c:641
 irq_exit_rcu+0x5/0x20 kernel/softirq.c:653
 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
 </IRQ>
 <TASK>
 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:676
RIP: 0010:_copy_from_user+0x2/0x170 lib/usercopy.c:12
Code: c7 e0 bf f9 8a e8 0e 00 38 fd 0f 0b eb 89 89 d9 80 e1 07 80 c1 03 38 c1 7c c2 48 89 df e8 f6 5f b6 fd eb b8 cc cc cc cc 41 57 <41> 56 41 55 41 54 53 49 89 d4 49 89 f7 49 89 fe e8 e9 6b 6c fd 48
RSP: 0018:ffffc90002ecfa70 EFLAGS: 00000202
RAX: ffffc90002ecfae0 RBX: 0000000000000002 RCX: 0000000000000000
RDX: 0000000000000038 RSI: 000020000011bbc0 RDI: ffffc90002ecfae0
RBP: ffffc90002ecfc70 R08: dffffc0000000000 R09: ffffc90002ecfae0
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90002ecfbe0
R13: dffffc0000000000 R14: 1ffff920005d9f58 R15: ffffc90002ecfae0
 copy_from_user include/linux/uaccess.h:192 [inline]
 __copy_msghdr_from_user net/socket.c:2318 [inline]
 copy_msghdr_from_user net/socket.c:2369 [inline]
 recvmsg_copy_msghdr net/socket.c:2621 [inline]
 ___sys_recvmsg+0x150/0x690 net/socket.c:2693
 do_recvmmsg+0x36f/0x8f0 net/socket.c:2791
 __sys_recvmmsg net/socket.c:2870 [inline]
 __do_sys_recvmmsg net/socket.c:2893 [inline]
 __se_sys_recvmmsg net/socket.c:2886 [inline]
 __x64_sys_recvmmsg+0x195/0x240 net/socket.c:2886
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f506f355169
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:00007f506d19c038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b
RAX: ffffffffffffffda RBX: 00007f506f57d080 RCX: 00007f506f355169
RDX: 0000000000010106 RSI: 00002000000000c0 RDI: 0000000000000004
RBP: 00007f506f3d7a68 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f506f57d080 R15: 00007fff772e0198
 </TASK>

Allocated by task 4169:
 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+0x8e/0xc0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:725 [inline]
 net_alloc net/core/net_namespace.c:418 [inline]
 copy_net_ns+0x140/0x5d0 net/core/net_namespace.c:473
 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
 ksys_unshare+0x531/0xa40 kernel/fork.c:3099
 __do_sys_unshare kernel/fork.c:3173 [inline]
 __se_sys_unshare kernel/fork.c:3171 [inline]
 __x64_sys_unshare+0x34/0x40 kernel/fork.c:3171
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0

Freed by task 4291:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd8/0x120 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+0xdd/0x160 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kmem_cache_free+0x91/0x1f0 mm/slub.c:3515
 net_free net/core/net_namespace.c:447 [inline]
 cleanup_net+0xbd8/0xc90 net/core/net_namespace.c:639
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88802a3e8000
 which belongs to the cache net_namespace of size 6528
The buggy address is located 600 bytes inside of
 6528-byte region [ffff88802a3e8000, ffff88802a3e9980)
The buggy address belongs to the page:
page:ffffea0000a8fa00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802a3e9a80 pfn:0x2a3e8
head:ffffea0000a8fa00 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff888020cefd41
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 0000000100000001 ffff8880175ea3c0
raw: ffff88802a3e9a80 0000000080040003 00000001ffffffff ffff888020cefd41
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 4169, ts 52718786004, free_ts 52681784846
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5466
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 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+0x18e/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:725 [inline]
 net_alloc net/core/net_namespace.c:418 [inline]
 copy_net_ns+0x140/0x5d0 net/core/net_namespace.c:473
 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226
 ksys_unshare+0x531/0xa40 kernel/fork.c:3099
 __do_sys_unshare kernel/fork.c:3173 [inline]
 __se_sys_unshare kernel/fork.c:3171 [inline]
 __x64_sys_unshare+0x34/0x40 kernel/fork.c:3171
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3b/0xb0 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+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
 free_slab mm/slub.c:2015 [inline]
 discard_slab mm/slub.c:2021 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2507
 put_cpu_partial+0x132/0x1a0 mm/slub.c:2587
 do_slab_free mm/slub.c:3487 [inline]
 ___cache_free+0xe3/0x100 mm/slub.c:3506
 qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
 kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
 __kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:725 [inline]
 __kernfs_new_node+0xdb/0x750 fs/kernfs/dir.c:593
 kernfs_new_node+0x136/0x230 fs/kernfs/dir.c:669
 kernfs_create_link+0xa1/0x1f0 fs/kernfs/symlink.c:39
 sysfs_do_create_link_sd+0x85/0x100 fs/sysfs/symlink.c:44
 device_add_class_symlinks drivers/base/core.c:3141 [inline]
 device_add+0x6b5/0xfd0 drivers/base/core.c:3360
 hci_conn_add_sysfs+0xe4/0x1f0 net/bluetooth/hci_sysfs.c:46

Memory state around the buggy address:
 ffff88802a3e8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802a3e8180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88802a3e8200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                    ^
 ffff88802a3e8280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88802a3e8300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
vkms_vblank_simulate: vblank timer overrun
----------------
Code disassembly (best guess), 2 bytes skipped:
   0:	bf f9 8a e8 0e       	mov    $0xee88af9,%edi
   5:	00 38                	add    %bh,(%rax)
   7:	fd                   	std
   8:	0f 0b                	ud2
   a:	eb 89                	jmp    0xffffff95
   c:	89 d9                	mov    %ebx,%ecx
   e:	80 e1 07             	and    $0x7,%cl
  11:	80 c1 03             	add    $0x3,%cl
  14:	38 c1                	cmp    %al,%cl
  16:	7c c2                	jl     0xffffffda
  18:	48 89 df             	mov    %rbx,%rdi
  1b:	e8 f6 5f b6 fd       	call   0xfdb66016
  20:	eb b8                	jmp    0xffffffda
  22:	cc                   	int3
  23:	cc                   	int3
  24:	cc                   	int3
  25:	cc                   	int3
  26:	41 57                	push   %r15
* 28:	41 56                	push   %r14 <-- trapping instruction
  2a:	41 55                	push   %r13
  2c:	41 54                	push   %r12
  2e:	53                   	push   %rbx
  2f:	49 89 d4             	mov    %rdx,%r12
  32:	49 89 f7             	mov    %rsi,%r15
  35:	49 89 fe             	mov    %rdi,%r14
  38:	e8 e9 6b 6c fd       	call   0xfd6c6c26
  3d:	48                   	rex.W

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/16 04:45 linux-5.15.y f7347f400572 a95239b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_retransmit_timer
2025/04/16 03:43 linux-5.15.y f7347f400572 a95239b1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_retransmit_timer
2025/01/28 00:08 linux-5.15.y 003148680b79 18070896 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: use-after-free Read in tcp_retransmit_timer
2025/03/26 12:01 linux-5.15.y 0c935c049b5c 89d30d73 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_retransmit_timer
* Struck through repros no longer work on HEAD.
OSZAR »