syzbot


general protection fault in ext4_acquire_dquot

Status: fixed on 2023/09/06 18:13
Reported-by: syzbot+eeb3feb44c9a5a30c748@syzkaller.appspotmail.com
Fix commit: 32c2f51fffec quota: Properly disable quotas when add_dquot_ref() fails
First crash: 299d, last: 251d
Cause bisection: introduced by (bisect log) :
commit 214194610a18477146588eeb2c8e120fdea21150
Author: Jan Kara <jack@suse.cz>
Date: Thu Sep 8 09:21:27 2022 +0000

  ext4: use locality group preallocation for small closed files

Crash: general protection fault in ext4_acquire_dquot (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit d55e76e11592a1d18a179c7fd34ca1b52632beb3
Author: Ye Bin <yebin10@huawei.com>
Date: Mon Jan 16 02:00:15 2023 +0000

  ext4: fix WARNING in mb_find_extent

  
Bug presence (2)
Date Name Commit Repro Result
2023/07/06 lts (merge base) 4af60700a60c C Didn't crash
2023/07/06 upstream (ToT) c17414a273b8 C Didn't crash
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: unable to handle kernel paging request in ext4_acquire_dquot origin:lts-only C done 2 257d 292d 3/3 fixed on 2023/08/04 15:57
android-6-1 general protection fault in ext4_acquire_dquot origin:lts C done done 1 159d 283d 0/2 auto-obsoleted due to no activity on 2024/01/03 10:28
upstream general protection fault in ext4_acquire_dquot ext4 C 4 255d 295d 23/26 fixed on 2023/10/12 12:47
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/09/05 01:58 4h22m bisect fix android13-5.15-lts job log (1)
2023/06/25 14:01 20m bisect fix android13-5.15-lts job log (0) log

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000005: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000028-0x000000000000002f]
CPU: 0 PID: 528 Comm: syz-executor261 Tainted: G        W         5.15.106-syzkaller-00249-g19c0ed55a470 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
RIP: 0010:ext4_acquire_dquot+0x22e/0x3f0 fs/ext4/super.c:6161
Code: 9c d8 80 01 00 00 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 b0 fa ba ff 4c 8b 33 49 83 c6 28 4c 89 f0 48 c1 e8 03 <42> 80 3c 38 00 74 08 4c 89 f7 e8 93 fa ba ff bb c8 03 00 00 49 03
RSP: 0018:ffffc900012f7498 EFLAGS: 00010206
RAX: 0000000000000005 RBX: ffff8881063d9180 RCX: ffff888110b9e2c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: ffffc900012f74e8 R08: ffffffff81f637df R09: ffffed10238be5cb
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000162
R13: 0000000000000049 R14: 0000000000000028 R15: dffffc0000000000
FS:  00007f3c04737700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffee9b537c0 CR3: 0000000104fe3000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 dqget+0x9d4/0xde0 fs/quota/dquot.c:914
 __dquot_initialize+0x2d9/0xe10 fs/quota/dquot.c:1492
 dquot_initialize fs/quota/dquot.c:1550 [inline]
 dquot_file_open+0x83/0xb0 fs/quota/dquot.c:2174
 ext4_file_open+0x2cf/0x700 fs/ext4/file.c:883
 do_dentry_open+0x81c/0xfd0 fs/open.c:828
 vfs_open+0x73/0x80 fs/open.c:958
 do_open fs/namei.c:3538 [inline]
 path_openat+0x26f0/0x2f40 fs/namei.c:3672
 do_filp_open+0x21c/0x460 fs/namei.c:3699
 do_sys_openat2+0x13b/0x500 fs/open.c:1234
 do_sys_open fs/open.c:1250 [inline]
 __do_sys_openat fs/open.c:1266 [inline]
 __se_sys_openat fs/open.c:1261 [inline]
 __x64_sys_openat+0x243/0x290 fs/open.c:1261
 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:0x7f3c0cb8d679
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 71 15 00 00 90 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:00007f3c047372f8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f3c0cc127c0 RCX: 00007f3c0cb8d679
RDX: 000000000000275a RSI: 0000000020000040 RDI: 00000000ffffff9c
RBP: 00007f3c0cbdf58c R08: 00007f3c04737700 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f3c0cbdf0c0
R13: 0000000020000ec0 R14: 0030656c69662f2e R15: 00007f3c0cc127c8
 </TASK>
Modules linked in:
---[ end trace ae5e43b253dd7532 ]---
RIP: 0010:ext4_acquire_dquot+0x22e/0x3f0 fs/ext4/super.c:6161
Code: 9c d8 80 01 00 00 48 89 d8 48 c1 e8 03 42 80 3c 38 00 74 08 48 89 df e8 b0 fa ba ff 4c 8b 33 49 83 c6 28 4c 89 f0 48 c1 e8 03 <42> 80 3c 38 00 74 08 4c 89 f7 e8 93 fa ba ff bb c8 03 00 00 49 03
RSP: 0018:ffffc900012f7498 EFLAGS: 00010206
RAX: 0000000000000005 RBX: ffff8881063d9180 RCX: ffff888110b9e2c0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: ffffc900012f74e8 R08: ffffffff81f637df R09: ffffed10238be5cb
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000162
R13: 0000000000000049 R14: 0000000000000028 R15: dffffc0000000000
FS:  00007f3c04737700(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffee9b537c0 CR3: 0000000104fe3000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	9c                   	pushfq
   1:	d8 80 01 00 00 48    	fadds  0x48000001(%rax)
   7:	89 d8                	mov    %ebx,%eax
   9:	48 c1 e8 03          	shr    $0x3,%rax
   d:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1)
  12:	74 08                	je     0x1c
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 b0 fa ba ff       	callq  0xffbafacc
  1c:	4c 8b 33             	mov    (%rbx),%r14
  1f:	49 83 c6 28          	add    $0x28,%r14
  23:	4c 89 f0             	mov    %r14,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 38 00       	cmpb   $0x0,(%rax,%r15,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	4c 89 f7             	mov    %r14,%rdi
  34:	e8 93 fa ba ff       	callq  0xffbafacc
  39:	bb c8 03 00 00       	mov    $0x3c8,%ebx
  3e:	49                   	rex.WB
  3f:	03                   	.byte 0x3

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/24 09:11 android13-5.15-lts 19c0ed55a470 4bce1a3e .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 general protection fault in ext4_acquire_dquot
2023/05/08 13:50 android13-5.15-lts 19c0ed55a470 90c93c40 .config strace log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-15 general protection fault in ext4_acquire_dquot
* Struck through repros no longer work on HEAD.