syzbot


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

Status: auto-closed as invalid on 2019/12/04 07:54
Subsystems: net
[Documentation on labels]
First crash: 1741d, last: 1680d
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 1588d 1588d 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 1866d 1929d 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 1281d 1281d 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 1828d 1829d 0/26 closed as invalid on 2019/05/15 23:07
linux-5.15 KASAN: use-after-free Read in tcp_write_timer_handler origin:upstream C 230 8d16h 412d 0/3 upstream: reported C repro on 2023/03/09 08:35
linux-6.1 KASAN: use-after-free Read in tcp_write_timer_handler 138 16d 413d 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 575d 1089d 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 498d 1524d 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:360 [inline]
BUG: KASAN: use-after-free in tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596
Read of size 4 at addr ffff888072c22650 by task syz-executor.5/13555

CPU: 0 PID: 13555 Comm: syz-executor.5 Not tainted 5.3.0-rc4 #107
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+0xd4/0x306 mm/kasan/report.c:351
 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482
 kasan_report+0x12/0x17 mm/kasan/common.c:612
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131
 tcp_probe_timer net/ipv4/tcp_timer.c:360 [inline]
 tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596
 tcp_write_timer+0xa8/0x1e0 net/ipv4/tcp_timer.c:612
 call_timer_fn+0x1ac/0x780 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+0x697/0x17a0 kernel/time/timer.c:1698
 __do_softirq+0x262/0x98c kernel/softirq.c:292
 invoke_softirq kernel/softirq.c:373 [inline]
 irq_exit+0x19b/0x1e0 kernel/softirq.c:413
 exiting_irq arch/x86/include/asm/apic.h:537 [inline]
 smp_apic_timer_interrupt+0x1a3/0x610 arch/x86/kernel/apic/apic.c:1095
 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830
 </IRQ>
RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline]
RIP: 0010:_raw_spin_unlock_irq+0x54/0x90 kernel/locking/spinlock.c:199
Code: c0 20 f3 d2 88 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 75 33 48 83 3d d5 57 95 01 00 74 20 fb 66 0f 1f 44 00 00 <bf> 01 00 00 00 e8 12 24 11 fa 65 8b 05 a3 62 c4 78 85 c0 74 06 41
RSP: 0018:ffff88805d7cfb20 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13
RAX: 1ffffffff11a5e64 RBX: ffff88809007a400 RCX: 1ffffffff134b48e
RDX: dffffc0000000000 RSI: ffffffff8177ee6e RDI: ffffffff873d9b28
RBP: ffff88805d7cfb28 R08: ffff88809007a400 R09: ffffed1015d06ad1
R10: ffffed1015d06ad0 R11: ffff8880ae835683 R12: ffff8880ae835680
R13: ffff88808d1c2640 R14: 0000000000000000 R15: 0000000000000001
 finish_lock_switch kernel/sched/core.c:3004 [inline]
 finish_task_switch+0x147/0x720 kernel/sched/core.c:3104
 context_switch kernel/sched/core.c:3257 [inline]
 __schedule+0x75d/0x1580 kernel/sched/core.c:3880
 schedule+0xa8/0x270 kernel/sched/core.c:3944
 freezable_schedule include/linux/freezer.h:172 [inline]
 do_nanosleep+0x201/0x6a0 kernel/time/hrtimer.c:1679
 hrtimer_nanosleep+0x2a6/0x570 kernel/time/hrtimer.c:1733
 __do_sys_nanosleep kernel/time/hrtimer.c:1767 [inline]
 __se_sys_nanosleep kernel/time/hrtimer.c:1754 [inline]
 __x64_sys_nanosleep+0x1a6/0x220 kernel/time/hrtimer.c:1754
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x457cd0
Code: c0 5b 5d c3 66 0f 1f 44 00 00 8b 04 24 48 83 c4 18 5b 5d c3 66 0f 1f 44 00 00 83 3d 81 ea 61 00 00 75 14 b8 23 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 24 d3 fb ff c3 48 83 ec 08 e8 ea 46 00 00
RSP: 002b:00007ffed2d2b028 EFLAGS: 00000246 ORIG_RAX: 0000000000000023
RAX: ffffffffffffffda RBX: 00000000002c9a20 RCX: 0000000000457cd0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffed2d2b030
RBP: 000000000000039e R08: 0000000000000001 R09: 00005555557d1940
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000001b
R13: 00007ffed2d2b080 R14: 00000000002c9934 R15: 00007ffed2d2b090

