syzbot


general protection fault in erofs_bread (2)

Status: fixed on 2023/07/01 16:05
Subsystems: erofs
[Documentation on labels]
Reported-by: syzbot+bbb353775d51424087f2@syzkaller.appspotmail.com
Fix commit: 0a17567b4a85 erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init
First crash: 352d, last: 322d
Cause bisection: introduced by (bisect log) :
commit 6a318ccd7e083729cbcdbd174d7070f6b7d24130
Author: Jingbo Xu <jefflexu@linux.alibaba.com>
Date: Fri Apr 7 22:28:08 2023 +0000

  erofs: enable long extended attribute name prefixes

Crash: general protection fault in erofs_bread (log)
Repro: C syz .config
  
Discussions (3)
Title Replies (including bot) Last reply
[PATCH v2] erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init 3 (3) 2023/05/23 06:25
[syzbot] [erofs?] general protection fault in erofs_bread (2) 1 (4) 2023/05/18 00:06
[PATCH] erofs: fix null-ptr-deref caused by erofs_xattr_prefixes_init 2 (2) 2023/05/15 09:30
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in erofs_bread erofs C error 3 531d 540d 22/26 fixed on 2023/02/24 13:50
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/05/17 18:15 19m hsiangkao@linux.alibaba.com git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git fixes OK log

Sample crash report:
erofs: (device loop0): EXPERIMENTAL global deduplication feature in use. Use at your own risk!
general protection fault, probably for non-canonical address 0xdffffc0000000019: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x00000000000000c8-0x00000000000000cf]
CPU: 0 PID: 4995 Comm: syz-executor235 Not tainted 6.4.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
RIP: 0010:erofs_bread+0x56/0x6d0 fs/erofs/data.c:38
Code: 48 c1 ea 03 80 3c 02 00 0f 85 15 06 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 23 49 8d bc 24 ca 00 00 00 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 82 05 00 00
RSP: 0018:ffffc900034b7980 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffc900034b7af8 RCX: 0000000000000000
RDX: 0000000000000019 RSI: ffffffff83c1ea5f RDI: 00000000000000ca
RBP: 0000000000000000 R08: 0000000000000001 R09: 000000000000003f
R10: 000000000000000c R11: ffffffff81d50f12 R12: 0000000000000000
R13: 0000000000000001 R14: ffff888019bd4000 R15: ffff888019bd4000
FS:  0000555555bf6300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fc664ae0ca0 CR3: 0000000020cc6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 erofs_read_metadata+0xbb/0x490 fs/erofs/super.c:137
 erofs_xattr_prefixes_init+0x3b1/0x590 fs/erofs/xattr.c:684
 erofs_fc_fill_super+0x1734/0x2a80 fs/erofs/super.c:825
 get_tree_bdev+0x44a/0x770 fs/super.c:1303
 vfs_get_tree+0x8d/0x350 fs/super.c:1510
 do_new_mount fs/namespace.c:3039 [inline]
 path_mount+0x134b/0x1e40 fs/namespace.c:3369
 do_mount fs/namespace.c:3382 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc664b09e5a
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd1310be98 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fc664b09e5a
RDX: 0000000020000180 RSI: 0000000020000140 RDI: 00007ffd1310bea0
RBP: 00007ffd1310bea0 R08: 00007ffd1310bee0 R09: 00000000000001d4
R10: 0000000001000801 R11: 0000000000000286 R12: 0000000000000005
R13: 0000555555bf62c0 R14: 00007ffd1310bee0 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:erofs_bread+0x56/0x6d0 fs/erofs/data.c:38
Code: 48 c1 ea 03 80 3c 02 00 0f 85 15 06 00 00 48 b8 00 00 00 00 00 fc ff df 4c 8b 23 49 8d bc 24 ca 00 00 00 48 89 fa 48 c1 ea 03 <0f> b6 04 02 48 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 82 05 00 00
RSP: 0018:ffffc900034b7980 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffc900034b7af8 RCX: 0000000000000000
RDX: 0000000000000019 RSI: ffffffff83c1ea5f RDI: 00000000000000ca
RBP: 0000000000000000 R08: 0000000000000001 R09: 000000000000003f
R10: 000000000000000c R11: ffffffff81d50f12 R12: 0000000000000000
R13: 0000000000000001 R14: ffff888019bd4000 R15: ffff888019bd4000
FS:  0000555555bf6300(0000) GS:ffff8880b9900000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb0e8fdab10 CR3: 0000000020cc6000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	48 c1 ea 03          	shr    $0x3,%rdx
   4:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1)
   8:	0f 85 15 06 00 00    	jne    0x623
   e:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  15:	fc ff df
  18:	4c 8b 23             	mov    (%rbx),%r12
  1b:	49 8d bc 24 ca 00 00 	lea    0xca(%r12),%rdi
  22:	00
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	0f b6 04 02          	movzbl (%rdx,%rax,1),%eax <-- trapping instruction
  2e:	48 89 fa             	mov    %rdi,%rdx
  31:	83 e2 07             	and    $0x7,%edx
  34:	38 d0                	cmp    %dl,%al
  36:	7f 08                	jg     0x40
  38:	84 c0                	test   %al,%al
  3a:	0f 85 82 05 00 00    	jne    0x5c2

Crashes (7):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/17 17:35 upstream f1fcbaa18b28 eaac4681 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-selinux-root general protection fault in erofs_bread
2023/05/22 16:35 upstream 44c026a73be8 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in erofs_bread
2023/05/19 06:52 upstream 2d1bcbc6cd70 3bb7af1d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in erofs_bread
2023/05/17 17:18 upstream f1fcbaa18b28 eaac4681 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root general protection fault in erofs_bread
2023/04/27 09:23 upstream 5c7ecada25d2 19a3dabe .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs general protection fault in erofs_bread
2023/05/27 09:14 linux-next 715abedee4cd cf184559 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in erofs_bread
2023/05/23 11:19 linux-next 715abedee4cd 4bce1a3e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in erofs_bread
* Struck through repros no longer work on HEAD.