syzbot


KASAN: use-after-free Read in tcp_write_timer_handler

Status: upstream: reported C repro on 2023/03/09 08:35
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+1a885b255a749c675633@syzkaller.appspotmail.com
First crash: 415d, last: 11d
Bug presence (1)
Date Name Commit Repro Result
2024/02/25 upstream (ToT) ab0a97cffa0b C [report] BUG: MAX_LOCKDEP_CHAINS too low!
Similar bugs (8)
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 1590d 1590d 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 1869d 1932d 0/26 closed as invalid on 2019/04/19 22:15
linux-4.19 KASAN: use-after-free Read in tcp_write_timer_handler 1 1283d 1283d 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 1830d 1832d 0/26 closed as invalid on 2019/05/15 23:07
upstream KASAN: use-after-free Read in tcp_write_timer_handler (3) net 82 1682d 1744d 0/26 auto-closed as invalid on 2019/12/04 07:54
linux-6.1 KASAN: use-after-free Read in tcp_write_timer_handler 138 18d 416d 0/3 upstream: reported on 2023/03/08 06:26
linux-4.19 KASAN: use-after-free Read in tcp_write_timer_handler (2) 12 577d 1092d 0/1 auto-obsoleted due to no activity on 2023/01/25 19:39
upstream KASAN: use-after-free Read in tcp_write_timer_handler (4) net 529 500d 1527d 0/26 closed as invalid on 2023/03/21 22:54

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:384 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x78c/0x8a8 net/ipv4/tcp_timer.c:648
Read of size 1 at addr ffff0000dc573b0d by task syz-executor413/3994

CPU: 1 PID: 3994 Comm: syz-executor413 Not tainted 5.15.149-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call trace:
 dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x174/0x1e4 mm/kasan/report.c:451
 __asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306
 tcp_probe_timer net/ipv4/tcp_timer.c:384 [inline]
 tcp_write_timer_handler+0x78c/0x8a8 net/ipv4/tcp_timer.c:648
 tcp_write_timer+0x178/0x318 net/ipv4/tcp_timer.c:664
 call_timer_fn+0x19c/0x8f0 kernel/time/timer.c:1421
 expire_timers kernel/time/timer.c:1466 [inline]
 __run_timers+0x554/0x718 kernel/time/timer.c:1737
 run_timer_softirq+0x7c/0x114 kernel/time/timer.c:1750
 __do_softirq+0x344/0xdb0 kernel/softirq.c:558
 do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline]
 invoke_softirq kernel/softirq.c:439 [inline]
 __irq_exit_rcu+0x264/0x4d4 kernel/softirq.c:637
 irq_exit+0x14/0x88 kernel/softirq.c:661
 handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:710
 gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758
 call_on_irq_stack+0x24/0x4c arch/arm64/kernel/entry.S:899
 do_interrupt_handler+0x74/0x94 arch/arm64/kernel/entry-common.c:267
 el1_interrupt+0x30/0x58 arch/arm64/kernel/entry-common.c:454
 el1h_64_irq_handler+0x18/0x24 arch/arm64/kernel/entry-common.c:470
 el1h_64_irq+0x78/0x7c arch/arm64/kernel/entry.S:580
 check_kcov_mode kernel/kcov.c:163 [inline]
 __sanitizer_cov_trace_pc+0x5c/0x94 kernel/kcov.c:197
 unwind_frame+0x31c/0x550 arch/arm64/kernel/stacktrace.c:113
 walk_stackframe arch/arm64/kernel/stacktrace.c:148 [inline]
 arch_stack_walk+0x270/0x32c arch/arm64/kernel/stacktrace.c:238
 stack_trace_save+0xfc/0x1a0 kernel/stacktrace.c:122
 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+0x8c/0xcc mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x74/0x3f4 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 kmem_cache_alloc_node+0x208/0x49c mm/slub.c:3256
 alloc_vmap_area+0x158/0x16a8 mm/vmalloc.c:1531
 __get_vm_area_node+0x178/0x2e0 mm/vmalloc.c:2423
 __vmalloc_node_range+0xe4/0x8e4 mm/vmalloc.c:3019
 __vmalloc_node mm/vmalloc.c:3079 [inline]
 vzalloc+0x128/0x19c mm/vmalloc.c:3149
 alloc_counters+0x84/0x7ec net/ipv4/netfilter/ip_tables.c:800
 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:839 [inline]
 get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline]
 do_ip6t_get_ctl+0xc78/0x17fc net/ipv6/netfilter/ip6_tables.c:1671
 nf_getsockopt+0x264/0x284 net/netfilter/nf_sockopt.c:116
 ipv6_getsockopt+0x58c/0x3470 net/ipv6/ipv6_sockglue.c:1489
 tcp_getsockopt+0x294/0x797c net/ipv4/tcp.c:4304
 sock_common_getsockopt+0xa8/0xc4 net/core/sock.c:3405
 __sys_getsockopt+0x1e8/0x460 net/socket.c:2242
 __do_sys_getsockopt net/socket.c:2257 [inline]
 __se_sys_getsockopt net/socket.c:2254 [inline]
 __arm64_sys_getsockopt+0xb8/0xd4 net/socket.c:2254
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 3991:
 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+0x8c/0xcc mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x74/0x3f4 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x1dc/0x45c mm/slub.c:3233
 kmem_cache_zalloc include/linux/slab.h:711 [inline]
 net_alloc net/core/net_namespace.c:405 [inline]
 copy_net_ns+0x128/0x5e4 net/core/net_namespace.c:460
 create_new_namespaces+0x330/0x61c kernel/nsproxy.c:110
 unshare_nsproxy_namespaces+0x108/0x158 kernel/nsproxy.c:226
 ksys_unshare+0x45c/0x874 kernel/fork.c:3101
 __do_sys_unshare kernel/fork.c:3175 [inline]
 __se_sys_unshare kernel/fork.c:3173 [inline]
 __arm64_sys_unshare+0x3c/0x50 kernel/fork.c:3173
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Freed by task 136:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4c/0x84 mm/kasan/common.c:46
 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360
 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366
 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kmem_cache_free+0xdc/0x3c4 mm/slub.c:3515
 net_free net/core/net_namespace.c:434 [inline]
 cleanup_net+0x8a0/0x9bc net/core/net_namespace.c:617
 process_one_work+0x790/0x11b8 kernel/workqueue.c:2310
 worker_thread+0x910/0x1034 kernel/workqueue.c:2457
 kthread+0x37c/0x45c kernel/kthread.c:319
 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870

