syzbot


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

Status: auto-obsoleted due to no activity on 2023/01/25 19:39
Reported-by: syzbot+199671c2ccca7ce552f0@syzkaller.appspotmail.com
First crash: 1300d, last: 786d
Similar bugs (13)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: use-after-free Read in tcp_write_timer_handler 1 1798d 1798d 0/1 auto-closed as invalid on 2020/04/17 21:22
upstream KASAN: use-after-free Read in tcp_write_timer_handler net 6 2077d 2140d 0/28 closed as invalid on 2019/04/19 22:15
linux-4.19 KASAN: use-after-free Read in tcp_write_timer_handler 1 1491d 1491d 0/1 auto-closed as invalid on 2021/02/18 23:19
upstream KASAN: use-after-free Read in tcp_write_timer_handler (2) net 5 2038d 2040d 0/28 closed as invalid on 2019/05/15 23:07
upstream KASAN: use-after-free Read in tcp_write_timer_handler (3) net 82 1890d 1952d 0/28 auto-closed as invalid on 2019/12/04 07:54
linux-5.15 KASAN: use-after-free Read in tcp_write_timer_handler origin:upstream C error 234 100d 623d 0/3 auto-obsoleted due to no activity on 2024/10/22 01:47
linux-6.1 KASAN: use-after-free Read in tcp_write_timer_handler 140 198d 624d 0/3 auto-obsoleted due to no activity on 2024/07/16 13:06
upstream KASAN: use-after-free Read in tcp_write_timer_handler (4) net 529 709d 1735d 0/28 closed as invalid on 2023/03/21 22:54
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler net 1 2041d 2041d 0/28 closed as invalid on 2019/05/15 23:07
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler (3) net 10 1512d 1723d 0/28 auto-closed as invalid on 2020/12/30 02:27
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler (2) net 24 1900d 1946d 0/28 auto-closed as invalid on 2019/12/08 17:54
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler (4) net 1 1399d 1399d 0/28 auto-closed as invalid on 2021/04/22 06:03
linux-4.19 KASAN: slab-out-of-bounds Read in tcp_write_timer_handler 1 1528d 1528d 0/1 auto-closed as invalid on 2021/01/13 10:13

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tcp_orphan_retries net/ipv4/tcp_timer.c:127 [inline]
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:369 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0xa4b/0xa60 net/ipv4/tcp_timer.c:597
Read of size 4 at addr ffff8880384c15a8 by task systemd-udevd/2455

CPU: 0 PID: 2455 Comm: systemd-udevd Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
device batadv1 entered promiscuous mode
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_load4_noabort+0x88/0x90 mm/kasan/report.c:432
8021q: adding VLAN 0 to HW filter on device batadv1
 tcp_orphan_retries net/ipv4/tcp_timer.c:127 [inline]
 tcp_probe_timer net/ipv4/tcp_timer.c:369 [inline]
 tcp_write_timer_handler+0xa4b/0xa60 net/ipv4/tcp_timer.c:597
 tcp_write_timer+0x103/0x1b0 net/ipv4/tcp_timer.c:613
 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:536 [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: 0033:0x56400bb702f8
Code: 4c 89 5a 10 48 89 1a 0f 87 7b ff ff ff 48 89 f8 48 f7 d0 48 01 c8 48 83 e0 f8 48 8d 7c 07 08 48 8d 0d 34 d9 02 00 48 63 04 b1 <48> 01 c8 ff e0 0f 1f 00 48 8d 0d 49 da 02 00 48 8d 35 21 0d 02 00
RSP: 002b:00007ffe4ee5f780 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: fffffffffffd2569 RBX: 16e3c3b04877e5a7 RCX: 000056400bb9dc28
RDX: 00007ffe4ee5f790 RSI: 0000000000000000 RDI: 000056400d594c28
RBP: 0000000000000005 R08: 000056400d594c28 R09: 00454d414e564544
R10: f39a1ca128c7df6e R11: 4884e4c8753be421 R12: 000056400d594c20
R13: 000056400d594eb0 R14: 000056400bbb39a0 R15: 0000000000000000

Allocated by task 22446:
 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:386 [inline]
 copy_net_ns+0x106/0x340 net/core/net_namespace.c:426
 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:2542
 __do_sys_unshare kernel/fork.c:2610 [inline]
 __se_sys_unshare kernel/fork.c:2608 [inline]
 __x64_sys_unshare+0x2d/0x40 kernel/fork.c:2608
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8820:
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x7f/0x260 mm/slab.c:3765
 net_free net/core/net_namespace.c:402 [inline]
 net_drop_ns+0x73/0x90 net/core/net_namespace.c:409
 cleanup_net+0x64c/0x8b0 net/core/net_namespace.c:572
 process_one_work+0x864/0x1570 kernel/workqueue.c:2153
 worker_thread+0x64c/0x1130 kernel/workqueue.c:2296
 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 ffff8880384c0e40
 which belongs to the cache net_namespace of size 8704
The buggy address is located 1896 bytes inside of
 8704-byte region [ffff8880384c0e40, ffff8880384c3040)
The buggy address belongs to the page:
page:ffffea0000e13000 count:1 mapcount:0 mapping:ffff88823b843e00 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea00008ec108 ffffea0000df7f08 ffff88823b843e00
raw: 0000000000000000 ffff8880384c0e40 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880384c1480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880384c1500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880384c1580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                  ^
 ffff8880384c1600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880384c1680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/09/27 19:38 linux-4.19.y 3f8a27f9e27b 10323ddf .config console log report info [disk image] [vmlinux] ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/07/31 10:08 linux-4.19.y 3f8a27f9e27b fef302b1 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/04/27 22:26 linux-4.19.y 3f8a27f9e27b 1fa34c1b .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/01/19 03:26 linux-4.19.y 3f8a27f9e27b 731a2d23 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/01/18 03:26 linux-4.19.y 3f8a27f9e27b 731a2d23 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/01/14 00:25 linux-4.19.y 3f8a27f9e27b b8d780ab .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/01/03 08:21 linux-4.19.y 3f8a27f9e27b e1768e9c .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2021/11/27 20:26 linux-4.19.y 3f8a27f9e27b 63eeac02 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2021/11/27 05:01 linux-4.19.y 3f8a27f9e27b 63eeac02 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2021/05/01 03:20 linux-4.19.y 97a8651cadce 77e2b668 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_write_timer_handler
2022/01/17 09:06 linux-4.19.y 3f8a27f9e27b 723cfaf0 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in tcp_write_timer_handler
2021/08/03 13:44 linux-4.19.y 53bd76690e27 6c236867 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in tcp_write_timer_handler
* Struck through repros no longer work on HEAD.