Allocated by task 32343:
 save_stack+0x23/0x90 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_kmalloc mm/kasan/common.c:487 [inline]
 __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:460
 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:495
 slab_post_alloc_hook mm/slab.h:520 [inline]
 slab_alloc mm/slab.c:3319 [inline]
 kmem_cache_alloc+0x121/0x710 mm/slab.c:3483
 kmem_cache_zalloc include/linux/slab.h:738 [inline]
 net_alloc net/core/net_namespace.c:410 [inline]
 copy_net_ns+0xf1/0x41f net/core/net_namespace.c:462
 create_new_namespaces+0x400/0x7b0 kernel/nsproxy.c:103
 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202
 ksys_unshare+0x444/0x980 kernel/fork.c:2831
 __do_sys_unshare kernel/fork.c:2899 [inline]
 __se_sys_unshare kernel/fork.c:2897 [inline]
 __x64_sys_unshare+0x31/0x40 kernel/fork.c:2897
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 1948:
 save_stack+0x23/0x90 mm/kasan/common.c:69
 set_track mm/kasan/common.c:77 [inline]
 __kasan_slab_free+0x102/0x150 mm/kasan/common.c:449
 kasan_slab_free+0xe/0x10 mm/kasan/common.c:457
 __cache_free mm/slab.c:3425 [inline]
 kmem_cache_free+0x86/0x320 mm/slab.c:3693
 net_free net/core/net_namespace.c:438 [inline]
 net_drop_ns.part.0+0x70/0x90 net/core/net_namespace.c:445
 net_drop_ns net/core/net_namespace.c:444 [inline]
 cleanup_net+0x77a/0xa70 net/core/net_namespace.c:613
 process_one_work+0x9af/0x1740 kernel/workqueue.c:2269
 worker_thread+0x98/0xe40 kernel/workqueue.c:2415
 kthread+0x361/0x430 kernel/kthread.c:255
 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:352

The buggy address belongs to the object at ffff888072c22080
 which belongs to the cache net_namespace of size 6784
The buggy address is located 1488 bytes inside of
 6784-byte region [ffff888072c22080, ffff888072c23b00)
The buggy address belongs to the page:
page:ffffea0001cb0880 refcount:1 mapcount:0 mapping:ffff8880a9ddd000 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea00023c0a08 ffffea000250c788 ffff8880a9ddd000
raw: 0000000000000000 ffff888072c22080 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888072c22500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888072c22580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888072c22600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                                 ^
 ffff888072c22680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888072c22700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (82):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/08/12 23:59 upstream d45331b00ddb 8620c2c2 .config console log report ci-upstream-kasan-gce-root
