syzbot


general protection fault in LZ4_decompress_safe_partial

Status: auto-obsoleted due to no activity on 2023/12/13 06:02
Bug presence: origin:lts
[Documentation on labels]
Reported-by: syzbot+0a8254e368a921254f5b@syzkaller.appspotmail.com
First crash: 262d, last: 248d
Cause bisection: introduced by (bisect log) :
commit b15b2e307c3a1970d92da77a3ef57ee53d119d8e
Author: Yue Hu <huyue2@coolpad.com>
Date: Fri Sep 23 02:11:22 2022 +0000

  erofs: support on-disk compressed fragments data

Crash: general protection fault in LZ4_decompress_safe_partial (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit e84c93fd4232d9288e664e5d22220eaf9be51db3
Author: Jingbo Xu <jefflexu@linux.alibaba.com>
Date: Mon Mar 13 13:53:08 2023 +0000

  BACKPORT: erofs: avoid hardcoded blocksize for subpage block support

  
Bug presence (2)
Date Name Commit Repro Result
2023/08/21 lts (merge base) b1644a0031cf C [report] general protection fault in LZ4_decompress_safe_partial
2023/08/21 upstream (ToT) f7757129e3de C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in LZ4_decompress_safe_partial erofs C done 13 767d 922d 22/26 fixed on 2023/02/24 13:50
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/09/04 05:33 27m retest repro android14-6.1 report log
Cause bisection attempts (2)
Created Duration User Patch Repo Result
2023/08/29 06:18 5h35m bisect android14-6.1 job log (1) log
2023/08/21 17:57 12h13m bisect android14-6.1 error job log (0)
marked invalid by nogikh@google.com

Sample crash report:
RBP: 0000000000000001 R08: 00007fff8aaf05b7 R09: 000000000200808a
R10: 0000000000000001 R11: 0000000000000246 R12: 00007fff8aaf0870
R13: 00007fff8aaf08b0 R14: 0000000000002000 R15: 0000000000000003
 </TASK>
erofs: (device loop0): z_erofs_do_read_page: failed to get inline page, err -12
general protection fault, probably for non-canonical address 0xe0009d100000009c: 0000 [#1] PREEMPT SMP KASAN
KASAN: maybe wild-memory-access in range [0x00050880000004e0-0x00050880000004e7]
CPU: 0 PID: 305 Comm: syz-executor222 Not tainted 6.1.25-syzkaller-00052-gc2611a04b92f #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:LZ4_decompress_generic lib/lz4/lz4_decompress.c:112 [inline]
RIP: 0010:LZ4_decompress_safe_partial+0x18af/0x1920 lib/lz4/lz4_decompress.c:473
Code: b3 bf 01 00 00 00 44 89 f6 e8 3d 22 f6 fe 41 83 fe 01 75 5d e8 82 1e f6 fe 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 c0 75 4f 41 0f b6 1c 24 45 31 f6 31 ff 89 de e8 e8
RSP: 0018:ffffc90000ed68e8 EFLAGS: 00010206
RAX: 0000a1100000009c RBX: 0000000000000000 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffc90000ed6990 R08: ffffffff827ed003 R09: ffffc90000ed6e50
R10: 0000000000000000 R11: dffffc0000000001 R12: 00050880000004e0
R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000000
FS:  0000555557336380(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbd6e32afd2 CR3: 000000010b85b000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 z_erofs_lz4_decompress_mem fs/erofs/decompressor.c:241 [inline]
 z_erofs_lz4_decompress+0x13f0/0x1ba0 fs/erofs/decompressor.c:312
 z_erofs_decompress+0x76/0xb0 fs/erofs/decompressor.c:390
 z_erofs_decompress_pcluster fs/erofs/zdata.c:1196 [inline]
 z_erofs_decompress_queue+0x1cf5/0x32b0 fs/erofs/zdata.c:1283
 z_erofs_runqueue+0x13b1/0x1500 fs/erofs/zdata.c:1690
 z_erofs_read_folio+0x3d4/0x610 fs/erofs/zdata.c:1785
 filemap_read_folio+0xfc/0x2a0 mm/filemap.c:2419
 do_read_cache_folio+0x20d/0x3f0 mm/filemap.c:3547
 read_cache_folio+0x4e/0x70 mm/filemap.c:3579
 erofs_bread+0x13b/0x480 fs/erofs/data.c:46
 find_target_block_classic fs/erofs/namei.c:108 [inline]
 erofs_namei+0x1b6/0xcf0 fs/erofs/namei.c:184
 erofs_lookup+0x109/0x300 fs/erofs/namei.c:212
 lookup_open fs/namei.c:3391 [inline]
 open_last_lookups fs/namei.c:3481 [inline]
 path_openat+0x10fd/0x2d60 fs/namei.c:3711
 do_filp_open+0x230/0x480 fs/namei.c:3741
 do_sys_openat2+0x13f/0x850 fs/open.c:1333
 do_sys_open fs/open.c:1349 [inline]
 __do_sys_open fs/open.c:1357 [inline]
 __se_sys_open fs/open.c:1353 [inline]
 __x64_sys_open+0x221/0x270 fs/open.c:1353
 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+0x63/0xcd
RIP: 0033:0x7fbd76768169
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 21 18 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:00007fff8aaf0818 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fff8aaf0840 RCX: 00007fbd76768169
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000000
RBP: 0000000000000001 R08: 00007fff8aaf05b7 R09: 000000000200808a
R10: 0000000000000001 R11: 0000000000000246 R12: 00007fff8aaf0870
R13: 00007fff8aaf08b0 R14: 0000000000002000 R15: 0000000000000003
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:LZ4_decompress_generic lib/lz4/lz4_decompress.c:112 [inline]
RIP: 0010:LZ4_decompress_safe_partial+0x18af/0x1920 lib/lz4/lz4_decompress.c:473
Code: b3 bf 01 00 00 00 44 89 f6 e8 3d 22 f6 fe 41 83 fe 01 75 5d e8 82 1e f6 fe 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <0f> b6 04 08 84 c0 75 4f 41 0f b6 1c 24 45 31 f6 31 ff 89 de e8 e8
RSP: 0018:ffffc90000ed68e8 EFLAGS: 00010206
RAX: 0000a1100000009c RBX: 0000000000000000 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001
RBP: ffffc90000ed6990 R08: ffffffff827ed003 R09: ffffc90000ed6e50
R10: 0000000000000000 R11: dffffc0000000001 R12: 00050880000004e0
R13: 0000000000000001 R14: 0000000000000001 R15: 0000000000000000
FS:  0000555557336380(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbd6e32afd2 CR3: 000000010b85b000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	b3 bf                	mov    $0xbf,%bl
   2:	01 00                	add    %eax,(%rax)
   4:	00 00                	add    %al,(%rax)
   6:	44 89 f6             	mov    %r14d,%esi
   9:	e8 3d 22 f6 fe       	call   0xfef6224b
   e:	41 83 fe 01          	cmp    $0x1,%r14d
  12:	75 5d                	jne    0x71
  14:	e8 82 1e f6 fe       	call   0xfef61e9b
  19:	4c 89 e0             	mov    %r12,%rax
  1c:	48 c1 e8 03          	shr    $0x3,%rax
  20:	48 b9 00 00 00 00 00 	movabs $0xdffffc0000000000,%rcx
  27:	fc ff df
* 2a:	0f b6 04 08          	movzbl (%rax,%rcx,1),%eax <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	75 4f                	jne    0x81
  32:	41 0f b6 1c 24       	movzbl (%r12),%ebx
  37:	45 31 f6             	xor    %r14d,%r14d
  3a:	31 ff                	xor    %edi,%edi
  3c:	89 de                	mov    %ebx,%esi
  3e:	e8                   	.byte 0xe8
  3f:	e8                   	.byte 0xe8

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/08/21 04:56 android14-6.1 c2611a04b92f d216d8a0 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-6-1 general protection fault in LZ4_decompress_safe_partial
2023/08/21 04:44 android14-6.1 c2611a04b92f d216d8a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-6-1 general protection fault in LZ4_decompress_safe_partial
* Struck through repros no longer work on HEAD.