The buggy address belongs to the object at ffff0000dc573480
 which belongs to the cache net_namespace of size 6464
The buggy address is located 1677 bytes inside of
 6464-byte region [ffff0000dc573480, ffff0000dc574dc0)
The buggy address belongs to the page:
page:00000000082df7fe refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000dc571a40 pfn:0x11c570
head:00000000082df7fe order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c0840000
raw: ffff0000dc571a40 0000000080040003 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000dc573a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000dc573a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff0000dc573b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff0000dc573b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff0000dc573c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (230):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/25 10:43 linux-5.15.y 458ce51d0356 8d446f15 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/16 08:03 linux-5.15.y fa3df276cd36 0d592ce4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/06 02:50 linux-5.15.y 9465fef4ae35 ca620dd8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/04 14:19 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/04 12:59 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/04 09:57 linux-5.15.y 9465fef4ae35 0ee3535e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/04 06:41 linux-5.15.y 9465fef4ae35 51c4dcff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/03 12:55 linux-5.15.y 9465fef4ae35 7925100d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/03 02:33 linux-5.15.y 9465fef4ae35 7925100d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/02 14:32 linux-5.15.y 9465fef4ae35 eb2966c4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/02 02:32 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/31 18:28 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/31 01:02 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/30 11:04 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/30 03:14 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/29 21:04 linux-5.15.y 9465fef4ae35 c52bcb23 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/29 06:06 linux-5.15.y 9465fef4ae35 c52bcb23 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/29 04:45 linux-5.15.y 9465fef4ae35 c52bcb23 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/29 04:44 linux-5.15.y 9465fef4ae35 c52bcb23 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/28 15:34 linux-5.15.y 9465fef4ae35 e91187ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/28 14:10 linux-5.15.y 9465fef4ae35 e91187ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/28 12:04 linux-5.15.y 9465fef4ae35 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/28 08:43 linux-5.15.y 9465fef4ae35 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/27 19:32 linux-5.15.y 9465fef4ae35 120789fd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/27 00:22 linux-5.15.y 9465fef4ae35 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/26 20:35 linux-5.15.y b95c01af2113 454571b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/26 11:03 linux-5.15.y b95c01af2113 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/26 06:36 linux-5.15.y b95c01af2113 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/26 01:20 linux-5.15.y b95c01af2113 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/26 00:45 linux-5.15.y b95c01af2113 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/25 11:09 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/25 07:31 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/23 12:56 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/23 05:55 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/23 04:50 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/22 12:33 linux-5.15.y b95c01af2113 4b6cdce6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/21 18:25 linux-5.15.y b95c01af2113 7a239ce7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/21 05:01 linux-5.15.y b95c01af2113 6753db5c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/20 22:04 linux-5.15.y b95c01af2113 5b7d42ae .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in tcp_write_timer_handler
2024/02/21 18:51 linux-5.15.y 6139f2a02fe0 345111b5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/09 23:32 linux-5.15.y 9465fef4ae35 171ec371 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/09 20:21 linux-5.15.y 9465fef4ae35 171ec371 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/02 09:42 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/04/01 18:59 linux-5.15.y 9465fef4ae35 6baf5069 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/26 13:17 linux-5.15.y b95c01af2113 bcd9b39f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/25 12:22 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/24 22:57 linux-5.15.y b95c01af2113 0ea90952 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/22 13:42 linux-5.15.y b95c01af2113 4b6cdce6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/22 12:26 linux-5.15.y b95c01af2113 4b6cdce6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2024/03/21 14:13 linux-5.15.y b95c01af2113 6753db5c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in tcp_write_timer_handler
2023/03/09 08:34 linux-5.15.y d9b4a0c83a2d f08b59ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-perf KASAN: use-after-free Read in tcp_write_timer_handler
* Struck through repros no longer work on HEAD.