2019/08/12 05:15 upstream d45331b00ddb acb51638 .config console log report ci-upstream-kasan-gce-root
2019/08/04 18:53 upstream 4b6f23161b4e 6affd8e8 .config console log report ci-upstream-kasan-gce-root
2019/08/04 08:54 upstream d8778f13b73f 6affd8e8 .config console log report ci-upstream-kasan-gce-386
2019/09/18 22:20 net-old 00b368502d18 c2dcd700 .config console log report ci-upstream-net-this-kasan-gce
2019/09/18 08:20 net-old 00b368502d18 03e0d245 .config console log report ci-upstream-net-this-kasan-gce
2019/09/06 09:26 net-old 7bdf4de12677 040fda58 .config console log report ci-upstream-net-this-kasan-gce
2019/09/05 07:25 net-old d471c6f77480 040fda58 .config console log report ci-upstream-net-this-kasan-gce
2019/09/04 18:20 net-old e33b4325e60e 040fda58 .config console log report ci-upstream-net-this-kasan-gce
2019/09/04 03:20 net-old e33b4325e60e 526709ff .config console log report ci-upstream-net-this-kasan-gce
2019/09/03 19:52 net-old e33b4325e60e 48448e71 .config console log report ci-upstream-net-this-kasan-gce
2019/09/02 17:10 net-old e1e54ec7fb55 14544a56 .config console log report ci-upstream-net-this-kasan-gce
2019/09/02 09:18 net-old dd7078f05e1b db7c31ca .config console log report ci-upstream-net-this-kasan-gce
2019/09/01 16:42 net-old 879c3808a4a1 bad3cce2 .config console log report ci-upstream-net-this-kasan-gce
2019/09/01 12:33 net-old 879c3808a4a1 bad3cce2 .config console log report ci-upstream-net-this-kasan-gce
2019/08/31 17:05 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/31 14:37 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/30 01:49 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/29 21:18 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/29 13:30 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/29 09:50 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/28 12:40 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/27 13:39 net-old f53a7ad18959 d21c5d9d .config console log report ci-upstream-net-this-kasan-gce
2019/08/27 04:24 net-old f53a7ad18959 d21c5d9d .config console log report ci-upstream-net-this-kasan-gce
2019/08/25 11:10 net-old 12e2e15d837f d21c5d9d .config console log report ci-upstream-net-this-kasan-gce
2019/08/21 04:35 net-old a1c4cd67840e 4ea67ff8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/20 19:31 net-old 1edfb8ed6cc1 cfc9868f .config console log report ci-upstream-net-this-kasan-gce
2019/08/20 18:22 net-old 1edfb8ed6cc1 cfc9868f .config console log report ci-upstream-net-this-kasan-gce
2019/08/20 07:57 net-old cfef46d692ef ee12860b .config console log report ci-upstream-net-this-kasan-gce
2019/08/19 16:11 net-old 4a4d2d372fb9 b8ceabfc .config console log report ci-upstream-net-this-kasan-gce
2019/08/19 05:21 net-old 4a4d2d372fb9 b8ceabfc .config console log report ci-upstream-net-this-kasan-gce
2019/08/17 20:15 net-old 712042313b23 55bf8926 .config console log report ci-upstream-net-this-kasan-gce
2019/08/17 14:38 net-old 712042313b23 8fd428a1 .config console log report ci-upstream-net-this-kasan-gce
2019/08/17 07:04 net-old 12ed60151345 8fd428a1 .config console log report ci-upstream-net-this-kasan-gce
2019/08/16 14:09 net-old 2aafdf5a5786 8fd428a1 .config console log report ci-upstream-net-this-kasan-gce
2019/08/09 08:41 net-old 8c25d0887a8b ede31a9b .config console log report ci-upstream-net-this-kasan-gce
2019/08/09 05:15 net-old f6649feb264e ede31a9b .config console log report ci-upstream-net-this-kasan-gce
2019/08/07 16:29 net-old 33920f1ec5bf cdde7486 .config console log report ci-upstream-net-this-kasan-gce
2019/08/06 01:13 net-old 107e47cc80ec 6affd8e8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/03 22:30 net-old 107e47cc80ec 6affd8e8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/03 18:01 net-old 107e47cc80ec 6affd8e8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/02 06:57 net-old 107e47cc80ec 835dffe7 .config console log report ci-upstream-net-this-kasan-gce
2019/07/30 06:48 net-old 107e47cc80ec f67095ee .config console log report ci-upstream-net-this-kasan-gce
2019/07/26 22:06 net-old 107e47cc80ec 3e5d1beb .config console log report ci-upstream-net-this-kasan-gce
2019/07/23 23:03 net-old 107e47cc80ec de453f34 .config console log report ci-upstream-net-this-kasan-gce
2019/07/22 18:31 net-old 107e47cc80ec b3c615f5 .config console log report ci-upstream-net-this-kasan-gce
2019/07/22 10:51 net-old 107e47cc80ec b3c615f5 .config console log report ci-upstream-net-this-kasan-gce
2019/07/21 10:32 net-old 89099d855bf0 1656845f .config console log report ci-upstream-net-this-kasan-gce
2019/08/13 09:01 net-next-old 53f6f391786e 8620c2c2 .config console log report ci-upstream-net-kasan-gce
2019/08/03 16:38 net-next-old 31cc088a4f5d 6affd8e8 .config console log report ci-upstream-net-kasan-gce
2019/07/27 19:30 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/27 16:54 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/27 08:25 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/27 02:14 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/26 21:14 net-next-old 31cc088a4f5d 3e5d1beb .config console log report ci-upstream-net-kasan-gce
2019/07/26 17:47 net-next-old 31cc088a4f5d 3e5d1beb .config console log report ci-upstream-net-kasan-gce
2019/07/26 08:10 net-next-old 31cc088a4f5d 732bc5a0 .config console log report ci-upstream-net-kasan-gce
2019/07/26 01:12 net-next-old 31cc088a4f5d 732bc5a0 .config console log report ci-upstream-net-kasan-gce
2019/07/19 01:16 net-next-old 192f0f8e9db7 7bb222f7 .config console log report ci-upstream-net-kasan-gce
2019/07/29 17:14 linux-next 0d8b3265d9a6 f67095ee .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.