syzbot


KASAN: slab-out-of-bounds Read in tcp_write_timer_handler (2)

Status: auto-closed as invalid on 2019/12/08 17:54
Subsystems: net
[Documentation on labels]
First crash: 1728d, last: 1682d
Similar bugs (6)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler net 1 1823d 1823d 0/26 closed as invalid on 2019/05/15 23:07
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler (3) net 10 1295d 1506d 0/26 auto-closed as invalid on 2020/12/30 02:27
upstream KASAN: slab-out-of-bounds Read in tcp_write_timer_handler (4) net 1 1182d 1182d 0/26 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 1310d 1310d 0/1 auto-closed as invalid on 2021/01/13 10:13
linux-4.19 KASAN: use-after-free Read in tcp_write_timer_handler (2) 12 568d 1083d 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 491d 1517d 0/26 closed as invalid on 2023/03/21 22:54

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in tcp_probe_timer net/ipv4/tcp_timer.c:360 [inline]
BUG: KASAN: slab-out-of-bounds in tcp_write_timer_handler+0x8c6/0x8d0 net/ipv4/tcp_timer.c:596
Read of size 4 at addr ffff8880708706d0 by task udevd/22647

CPU: 0 PID: 22647 Comm: udevd Not tainted 5.3.0-rc2+ #110
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:828
 </IRQ>
RIP: 0010:__read_once_size include/linux/compiler.h:199 [inline]
RIP: 0010:tomoyo_domain_quota_is_ok+0xe4/0x540 security/tomoyo/util.c:1031
Code: 00 00 00 fc ff df 48 c1 ea 03 80 3c 02 00 0f 85 fc 03 00 00 48 8b 45 c8 45 31 f6 4c 8b 60 10 4c 3b 65 d0 75 33 e9 ca 00 00 00 <e8> d7 6d 6c fe 4c 89 e0 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03
RSP: 0018:ffff88805f49f7e0 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000000 RBX: 0000000000000010 RCX: ffffffff830633e5
RDX: 0000000000000010 RSI: 0000000000000010 RDI: 0000000000000001
RBP: ffff88805f49f820 R08: ffff8880a0d2e040 R09: ffffed100be93f11
R10: ffffed100be93f10 R11: 0000000000000000 R12: ffff888090d02d80
R13: 0000000000000022 R14: 00000000000000dc R15: 0000000000000000
 tomoyo_supervisor+0x2e8/0xef0 security/tomoyo/common.c:2087
 tomoyo_audit_path2_log security/tomoyo/file.c:182 [inline]
 tomoyo_path2_perm+0x471/0x670 security/tomoyo/file.c:943
 tomoyo_path_rename+0xee/0x150 security/tomoyo/tomoyo.c:285
 security_path_rename+0x20c/0x300 security/security.c:1039
 do_renameat2+0x7b8/0xc40 fs/namei.c:4623
 __do_sys_rename fs/namei.c:4673 [inline]
 __se_sys_rename fs/namei.c:4671 [inline]
 __x64_sys_rename+0x61/0x80 fs/namei.c:4671
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f399aec3527
Code: 32 00 64 83 38 15 74 07 b8 ff ff ff ff 5b c3 48 89 df e8 1c c1 07 00 85 c0 75 ed 31 c0 eb d3 90 90 90 90 b8 52 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e1 f8 32 00 31 d2 48 29 c2 64
RSP: 002b:00007ffea9842788 EFLAGS: 00000246 ORIG_RAX: 0000000000000052
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f399aec3527
RDX: 00007f399b1f4e98 RSI: 00007ffea98427c0 RDI: 00007ffea9842bc0
RBP: 0000000000d352d0 R08: 00007f399b8367a0 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000d3a520
R13: 0000000000d35250 R14: 00007ffea98427c0 R15: 0000000000000001

