syzbot


KASAN: vmalloc-out-of-bounds Read in init_srcu_struct_fields (2)

Status: auto-obsoleted due to no activity on 2022/11/25 15:27
Reported-by: syzbot+a1460c894e047fa46fb0@syzkaller.appspotmail.com
First crash: 817d, last: 817d
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: vmalloc-out-of-bounds Read in init_srcu_struct_fields 1 1060d 1060d 0/2 auto-closed as invalid on 2022/04/25 21:25
upstream KASAN: vmalloc-out-of-bounds Read in init_srcu_struct_fields kvm 1 1742d 1738d 0/28 auto-closed as invalid on 2020/05/14 08:36

Sample crash report:
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in init_srcu_struct_nodes kernel/rcu/srcutree.c:153 [inline]
BUG: KASAN: vmalloc-out-of-bounds in init_srcu_struct_fields+0xf7a/0x1330 kernel/rcu/srcutree.c:183
Read of size 4 at addr ffffc900081c21f0 by task syz-executor.4/14672

CPU: 0 PID: 14672 Comm: syz-executor.4 Not tainted 5.10.136-syzkaller-00029-ga634d588813f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
 print_address_description+0x81/0x3c0 mm/kasan/report.c:233
 __kasan_report mm/kasan/report.c:419 [inline]
 kasan_report+0x1a4/0x1f0 mm/kasan/report.c:436
 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
 init_srcu_struct_nodes kernel/rcu/srcutree.c:153 [inline]
 init_srcu_struct_fields+0xf7a/0x1330 kernel/rcu/srcutree.c:183
 init_srcu_struct+0x3b/0x60 kernel/rcu/srcutree.c:216
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:772 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4007 [inline]
 kvm_dev_ioctl+0x2ab/0x1650 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4059
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0x115/0x190 fs/ioctl.c:739
 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xc6
RIP: 0033:0x7f99a132f279
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:00007f99a0463168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f99a1442120 RCX: 00007f99a132f279
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000004
RBP: 00007f99a1389189 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffdf7962a8f R14: 00007f99a0463300 R15: 0000000000022000


Memory state around the buggy address:
 ffffc900081c2080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc900081c2100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc900081c2180: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                                                             ^
 ffffc900081c2200: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc900081c2280: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================
BUG: unable to handle page fault for address: ffffc900081c21f0
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD 100000067 P4D 100000067 PUD 10012b067 PMD 10d5f9067 PTE 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 14672 Comm: syz-executor.4 Tainted: G    B             5.10.136-syzkaller-00029-ga634d588813f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/22/2022
RIP: 0010:init_srcu_struct_nodes kernel/rcu/srcutree.c:153 [inline]
RIP: 0010:init_srcu_struct_fields+0xe6c/0x1330 kernel/rcu/srcutree.c:183
Code: ea 85 4e 00 48 ba 00 00 00 00 00 fc ff df 48 8b 1b 48 83 c3 58 48 89 d8 48 c1 e8 03 8a 04 10 84 c0 0f 85 f9 00 00 00 44 89 e1 <2b> 0b bb 01 00 00 00 d3 e3 4d 8d b7 38 01 00 00 4c 89 f0 48 c1 e8
RSP: 0018:ffffc90008187cf8 EFLAGS: 00010282
RAX: ffff8881047b6201 RBX: ffffc900081c21f0 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000286 RDI: 0000000000000001
RBP: ffffc90008187d78 R08: ffffffff813ef393 R09: fffffbfff0d864f9
R10: fffffbfff0d864f9 R11: 1ffffffff0d864f8 R12: 0000000000000000
R13: 1ffff9200103b03e R14: ffffc900081d81f0 R15: ffff8881f7000000
FS:  00007f99a0463700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc900081c21f0 CR3: 000000010a7d8000 CR4: 00000000003526b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 init_srcu_struct+0x3b/0x60 kernel/rcu/srcutree.c:216
 kvm_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:772 [inline]
 kvm_dev_ioctl_create_vm arch/x86/kvm/../../../virt/kvm/kvm_main.c:4007 [inline]
 kvm_dev_ioctl+0x2ab/0x1650 arch/x86/kvm/../../../virt/kvm/kvm_main.c:4059
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl+0x115/0x190 fs/ioctl.c:739
 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739
 do_syscall_64+0x34/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x61/0xc6
RIP: 0033:0x7f99a132f279
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:00007f99a0463168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f99a1442120 RCX: 00007f99a132f279
RDX: 0000000000000000 RSI: 000000000000ae01 RDI: 0000000000000004
RBP: 00007f99a1389189 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffdf7962a8f R14: 00007f99a0463300 R15: 0000000000022000
Modules linked in:
CR2: ffffc900081c21f0
---[ end trace 8142e2c32d31aad0 ]---
RIP: 0010:init_srcu_struct_nodes kernel/rcu/srcutree.c:153 [inline]
RIP: 0010:init_srcu_struct_fields+0xe6c/0x1330 kernel/rcu/srcutree.c:183
Code: ea 85 4e 00 48 ba 00 00 00 00 00 fc ff df 48 8b 1b 48 83 c3 58 48 89 d8 48 c1 e8 03 8a 04 10 84 c0 0f 85 f9 00 00 00 44 89 e1 <2b> 0b bb 01 00 00 00 d3 e3 4d 8d b7 38 01 00 00 4c 89 f0 48 c1 e8
RSP: 0018:ffffc90008187cf8 EFLAGS: 00010282
RAX: ffff8881047b6201 RBX: ffffc900081c21f0 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000286 RDI: 0000000000000001
RBP: ffffc90008187d78 R08: ffffffff813ef393 R09: fffffbfff0d864f9
R10: fffffbfff0d864f9 R11: 1ffffffff0d864f8 R12: 0000000000000000
R13: 1ffff9200103b03e R14: ffffc900081d81f0 R15: ffff8881f7000000
FS:  00007f99a0463700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffc900081c21f0 CR3: 000000010a7d8000 CR4: 00000000003526b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess), 1 bytes skipped:
   0:	85 4e 00             	test   %ecx,0x0(%rsi)
   3:	48 ba 00 00 00 00 00 	movabs $0xdffffc0000000000,%rdx
   a:	fc ff df
   d:	48 8b 1b             	mov    (%rbx),%rbx
  10:	48 83 c3 58          	add    $0x58,%rbx
  14:	48 89 d8             	mov    %rbx,%rax
  17:	48 c1 e8 03          	shr    $0x3,%rax
  1b:	8a 04 10             	mov    (%rax,%rdx,1),%al
  1e:	84 c0                	test   %al,%al
  20:	0f 85 f9 00 00 00    	jne    0x11f
  26:	44 89 e1             	mov    %r12d,%ecx
* 29:	2b 0b                	sub    (%rbx),%ecx <-- trapping instruction
  2b:	bb 01 00 00 00       	mov    $0x1,%ebx
  30:	d3 e3                	shl    %cl,%ebx
  32:	4d 8d b7 38 01 00 00 	lea    0x138(%r15),%r14
  39:	4c 89 f0             	mov    %r14,%rax
  3c:	48                   	rex.W
  3d:	c1                   	.byte 0xc1
  3e:	e8                   	.byte 0xe8

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/08/27 15:25 android12-5.10-lts a634d588813f 07177916 .config console log report info ci2-android-5-10 KASAN: vmalloc-out-of-bounds Read in init_srcu_struct_fields
* Struck through repros no longer work on HEAD.