syzbot


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

Status: closed as invalid on 2019/07/01 18:06
Subsystems: net
[Documentation on labels]
First crash: 1797d, last: 1778d
Similar bugs (12)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (3) 1 543d 543d 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 1082d 1157d 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 25d 44d 0/3 upstream: reported on 2024/03/12 12:56
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer (2) 12 36d 185d 0/3 upstream: reported on 2023/10/23 18:56
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer 2 1581d 1582d 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 1866d 1866d 0/26 closed as invalid on 2019/04/19 21:45
upstream KASAN: use-after-free Read in tcp_retransmit_timer (5) net C unreliable 16000 510d 1522d 22/26 fixed on 2023/02/24 13:50
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (2) 6 1011d 1178d 0/1 auto-closed as invalid on 2021/11/16 03:14
upstream KASAN: use-after-free Read in tcp_retransmit_timer net 4 1909d 2022d 0/26 closed as invalid on 2019/03/10 18:51
linux-4.19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 9 689d 868d 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 1722d 1723d 0/26 closed as invalid on 2019/10/03 04:18
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer 76 294d 402d 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+0x2b80/0x2f20 net/ipv4/tcp_timer.c:480
Read of size 8 at addr ffff88808e302338 by task swapper/1/0

CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.2.0-rc3+ #28
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+0x172/0x1f0 lib/dump_stack.c:113
 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188
 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317
 kasan_report+0x12/0x20 mm/kasan/common.c:614
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132
 tcp_retransmit_timer+0x2b80/0x2f20 net/ipv4/tcp_timer.c:480
 tcp_write_timer_handler+0x591/0x8a0 net/ipv4/tcp_timer.c:591
 tcp_write_timer+0x10e/0x1d0 net/ipv4/tcp_timer.c:611
 call_timer_fn+0x193/0x720 kernel/time/timer.c:1322
 expire_timers kernel/time/timer.c:1366 [inline]
 __run_timers kernel/time/timer.c:1685 [inline]
 __run_timers kernel/time/timer.c:1653 [inline]
 run_timer_softirq+0x66f/0x1740 kernel/time/timer.c:1698
 __do_softirq+0x25c/0x94c kernel/softirq.c:293
 invoke_softirq kernel/softirq.c:374 [inline]
 irq_exit+0x180/0x1d0 kernel/softirq.c:414
 exiting_irq arch/x86/include/asm/apic.h:536 [inline]
 smp_apic_timer_interrupt+0x13b/0x550 arch/x86/kernel/apic/apic.c:1068
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:806
 </IRQ>
RIP: 0010:native_safe_halt+0xe/0x10 arch/x86/include/asm/irqflags.h:61
Code: ff ff 48 89 df e8 32 54 8a fa eb 82 e9 07 00 00 00 0f 00 2d 94 ce 48 00 f4 c3 66 90 e9 07 00 00 00 0f 00 2d 84 ce 48 00 fb f4 <c3> 90 55 48 89 e5 41 57 41 56 41 55 41 54 53 e8 ce 9f 3f fa e8 29
RSP: 0018:ffff8880a98e7d78 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff1164e81 RBX: ffff8880a98d4340 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000006 RDI: ffff8880a98d4bbc
RBP: ffff8880a98e7da8 R08: ffff8880a98d4340 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
R13: ffffffff88b273f8 R14: 0000000000000001 R15: 0000000000000000
 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:571
 default_idle_call+0x36/0x90 kernel/sched/idle.c:94
 cpuidle_idle_call kernel/sched/idle.c:154 [inline]
 do_idle+0x377/0x560 kernel/sched/idle.c:263
 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:354
 start_secondary+0x34e/0x4c0 arch/x86/kernel/smpboot.c:265
 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:243

Allocated by task 25957:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_kmalloc mm/kasan/common.c:489 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462
 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:497
 slab_post_alloc_hook mm/slab.h:437 [inline]
 slab_alloc mm/slab.c:3326 [inline]
 kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3488
 kmem_cache_zalloc include/linux/slab.h:732 [inline]
 net_alloc net/core/net_namespace.c:386 [inline]
 copy_net_ns+0xed/0x340 net/core/net_namespace.c:426
 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:2692
 __do_sys_unshare kernel/fork.c:2760 [inline]
 __se_sys_unshare kernel/fork.c:2758 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2758
 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 15062:
 save_stack+0x23/0x90 mm/kasan/common.c:71
 set_track mm/kasan/common.c:79 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459
 __cache_free mm/slab.c:3432 [inline]
 kmem_cache_free+0x86/0x260 mm/slab.c:3698
 net_free net/core/net_namespace.c:402 [inline]
 net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:409
 net_drop_ns net/core/net_namespace.c:408 [inline]
 cleanup_net+0x538/0x960 net/core/net_namespace.c:571
 process_one_work+0x989/0x1790 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x354/0x420 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff88808e302100
 which belongs to the cache net_namespace of size 6784
The buggy address is located 568 bytes inside of
 6784-byte region [ffff88808e302100, ffff88808e303b80)
The buggy address belongs to the page:
page:ffffea000238c080 refcount:1 mapcount:0 mapping:ffff88821b6f60c0 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002658f08 ffffea00023ee908 ffff88821b6f60c0
raw: 0000000000000000 ffff88808e302100 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808e302200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808e302280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88808e302300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                        ^
 ffff88808e302380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88808e302400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/06/13 15:10 net-next-old a842fe1425cb 3f4e812b .config console log report ci-upstream-net-kasan-gce
2019/05/26 15:22 net-next-old 22942498cceb 85c57315 .config console log report ci-upstream-net-kasan-gce
2019/05/25 19:39 net-next-old 22942498cceb 85c57315 .config console log report ci-upstream-net-kasan-gce
2019/05/25 14:37 net-next-old af5136f95045 85c57315 .config console log report ci-upstream-net-kasan-gce
2019/05/24 22:42 net-next-old af5136f95045 85c57315 .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.