syzbot


general protection fault in gfs2_evict_inode

Status: fixed on 2023/07/07 16:05
Reported-by: syzbot+d96fa4241958012a7381@syzkaller.appspotmail.com
Fix commit: fd8b4e28f400 gfs2: Don't deref jdesc in evict
First crash: 589d, last: 538d
Fix bisection: fixed by (bisect log) :
commit fd8b4e28f400a067e6ef84569816967be1f0642b
Author: Bob Peterson <rpeterso@redhat.com>
Date: Fri Apr 28 16:07:46 2023 +0000

  gfs2: Don't deref jdesc in evict

  
Bug presence (1)
Date Name Commit Repro Result
2023/06/24 upstream (ToT) a92b7d26c743 C Didn't crash
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 general protection fault in gfs2_evict_inode gfs2 C error 5 676d 692d 0/1 upstream: reported C repro on 2022/12/31 21:41
upstream general protection fault in gfs2_evict_inode gfs2 2 1113d 1084d 0/28 auto-closed as invalid on 2022/03/06 05:03
upstream general protection fault in gfs2_evict_inode (2) gfs2 C error done 134 559d 880d 22/28 fixed on 2023/07/01 16:05
linux-6.1 BUG: unable to handle kernel paging request in gfs2_evict_inode origin:lts-only C inconclusive 3 538d 568d 0/3 upstream: reported C repro on 2023/05/05 09:09

Sample crash report:
gfs2: fsid=loop0.0: first mount done, others may mount
general protection fault, probably for non-canonical address 0xdffffc0000000011: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000088-0x000000000000008f]
CPU: 1 PID: 3497 Comm: syz-executor932 Not tainted 5.15.113-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023
RIP: 0010:evict_linked_inode fs/gfs2/super.c:1336 [inline]
RIP: 0010:gfs2_evict_inode+0x163a/0x1b80 fs/gfs2/super.c:1391
Code: c6 00 09 00 00 4c 89 f0 48 c1 e8 03 42 80 3c 20 00 74 08 4c 89 f7 e8 25 e4 39 fe bb 8c 00 00 00 49 03 1e 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 4c 8b 6c 24 10 0f 85 1a 04 00 00 8b 13 45 31
RSP: 0018:ffffc90002bbf880 EFLAGS: 00010207
RAX: 0000000000000011 RBX: 000000000000008c RCX: ffff888023015940
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90002bbfaa0 R08: ffffffff83889c59 R09: ffffed100365b221
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88801b2d9278 R14: ffff888078c88900 R15: ffff888070889910
FS:  0000000000000000(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ff711e11140 CR3: 000000000c68e000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 evict+0x2a4/0x620 fs/inode.c:587
 gfs2_jindex_free+0x449/0x4f0 fs/gfs2/super.c:75
 gfs2_put_super+0x74a/0x7c0 fs/gfs2/super.c:622
 generic_shutdown_super+0x136/0x2c0 fs/super.c:475
 kill_block_super+0x7a/0xe0 fs/super.c:1405
 deactivate_locked_super+0xa0/0x110 fs/super.c:335
 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 exit_task_work include/linux/task_work.h:32 [inline]
 do_exit+0x6a3/0x2480 kernel/exit.c:872
 do_group_exit+0x144/0x310 kernel/exit.c:994
 __do_sys_exit_group kernel/exit.c:1005 [inline]
 __se_sys_exit_group kernel/exit.c:1003 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1003
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7ff711d8b9a9
Code: Unable to access opcode bytes at RIP 0x7ff711d8b97f.
RSP: 002b:00007fffba7d3e08 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 00007ff711e13330 RCX: 00007ff711d8b9a9
RDX: 000000000000003c RSI: 00000000000000e7 RDI: 0000000000000001
RBP: 0000000000000001 R08: ffffffffffffffc0 R09: 0000000000012527
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff711e13330
R13: 0000000000000001 R14: 0000000000000000 R15: 0000000000000001
 </TASK>
Modules linked in:
---[ end trace bb3527c7444b430e ]---
RIP: 0010:evict_linked_inode fs/gfs2/super.c:1336 [inline]
RIP: 0010:gfs2_evict_inode+0x163a/0x1b80 fs/gfs2/super.c:1391
Code: c6 00 09 00 00 4c 89 f0 48 c1 e8 03 42 80 3c 20 00 74 08 4c 89 f7 e8 25 e4 39 fe bb 8c 00 00 00 49 03 1e 48 89 d8 48 c1 e8 03 <42> 0f b6 04 20 84 c0 4c 8b 6c 24 10 0f 85 1a 04 00 00 8b 13 45 31
RSP: 0018:ffffc90002bbf880 EFLAGS: 00010207
RAX: 0000000000000011 RBX: 000000000000008c RCX: ffff888023015940
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffffc90002bbfaa0 R08: ffffffff83889c59 R09: ffffed100365b221
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff88801b2d9278 R14: ffff888078c88900 R15: ffff888070889910
FS:  0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055954fb5e000 CR3: 000000002320f000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	c6 00 09             	movb   $0x9,(%rax)
   3:	00 00                	add    %al,(%rax)
   5:	4c 89 f0             	mov    %r14,%rax
   8:	48 c1 e8 03          	shr    $0x3,%rax
   c:	42 80 3c 20 00       	cmpb   $0x0,(%rax,%r12,1)
  11:	74 08                	je     0x1b
  13:	4c 89 f7             	mov    %r14,%rdi
  16:	e8 25 e4 39 fe       	callq  0xfe39e440
  1b:	bb 8c 00 00 00       	mov    $0x8c,%ebx
  20:	49 03 1e             	add    (%r14),%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 20       	movzbl (%rax,%r12,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	4c 8b 6c 24 10       	mov    0x10(%rsp),%r13
  36:	0f 85 1a 04 00 00    	jne    0x456
  3c:	8b 13                	mov    (%rbx),%edx
  3e:	45                   	rex.RB
  3f:	31                   	.byte 0x31

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/28 16:20 linux-5.15.y 1fe619a7d252 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan general protection fault in gfs2_evict_inode
2023/05/08 09:22 linux-5.15.y 8a7f2a5c5aa1 90c93c40 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 BUG: unable to handle kernel paging request in gfs2_evict_inode
2023/06/03 21:31 linux-5.15.y 0ab06468cbd1 a4ae4f42 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in gfs2_evict_inode
2023/04/13 20:40 linux-5.15.y 4fdad925aa1a 3cfcaa1b .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan general protection fault in gfs2_evict_inode
* Struck through repros no longer work on HEAD.