syzbot


KASAN: use-after-free Read in tcp_retransmit_timer

Status: auto-closed as invalid on 2020/04/25 09:53
Reported-by: syzbot+75a2838bf261586d71c6@syzkaller.appspotmail.com
First crash: 922d, last: 921d
similar bugs (8):
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
upstream KASAN: use-after-free Read in tcp_retransmit_timer (2) 1 1206d 1206d 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 2d00h 862d 21/22 upstream: reported C repro on 2020/02/24 07:40
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (2) 6 351d 518d 0/1 auto-closed as invalid on 2021/11/16 03:14
upstream KASAN: use-after-free Read in tcp_retransmit_timer (3) 5 1118d 1138d 0/22 closed as invalid on 2019/07/01 18:06
upstream KASAN: use-after-free Read in tcp_retransmit_timer 4 1249d 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 29d 208d 0/1 upstream: reported on 2021/12/09 10:25
upstream KASAN: use-after-free Read in tcp_retransmit_timer (4) 2 1062d 1063d 0/22 closed as invalid on 2019/10/03 04:18

Sample crash report:
protocol 88fb is buggy, dev hsr_slave_0
protocol 88fb is buggy, dev hsr_slave_1
==================================================================
BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2bd3/0x2f90 net/ipv4/tcp_timer.c:485
Read of size 8 at addr ffff88805d9d44b8 by task syz-fuzzer/7719

CPU: 1 PID: 7719 Comm: syz-fuzzer Not tainted 4.19.91-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+0x197/0x210 lib/dump_stack.c:118
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 tcp_retransmit_timer+0x2bd3/0x2f90 net/ipv4/tcp_timer.c:485
protocol 88fb is buggy, dev hsr_slave_0
protocol 88fb is buggy, dev hsr_slave_1
 tcp_write_timer_handler+0x513/0x900 net/ipv4/tcp_timer.c:598
 tcp_write_timer+0x111/0x1d0 net/ipv4/tcp_timer.c:618
 call_timer_fn+0x18d/0x720 kernel/time/timer.c:1326
 expire_timers kernel/time/timer.c:1363 [inline]
 __run_timers kernel/time/timer.c:1684 [inline]
 __run_timers kernel/time/timer.c:1652 [inline]
 run_timer_softirq+0x64f/0x16a0 kernel/time/timer.c:1697
protocol 88fb is buggy, dev hsr_slave_0
 __do_softirq+0x25c/0x921 kernel/softirq.c:292
protocol 88fb is buggy, dev hsr_slave_1
 invoke_softirq kernel/softirq.c:372 [inline]
 irq_exit+0x180/0x1d0 kernel/softirq.c:412
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 smp_apic_timer_interrupt+0x13b/0x550 arch/x86/kernel/apic/apic.c:1094
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:893
 </IRQ>
RIP: 0033:0x4e049a
Code: 8d 4b 01 48 89 4c 24 48 48 89 4c 24 08 e8 de fd ff ff 48 8b 44 24 10 48 8b 4c 24 30 48 39 c8 73 34 48 8b 54 24 50 48 8b 1c c2 <48> 8b 74 24 40 48 39 ce 72 9e eb 1f 48 89 44 24 78 48 89 8c 24 80
RSP: 002b:000000c434849750 EFLAGS: 00000283 ORIG_RAX: ffffffffffffff13
RAX: 00000000000021e9 RBX: 00000000000020d9 RCX: 000000000000cc92
RDX: 000000c441540000 RSI: 000000000000cc92 RDI: 00000000007f87a0
RBP: 000000c4348497a8 R08: 0000000000000001 R09: 0000000000000001
R10: 000000c441540000 R11: 0000000000000006 R12: 00ffffffffffffff
R13: 00000000000000ff R14: 00000000000000ff R15: 0000000000000002

Allocated by task 8278:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc mm/kasan/kasan.c:553 [inline]
 kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531
 kasan_slab_alloc+0xf/0x20 mm/kasan/kasan.c:490
 kmem_cache_alloc+0x12e/0x700 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+0xed/0x33c net/core/net_namespace.c:425
 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:107
 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:206
 ksys_unshare+0x440/0x980 kernel/fork.c:2520
 __do_sys_unshare kernel/fork.c:2588 [inline]
 __se_sys_unshare kernel/fork.c:2586 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2586
 do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8017:
 save_stack+0x45/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x86/0x260 mm/slab.c:3765
 net_free net/core/net_namespace.c:401 [inline]
 net_drop_ns+0x7e/0x90 net/core/net_namespace.c:408
 cleanup_net+0x53b/0x960 net/core/net_namespace.c:571
 process_one_work+0x989/0x1750 kernel/workqueue.c:2153
 worker_thread+0x98/0xe40 kernel/workqueue.c:2296
 kthread+0x354/0x420 kernel/kthread.c:246
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415

The buggy address belongs to the object at ffff88805d9d4280
 which belongs to the cache net_namespace of size 8640
The buggy address is located 568 bytes inside of
 8640-byte region [ffff88805d9d4280, ffff88805d9d6440)
The buggy address belongs to the page:
page:ffffea0001767500 count:1 mapcount:0 mapping:ffff88821bab2540 index:0x0 compound_mapcount: 0
flags: 0xfffe0000008100(slab|head)
raw: 00fffe0000008100 ffffea0002352008 ffffea000145c308 ffff88821bab2540
raw: 0000000000000000 ffff88805d9d4280 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88805d9d4380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805d9d4400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88805d9d4480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff88805d9d4500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88805d9d4580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-19 2019/12/27 09:52 linux-4.19.y 672481c2deff be5c2c81 .config log report
ci2-linux-4-19 2019/12/26 05:25 linux-4.19.y 672481c2deff be5c2c81 .config log report