Allocated by task 737:
 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_kmalloc+0x9/0x10 mm/kasan/common.c:501
 __do_kmalloc_node mm/slab.c:3615 [inline]
 __kmalloc_node+0x4e/0x70 mm/slab.c:3622
 kmalloc_node include/linux/slab.h:595 [inline]
 kvmalloc_node+0x68/0x100 mm/util.c:459
 kvmalloc include/linux/mm.h:670 [inline]
 seq_buf_alloc fs/seq_file.c:32 [inline]
 seq_read+0x817/0x1110 fs/seq_file.c:204
 kernfs_fop_read+0xed/0x560 fs/kernfs/file.c:251
 __vfs_read+0x8a/0x110 fs/read_write.c:425
 vfs_read+0x1f0/0x440 fs/read_write.c:461
 ksys_read+0x14f/0x290 fs/read_write.c:587
 __do_sys_read fs/read_write.c:597 [inline]
 __se_sys_read fs/read_write.c:595 [inline]
 __x64_sys_read+0x73/0xb0 fs/read_write.c:595
 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 737:
 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]
 kfree+0x10a/0x2c0 mm/slab.c:3756
 kvfree+0x61/0x70 mm/util.c:488
 seq_release+0x54/0x80 fs/seq_file.c:360
 kernfs_fop_release+0xf7/0x1a0 fs/kernfs/file.c:780
 __fput+0x2ff/0x890 fs/file_table.c:280
 ____fput+0x16/0x20 fs/file_table.c:313
 task_work_run+0x145/0x1c0 kernel/task_work.c:113
 tracehook_notify_resume include/linux/tracehook.h:188 [inline]
 exit_to_usermode_loop+0x316/0x380 arch/x86/entry/common.c:163
 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:274 [inline]
 do_syscall_64+0x5a9/0x6a0 arch/x86/entry/common.c:299
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888070870700
 which belongs to the cache kmalloc-4k of size 4096
The buggy address is located 48 bytes to the left of
 4096-byte region [ffff888070870700, ffff888070871700)
The buggy address belongs to the page:
page:ffffea0001c21c00 refcount:1 mapcount:0 mapping:ffff8880aa402000 index:0x0 compound_mapcount: 0
flags: 0x1fffc0000010200(slab|head)
raw: 01fffc0000010200 ffffea0002a43a88 ffffea0002a6ab88 ffff8880aa402000
raw: 0000000000000000 ffff888070870700 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888070870580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888070870600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888070870680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                 ^
 ffff888070870700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff888070870780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (24):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/07/31 16:36 upstream 4010b622f1d2 c692b5bd .config console log report ci-upstream-kasan-gce
2019/07/28 15:38 upstream a9815a4fa2fd c85e1c5b .config console log report ci-upstream-kasan-gce-root
2019/09/09 17:51 net-old 28abe5796252 a60cb4cd .config console log report ci-upstream-net-this-kasan-gce
2019/09/06 10:20 net-old 7bdf4de12677 040fda58 .config console log report ci-upstream-net-this-kasan-gce
2019/08/31 07:09 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/31 00:37 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/29 07:54 net-old 9e8312f5e160 fd37b39e .config console log report ci-upstream-net-this-kasan-gce
2019/08/27 17:38 net-old f53a7ad18959 d21c5d9d .config console log report ci-upstream-net-this-kasan-gce
2019/08/23 20:38 net-old f6edbf2d6164 78ded196 .config console log report ci-upstream-net-this-kasan-gce
2019/08/19 22:19 net-old cfef46d692ef ee12860b .config console log report ci-upstream-net-this-kasan-gce
2019/08/14 23:10 net-old a1794de8b92e 5576551b .config console log report ci-upstream-net-this-kasan-gce
2019/08/09 19:53 net-old 8c25d0887a8b ede31a9b .config console log report ci-upstream-net-this-kasan-gce
2019/08/09 13:23 net-old 8c25d0887a8b ede31a9b .config console log report ci-upstream-net-this-kasan-gce
2019/08/06 02:06 net-old 107e47cc80ec 6affd8e8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/05 14:08 net-old 107e47cc80ec 6affd8e8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/04 23:57 net-old 107e47cc80ec 6affd8e8 .config console log report ci-upstream-net-this-kasan-gce
2019/08/02 20:20 net-old 107e47cc80ec 835dffe7 .config console log report ci-upstream-net-this-kasan-gce
2019/07/25 14:37 net-old 107e47cc80ec 32329ceb .config console log report ci-upstream-net-this-kasan-gce
2019/08/22 11:26 net-next-old 4f830a5af7b5 984250d5 .config console log report ci-upstream-net-kasan-gce
2019/07/29 09:16 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/29 05:48 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/29 02:07 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/28 21:53 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
2019/07/27 12:04 net-next-old 31cc088a4f5d c85e1c5b .config console log report ci-upstream-net-kasan-gce
* Struck through repros no longer work on HEAD.