[Android 6.1] general protection fault in LZ4_decompress_safe_partial

6 views
Skip to first unread message

syzbot

unread,
Aug 21, 2023, 1:06:02 AM8/21/23
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: c2611a04b92f ANDROID: GKI: update symbol list file for xia..
git tree: android14-6.1
console+strace: https://syzkaller.appspot.com/x/log.txt?x=1738124ba80000
kernel config: https://syzkaller.appspot.com/x/.config?x=c5b8b7a65c87c651
dashboard link: https://syzkaller.appspot.com/bug?extid=0a8254e368a921254f5b
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12cc4553a80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13002e23a80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/61093a06c07e/disk-c2611a04.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4178a231c0bf/vmlinux-c2611a04.xz
kernel image: https://storage.googleapis.com/syzbot-assets/ca97438b22a6/bzImage-c2611a04.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/db274816161b/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0a8254...@syzkaller.appspotmail.com

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


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Aug 29, 2023, 7:54:29 AM8/29/23
to syzkaller-a...@googlegroups.com
syzbot has bisected this issue to:

commit b15b2e307c3a1970d92da77a3ef57ee53d119d8e
Author: Yue Hu <huy...@coolpad.com>
Date: Fri Sep 23 02:11:22 2022 +0000

erofs: support on-disk compressed fragments data

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1450308fa80000
start commit: c2611a04b92f ANDROID: GKI: update symbol list file for xia..
git tree: android14-6.1
final oops: https://syzkaller.appspot.com/x/report.txt?x=1650308fa80000
console output: https://syzkaller.appspot.com/x/log.txt?x=1250308fa80000
Reported-by: syzbot+0a8254...@syzkaller.appspotmail.com
Fixes: b15b2e307c3a ("erofs: support on-disk compressed fragments data")

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Oct 8, 2023, 9:07:32 PM10/8/23
to syzkaller-a...@googlegroups.com
syzbot suspects this issue was fixed by commit:

commit e84c93fd4232d9288e664e5d22220eaf9be51db3
Author: Jingbo Xu <jeff...@linux.alibaba.com>
Date: Mon Mar 13 13:53:08 2023 +0000

BACKPORT: erofs: avoid hardcoded blocksize for subpage block support

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=17d2bc45680000
start commit: c2611a04b92f ANDROID: GKI: update symbol list file for xia..
git tree: android14-6.1
If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: BACKPORT: erofs: avoid hardcoded blocksize for subpage block support

syzbot

unread,
Dec 13, 2023, 1:02:20 AM12/13/23
to syzkaller-a...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages