syzbot


KASAN: slab-out-of-bounds Read in tcp_retransmit_timer

Status: auto-obsoleted due to no activity on 2022/10/04 11:51
Reported-by: syzbot+00223a162cd96b9905e3@syzkaller.appspotmail.com
First crash: 1095d, last: 916d
Similar bugs (15)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer 5 1309d 1384d 0/1 auto-closed as invalid on 2021/09/06 04:07
upstream KASAN: use-after-free Read in tcp_retransmit_timer (5) net C unreliable 16000 737d 1749d 22/28 fixed on 2023/02/24 13:50
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (2) 6 1238d 1405d 0/1 auto-closed as invalid on 2021/11/16 03:14
upstream KASAN: slab-out-of-bounds Read in tcp_retransmit_timer net 90 1510d 1750d 0/28 auto-closed as invalid on 2021/01/18 22:17
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (3) 1 5d10h 5d10h 0/3 upstream: reported on 2024/12/03 12:52
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer (3) 1 770d 770d 0/1 auto-obsoleted due to no activity on 2023/02/27 17:38
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer 14 253d 271d 0/3 auto-obsoleted due to no activity on 2024/06/08 21:34
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer (2) 13 226d 412d 0/3 auto-obsoleted due to no activity on 2024/08/04 05:25
linux-6.1 KASAN: use-after-free Read in tcp_retransmit_timer (2) 1 163d 163d 0/3 auto-obsoleted due to no activity on 2024/10/06 20:00
linux-5.15 KASAN: use-after-free Read in tcp_retransmit_timer 76 521d 629d 0/3 auto-obsoleted due to no activity on 2023/09/14 02:10
linux-4.19 KASAN: use-after-free Read in tcp_retransmit_timer 2 1808d 1809d 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 2093d 2093d 0/28 closed as invalid on 2019/04/19 21:45
upstream KASAN: use-after-free Read in tcp_retransmit_timer (3) net 5 2005d 2024d 0/28 closed as invalid on 2019/07/01 18:06
upstream KASAN: use-after-free Read in tcp_retransmit_timer net 4 2136d 2249d 0/28 closed as invalid on 2019/03/10 18:51
upstream KASAN: use-after-free Read in tcp_retransmit_timer (4) net 2 1949d 1950d 0/28 closed as invalid on 2019/10/03 04:18

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in tcp_retransmit_timer+0x2fc3/0x33f0 net/ipv4/tcp_timer.c:480
Read of size 8 at addr ffff888090ce0278 by task syz-executor.3/21883

CPU: 0 PID: 21883 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0
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+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_load8_noabort+0x88/0x90 mm/kasan/report.c:433
 tcp_retransmit_timer+0x2fc3/0x33f0 net/ipv4/tcp_timer.c:480
 tcp_write_timer_handler+0x5e6/0xa60 net/ipv4/tcp_timer.c:593
 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: 0010:write_comp_data+0x0/0x70 kernel/kcov.c:116
Code: 20 48 8b 88 68 13 00 00 8b 80 64 13 00 00 48 8b 11 48 83 c2 01 48 39 d0 76 07 48 89 34 d1 48 89 11 c3 0f 1f 84 00 00 00 00 00 <49> 89 f1 49 89 fa 65 48 8b 34 25 c0 df 01 00 65 8b 05 7a 59 9f 7e
RSP: 0018:ffff88804fc5fa60 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000003 RBX: ffff88808b6e19d8 RCX: ffffffff81b07021
RDX: 0000000000000002 RSI: 0000000000000000 RDI: 0000000000000005
RBP: ffff88808b6e1a38 R08: 0000000000000000 R09: ffffed10116dc347
R10: ffff88808b6e1a3b R11: 0000000000000000 R12: 0000000000000002
R13: ffff88804fc5fc48 R14: ffff88808b6e19d8 R15: 00000000627bc442
 __brelse+0x51/0xa0 fs/buffer.c:1140
 brelse include/linux/buffer_head.h:297 [inline]
 recently_deleted fs/ext4/ialloc.c:709 [inline]
 find_inode_bit+0x3b4/0x520 fs/ext4/ialloc.c:724
 __ext4_new_inode+0x160c/0x5a20 fs/ext4/ialloc.c:916
 ext4_mkdir+0x396/0xe10 fs/ext4/namei.c:2696
 vfs_mkdir+0x508/0x7a0 fs/namei.c:3819
 do_mkdirat+0x262/0x2d0 fs/namei.c:3842
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7fbb2dc600e9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbb2c5d5168 EFLAGS: 00000246 ORIG_RAX: 0000000000000053
RAX: ffffffffffffffda RBX: 00007fbb2dd72f60 RCX: 00007fbb2dc600e9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000180
RBP: 00007fbb2dcba08d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffe16f6fcbf R14: 00007fbb2c5d5300 R15: 0000000000022000

