syzbot


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

Status: auto-closed as invalid on 2021/11/16 03:14
Reported-by: syzbot+4d6d18ff738428d7546b@syzkaller.appspotmail.com
First crash: 518d, last: 351d
similar bugs (9):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 5 422d 497d 0/1 auto-closed as invalid on 2021/09/06 04:07
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer 2 921d 922d 0/1 auto-closed as invalid on 2020/04/25 09:53
upstream KASAN: use-after-free Read in tcp_retransmit_timer (2) 1 1205d 1205d 0/22 closed as invalid on 2019/04/19 21:45
upstream KASAN: use-after-free Read in tcp_retransmit_timer (5) C unreliable 15982 1d10h 862d 21/22 upstream: reported C repro on 2020/02/24 07:40
upstream KASAN: use-after-free Read in tcp_retransmit_timer (3) 5 1117d 1137d 0/22 closed as invalid on 2019/07/01 18:06
upstream KASAN: use-after-free Read in tcp_retransmit_timer 4 1248d 1362d 0/22 closed as invalid on 2019/03/10 18:51
linux-4.19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 9 28d 208d 0/1 upstream: reported on 2021/12/09 10:25
upstream KASAN: use-after-free Read in tcp_retransmit_timer (4) 2 1062d 1062d 0/22 closed as invalid on 2019/10/03 04:18
upstream KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 90 622d 863d 0/22 auto-closed as invalid on 2021/01/18 22:17

Sample crash report:
audit: type=1800 audit(1620800351.374:154): pid=15378 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=collect_data cause=failed comm="syz-executor.5" name="bus" dev="sda1" ino=13986 res=0
==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x305e/0x3470 net/ipv4/tcp_timer.c:485
Read of size 8 at addr ffff888046e28378 by task systemd-udevd/15350

CPU: 1 PID: 15350 Comm: systemd-udevd Not tainted 4.19.190-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 tcp_retransmit_timer+0x305e/0x3470 net/ipv4/tcp_timer.c:485
 tcp_write_timer_handler+0x5e6/0xa60 net/ipv4/tcp_timer.c:598
 tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:618
 call_timer_fn+0x177/0x700 kernel/time/timer.c:1338
 expire_timers+0x243/0x4e0 kernel/time/timer.c:1375
 __run_timers kernel/time/timer.c:1696 [inline]
 run_timer_softirq+0x21c/0x670 kernel/time/timer.c:1709
 __do_softirq+0x265/0x980 kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:372 [inline]
 irq_exit+0x215/0x260 kernel/softirq.c:412
 exiting_irq arch/x86/include/asm/apic.h:535 [inline]
 smp_apic_timer_interrupt+0x136/0x550 arch/x86/kernel/apic/apic.c:1098
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:894
 </IRQ>
