syzbot


general protection fault in xas_create_range

Status: fixed on 2023/02/24 13:50
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+0d2b0bf32ca5cfd09f2e@syzkaller.appspotmail.com
Fix commit: 3e3c658055c0 XArray: Fix xas_create_range() when multi-order entry present
First crash: 770d, last: 770d
Discussions (6)
Title Replies (including bot) Last reply
[PATCH 5.10 000/599] 5.10.110-rc1 review 628 (629) 2022/05/08 12:31
[PATCH 5.4 000/475] 5.4.189-rc1 review 485 (486) 2022/04/15 15:35
[PATCH 5.16 0000/1017] 5.16.19-rc1 review 1034 (1035) 2022/04/07 08:34
[PATCH 5.15 000/913] 5.15.33-rc1 review 932 (933) 2022/04/06 15:36
[PATCH 5.17 0000/1126] 5.17.2-rc1 review 1143 (1144) 2022/04/06 14:06
[syzbot] general protection fault in xas_create_range 1 (2) 2022/03/24 21:45

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
CPU: 0 PID: 32 Comm: khugepaged Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:xa_parent_locked include/linux/xarray.h:1207 [inline]
RIP: 0010:xas_create_range+0x2d9/0x6e0 lib/xarray.c:725
Code: 89 ee 49 83 ed 40 49 c1 ee 03 4c 89 6d 08 4c 8d 6d 12 4d 01 e6 e9 93 00 00 00 e8 d2 0f 72 fd 48 8d 7b 08 48 89 f8 48 c1 e8 03 <42> 80 3c 20 00 0f 85 fb 02 00 00 48 8b 04 24 4c 8b 7b 08 80 38 00
RSP: 0018:ffffc90001097a48 EFLAGS: 00010002
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff8880139de240 RSI: ffffffff8405e5be RDI: 0000000000000008
RBP: ffffc90001097bb0 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff8405e679 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffc90001097bc2 R14: fffff52000212f76 R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe25571c98 CR3: 0000000079206000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 collapse_file+0x2d3/0x3c40 mm/khugepaged.c:1678
 khugepaged_scan_file mm/khugepaged.c:2073 [inline]
 khugepaged_scan_mm_slot mm/khugepaged.c:2168 [inline]
 khugepaged_do_scan mm/khugepaged.c:2252 [inline]
 khugepaged+0x53c7/0x6c00 mm/khugepaged.c:2297
 kthread+0x2e9/0x3a0 kernel/kthread.c:377
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:xa_parent_locked include/linux/xarray.h:1207 [inline]
RIP: 0010:xas_create_range+0x2d9/0x6e0 lib/xarray.c:725
Code: 89 ee 49 83 ed 40 49 c1 ee 03 4c 89 6d 08 4c 8d 6d 12 4d 01 e6 e9 93 00 00 00 e8 d2 0f 72 fd 48 8d 7b 08 48 89 f8 48 c1 e8 03 <42> 80 3c 20 00 0f 85 fb 02 00 00 48 8b 04 24 4c 8b 7b 08 80 38 00
RSP: 0018:ffffc90001097a48 EFLAGS: 00010002
RAX: 0000000000000001 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff8880139de240 RSI: ffffffff8405e5be RDI: 0000000000000008
RBP: ffffc90001097bb0 R08: 0000000000000000 R09: 0000000000000000
R10: ffffffff8405e679 R11: 0000000000000000 R12: dffffc0000000000
R13: ffffc90001097bc2 R14: fffff52000212f76 R15: 0000000000000001
FS:  0000000000000000(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffe25571c98 CR3: 0000000079206000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	89 ee                	mov    %ebp,%esi
   2:	49 83 ed 40          	sub    $0x40,%r13
   6:	49 c1 ee 03          	shr    $0x3,%r14
   a:	4c 89 6d 08          	mov    %r13,0x8(%rbp)
   e:	4c 8d 6d 12          	lea    0x12(%rbp),%r13
  12:	4d 01 e6             	add    %r12,%r14
  15:	e9 93 00 00 00       	jmpq   0xad
  1a:	e8 d2 0f 72 fd       	callq  0xfd720ff1
  1f:	48 8d 7b 08          	lea    0x8(%rbx),%rdi
  23:	48 89 f8             	mov    %rdi,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1) <-- trapping instruction
  2f:	0f 85 fb 02 00 00    	jne    0x330
  35:	48 8b 04 24          	mov    (%rsp),%rax
  39:	4c 8b 7b 08          	mov    0x8(%rbx),%r15
  3d:	80 38 00             	cmpb   $0x0,(%rax)

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/03/17 11:51 upstream 56e337f2cf13 dfa9a8ed .config console log report info ci-upstream-kasan-gce-selinux-root general protection fault in xas_create_range
* Struck through repros no longer work on HEAD.