Allocated by task 4700:
 kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
 getname_flags+0xce/0x590 fs/namei.c:140
 user_path_at_empty+0x2a/0x50 fs/namei.c:2609
 do_readlinkat+0xcd/0x2f0 fs/stat.c:394
 __do_sys_readlinkat fs/stat.c:421 [inline]
 __se_sys_readlinkat fs/stat.c:418 [inline]
 __x64_sys_readlinkat+0x93/0xf0 fs/stat.c:418
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 4700:
 __cache_free mm/slab.c:3503 [inline]
 kmem_cache_free+0x7f/0x260 mm/slab.c:3765
 putname+0xe1/0x120 fs/namei.c:261
 filename_lookup+0x3d0/0x5a0 fs/namei.c:2358
 do_readlinkat+0xcd/0x2f0 fs/stat.c:394
 __do_sys_readlinkat fs/stat.c:421 [inline]
 __se_sys_readlinkat fs/stat.c:418 [inline]
 __x64_sys_readlinkat+0x93/0xf0 fs/stat.c:418
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888090ce0ac0
 which belongs to the cache names_cache of size 4096
The buggy address is located 2120 bytes to the left of
 4096-byte region [ffff888090ce0ac0, ffff888090ce1ac0)
The buggy address belongs to the page:
page:ffffea0002433800 count:1 mapcount:0 mapping:ffff88823b843380 index:0x0 compound_mapcount: 0
flags: 0xfff00000008100(slab|head)
raw: 00fff00000008100 ffffea000152eb88 ffffea0002433888 ffff88823b843380
raw: 0000000000000000 ffff888090ce0ac0 0000000100000001 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888090ce0100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888090ce0180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888090ce0200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                                ^
 ffff888090ce0280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888090ce0300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
----------------
Code disassembly (best guess):
   0:	20 48 8b             	and    %cl,-0x75(%rax)
   3:	88 68 13             	mov    %ch,0x13(%rax)
   6:	00 00                	add    %al,(%rax)
   8:	8b 80 64 13 00 00    	mov    0x1364(%rax),%eax
   e:	48 8b 11             	mov    (%rcx),%rdx
  11:	48 83 c2 01          	add    $0x1,%rdx
  15:	48 39 d0             	cmp    %rdx,%rax
  18:	76 07                	jbe    0x21
  1a:	48 89 34 d1          	mov    %rsi,(%rcx,%rdx,8)
  1e:	48 89 11             	mov    %rdx,(%rcx)
  21:	c3                   	retq
  22:	0f 1f 84 00 00 00 00 	nopl   0x0(%rax,%rax,1)
  29:	00
* 2a:	49 89 f1             	mov    %rsi,%r9 <-- trapping instruction
  2d:	49 89 fa             	mov    %rdi,%r10
  30:	65 48 8b 34 25 c0 df 	mov    %gs:0x1dfc0,%rsi
  37:	01 00
  39:	65 8b 05 7a 59 9f 7e 	mov    %gs:0x7e9f597a(%rip),%eax        # 0x7e9f59ba

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/05/11 14:12 linux-4.19.y 3f8a27f9e27b 8d7b3b67 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer
2022/01/09 04:40 linux-4.19.y 3f8a27f9e27b 2ca0d385 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer
2021/12/09 10:24 linux-4.19.y 3f8a27f9e27b a4a2a501 .config console log report info ci2-linux-4-19 KASAN: slab-out-of-bounds Read in tcp_retransmit_timer
2022/06/06 11:51 linux-4.19.y 3f8a27f9e27b c8857892 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_retransmit_timer
2022/05/11 01:41 linux-4.19.y 3f8a27f9e27b 8d7b3b67 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_retransmit_timer
2022/04/27 22:16 linux-4.19.y 3f8a27f9e27b 1fa34c1b .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_retransmit_timer
2022/04/14 20:50 linux-4.19.y 3f8a27f9e27b b17b2923 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_retransmit_timer
2022/01/25 07:29 linux-4.19.y 3f8a27f9e27b 2cbffd88 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_retransmit_timer
2021/12/27 12:11 linux-4.19.y 3f8a27f9e27b e4f103c4 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in tcp_retransmit_timer
* Struck through repros no longer work on HEAD.