RIP: 0010:deref_stack_regs arch/x86/kernel/unwind_orc.c:349 [inline]
RIP: 0010:unwind_next_frame+0xcd3/0x1400 arch/x86/kernel/unwind_orc.c:515
Code: 00 00 00 fc ff df 48 8d b8 80 00 00 00 e8 75 ef ff ff 4c 89 e7 4c 8b 44 24 30 48 c1 ef 03 48 8b 84 24 a8 00 00 00 80 3c 17 00 <0f> 85 03 06 00 00 48 8b 7c 24 28 49 89 46 48 48 81 c7 98 00 00 00
RSP: 0018:ffff88803fddf6c8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 00007fef32e227da RBX: 1ffff11007fbbee2 RCX: 1ffff11007fbbf01
RDX: dffffc0000000000 RSI: ffff88803fddf770 RDI: 1ffff11007fbbf08
RBP: 0000000000000001 R08: ffffffff8c119e4c R09: ffffffff8c119e2a
R10: ffff88803fddf857 R11: 0000000000074071 R12: ffff88803fddf840
R13: ffff88803fddf82d R14: ffff88803fddf7f8 R15: ffffffff8c119e48
 __save_stack_trace+0x9f/0x190 arch/x86/kernel/stacktrace.c:44
 save_stack mm/kasan/kasan.c:448 [inline]
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:553
 slab_post_alloc_hook mm/slab.h:445 [inline]
 slab_alloc mm/slab.c:3397 [inline]
 kmem_cache_alloc+0x110/0x370 mm/slab.c:3557
 kmem_cache_zalloc include/linux/slab.h:699 [inline]
 __alloc_file+0x21/0x330 fs/file_table.c:100
 alloc_empty_file+0x6d/0x170 fs/file_table.c:150
 path_openat+0xe9/0x2df0 fs/namei.c:3526
 do_filp_open+0x18c/0x3f0 fs/namei.c:3567
 do_sys_open+0x3b3/0x520 fs/open.c:1085
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fef32e227da
Code: 75 3e 89 d0 45 31 d2 25 00 00 41 00 3d 00 00 41 00 74 2d 8b 05 37 2f 2c 00 85 c0 75 51 48 63 d2 48 63 ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 0f 87 8a 00 00 00 48 83 c4 60 5b 5d 41 5c c3 90
RSP: 002b:00007ffcc5e609f0 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007ffcc5e62bc0 RCX: 00007fef32e227da
RDX: 0000000000080000 RSI: 00007fef3397e31f RDI: 0000000000000011
RBP: 00007fef3397e31f R08: 0000000000000000 R09: 0000000000000020
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000080000
R13: 00007ffcc5e62bd8 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 8113:
 kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
 kmem_cache_zalloc include/linux/slab.h:699 [inline]
 net_alloc net/core/net_namespace.c:385 [inline]
 copy_net_ns+0x106/0x340 net/core/net_namespace.c:425
 create_new_namespaces+0x3f6/0x7b0 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:206
 ksys_unshare+0x36c/0x9a0 kernel/fork.c:2541
 __do_sys_unshare kernel/fork.c:2609 [inline]
 __se_sys_unshare kernel/fork.c:2607 [inline]
 __x64_sys_unshare+0x2d/0x40 kernel/fork.c:2607
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 7:
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x7f/0x260 mm/slab.c:3765
 net_free net/core/net_namespace.c:401 [inline]
 net_drop_ns+0x73/0x90 net/core/net_namespace.c:408
 cleanup_net+0x64c/0x8b0 net/core/net_namespace.c:571
 process_one_work+0x864/0x1570 kernel/workqueue.c:2152
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2295
 kthread+0x33f/0x460 kernel/kthread.c:259
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff888046e28140
 which belongs to the cache net_namespace of size 8704
The buggy address is located 568 bytes inside of
 8704-byte region [ffff888046e28140, ffff888046e2a340)
The buggy address belongs to the page:
page:ffffea00011b8a00 count:1 mapcount:0 mapping:ffff88823b843e00 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea00011dcd08 ffffea00011a4408 ffff88823b843e00
raw: 0000000000000000 ffff888046e28140 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888046e28200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888046e28280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888046e28300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                                ^
 ffff888046e28380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888046e28400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (6):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2021/05/12 06:19 linux-4.19.y 3c8c23092588 b3c3bb8e .config log report info KASAN: use-after-free Read in tcp_retransmit_timer
ci2-linux-4-19 2021/04/14 08:30 linux-4.19.y 0f1b4cb77d7f a184b83e .config log report info KASAN: use-after-free Read in tcp_retransmit_timer
ci2-linux-4-19 2021/04/11 23:34 linux-4.19.y 830a059cbba6 6a81331a .config log report info KASAN: use-after-free Read in tcp_retransmit_timer
ci2-linux-4-19 2021/03/05 05:59 linux-4.19.y dfb571610ba3 9d751681 .config log report info KASAN: use-after-free Read in tcp_retransmit_timer
ci2-linux-4-19 2021/02/02 04:19 linux-4.19.y 811218eceeaa e6b95f32 .config log report info KASAN: use-after-free Read in tcp_retransmit_timer
ci2-linux-4-19 2021/07/19 03:13 linux-4.19.y fcfbdfe9626e f115ae98 .config log report info KASAN: slab-out-of-bounds Read in tcp_retransmit_timer