general protection fault in z_erofs_map_blocks_iter

10 views
Skip to first unread message

syzbot

unread,
Oct 23, 2021, 5:57:24 AM10/23/21
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12720bb4b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=784c25a06308ab441bac
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

Unfortunately, I don't have any reproducer for this issue yet.

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

attempt to access beyond end of device
loop5: rw=4096, want=3272, limit=16
UDF-fs: warning (device loop1): udf_load_vrs: No VRS found
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 11180 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:vle_compressed_index_clusterofs drivers/staging/erofs/unzip_vle.c:1470 [inline]
RIP: 0010:z_erofs_map_blocks_iter+0x632/0x1aa0 drivers/staging/erofs/unzip_vle.c:1624
Code: 0f b6 8c 24 9c 00 00 00 48 ba 00 00 00 00 00 fc ff df 48 d3 e3 44 01 f3 81 e3 ff 0f 00 00 48 03 5c 24 30 48 89 d8 48 c1 e8 03 <0f> b6 0c 10 48 8d 43 01 48 89 c6 48 c1 ee 03 0f b6 14 16 48 89 de
RSP: 0018:ffff88802e90f1e0 EFLAGS: 00010206
RAX: 0000a10ffffffe36 RBX: 0005087ffffff1b0 RCX: 0000000000000005
RDX: dffffc0000000000 RSI: 0000000000197d00 RDI: ffff8880938f585c
RBP: fffffffffffffffb R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880938f57c0
R13: 0000000000000000 R14: 0000000000197d30 R15: ffff88803c31f540
FS: 00007f3efe468700(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8bd4f42004 CR3: 000000003d2ce000 CR4: 00000000003426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
erofs_map_blocks_iter+0x6d/0x3b0 drivers/staging/erofs/data.c:168
z_erofs_do_read_page+0x670/0x2820 drivers/staging/erofs/unzip_vle.c:644
z_erofs_vle_normalaccess_readpage+0x136/0x460 drivers/staging/erofs/unzip_vle.c:1353
do_read_cache_page+0x533/0x1170 mm/filemap.c:2828
read_mapping_page include/linux/pagemap.h:402 [inline]
find_target_block_classic drivers/staging/erofs/namei.c:112 [inline]
erofs_namei+0x1ab/0x1740 drivers/staging/erofs/namei.c:189
erofs_lookup+0x143/0x500 drivers/staging/erofs/namei.c:232
__lookup_slow+0x246/0x4a0 fs/namei.c:1672
UDF-fs: Scanning with blocksize 4096 failed
lookup_slow fs/namei.c:1689 [inline]
walk_component+0x7ac/0xda0 fs/namei.c:1811
link_path_walk.part.0+0x901/0x1230 fs/namei.c:2142
link_path_walk fs/namei.c:2073 [inline]
path_parentat+0x51/0x140 fs/namei.c:2367
filename_parentat+0x198/0x590 fs/namei.c:2389
filename_create+0x9e/0x490 fs/namei.c:3621
user_path_create fs/namei.c:3696 [inline]
do_mknodat.part.0+0xcd/0x480 fs/namei.c:3757
do_mknodat fs/namei.c:3789 [inline]
__do_sys_mknodat fs/namei.c:3792 [inline]
__se_sys_mknodat fs/namei.c:3789 [inline]
__x64_sys_mknodat+0x116/0x160 fs/namei.c:3789
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f3f00ef2a39
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f3efe468188 EFLAGS: 00000246 ORIG_RAX: 0000000000000103
RAX: ffffffffffffffda RBX: 00007f3f00ff5f60 RCX: 00007f3f00ef2a39
RDX: 0000000000000040 RSI: 0000000020000080 RDI: 0000000000000005
RBP: 00007f3f00f4ce8f R08: 0000000000000000 R09: 0000000000000000
R10: 000000000000070b R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffd84b0461f R14: 00007f3efe468300 R15: 0000000000022000
Modules linked in:
---[ end trace 4cecf81ebc8ccf53 ]---
RIP: 0010:vle_compressed_index_clusterofs drivers/staging/erofs/unzip_vle.c:1470 [inline]
RIP: 0010:z_erofs_map_blocks_iter+0x632/0x1aa0 drivers/staging/erofs/unzip_vle.c:1624
erofs: unmounted for /dev/loop4
Code: 0f b6 8c 24 9c 00 00 00 48 ba 00 00 00 00 00 fc ff df 48 d3 e3 44 01 f3 81 e3 ff 0f 00 00 48 03 5c 24 30 48 89 d8 48 c1 e8 03 <0f> b6 0c 10 48 8d 43 01 48 89 c6 48 c1 ee 03 0f b6 14 16 48 89 de
RSP: 0018:ffff88802e90f1e0 EFLAGS: 00010206
RAX: 0000a10ffffffe36 RBX: 0005087ffffff1b0 RCX: 0000000000000005
RDX: dffffc0000000000 RSI: 0000000000197d00 RDI: ffff8880938f585c
RBP: fffffffffffffffb R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880938f57c0
R13: 0000000000000000 R14: 0000000000197d30 R15: ffff88803c31f540
FS: 00007f3efe468700(0000) GS:ffff8880ba100000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8bd4f42004 CR3: 000000003d2ce000 CR4: 00000000003426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 0f b6 8c 24 9c 00 00 movzbl 0x9c(%rsp),%ecx
7: 00
8: 48 ba 00 00 00 00 00 movabs $0xdffffc0000000000,%rdx
f: fc ff df
12: 48 d3 e3 shl %cl,%rbx
15: 44 01 f3 add %r14d,%ebx
18: 81 e3 ff 0f 00 00 and $0xfff,%ebx
1e: 48 03 5c 24 30 add 0x30(%rsp),%rbx
23: 48 89 d8 mov %rbx,%rax
26: 48 c1 e8 03 shr $0x3,%rax
* 2a: 0f b6 0c 10 movzbl (%rax,%rdx,1),%ecx <-- trapping instruction
2e: 48 8d 43 01 lea 0x1(%rbx),%rax
32: 48 89 c6 mov %rax,%rsi
35: 48 c1 ee 03 shr $0x3,%rsi
39: 0f b6 14 16 movzbl (%rsi,%rdx,1),%edx
3d: 48 89 de mov %rbx,%rsi


---
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.

syzbot

unread,
Oct 23, 2021, 6:12:26 AM10/23/21
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12951b0cb00000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=784c25a06308ab441bac
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=127fd9c4b00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16e6d5a4b00000

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

erofs: mounted on /dev/loop0 with opts: .
attempt to access beyond end of device
loop0: rw=4096, want=3272, limit=16
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 8097 Comm: syz-executor600 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:vle_compressed_index_clusterofs drivers/staging/erofs/unzip_vle.c:1470 [inline]
RIP: 0010:z_erofs_map_blocks_iter+0x632/0x1aa0 drivers/staging/erofs/unzip_vle.c:1624
Code: 0f b6 8c 24 9c 00 00 00 48 ba 00 00 00 00 00 fc ff df 48 d3 e3 44 01 f3 81 e3 ff 0f 00 00 48 03 5c 24 30 48 89 d8 48 c1 e8 03 <0f> b6 0c 10 48 8d 43 01 48 89 c6 48 c1 ee 03 0f b6 14 16 48 89 de
RSP: 0018:ffff8880b065f1e0 EFLAGS: 00010206
RAX: 0000a10ffffffe36 RBX: 0005087ffffff1b0 RCX: 0000000000000005
RDX: dffffc0000000000 RSI: 0000000000197d00 RDI: ffff8880a934f15c
RBP: fffffffffffffffb R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880a934f0c0
R13: 0000000000000000 R14: 0000000000197d30 R15: ffff88808cbaf4c0
FS: 0000555556675300(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555d5db7c038 CR3: 000000009776e000 CR4: 00000000003406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
erofs_map_blocks_iter+0x6d/0x3b0 drivers/staging/erofs/data.c:168
z_erofs_do_read_page+0x670/0x2820 drivers/staging/erofs/unzip_vle.c:644
z_erofs_vle_normalaccess_readpage+0x136/0x460 drivers/staging/erofs/unzip_vle.c:1353
do_read_cache_page+0x533/0x1170 mm/filemap.c:2828
read_mapping_page include/linux/pagemap.h:402 [inline]
find_target_block_classic drivers/staging/erofs/namei.c:112 [inline]
erofs_namei+0x1ab/0x1740 drivers/staging/erofs/namei.c:189
erofs_lookup+0x143/0x500 drivers/staging/erofs/namei.c:232
__lookup_slow+0x246/0x4a0 fs/namei.c:1672
lookup_slow fs/namei.c:1689 [inline]
walk_component+0x7ac/0xda0 fs/namei.c:1811
link_path_walk.part.0+0x901/0x1230 fs/namei.c:2142
link_path_walk fs/namei.c:2073 [inline]
path_parentat+0x51/0x140 fs/namei.c:2367
filename_parentat+0x198/0x590 fs/namei.c:2389
filename_create+0x9e/0x490 fs/namei.c:3621
user_path_create fs/namei.c:3696 [inline]
do_mknodat.part.0+0xcd/0x480 fs/namei.c:3757
do_mknodat fs/namei.c:3789 [inline]
__do_sys_mknodat fs/namei.c:3792 [inline]
__se_sys_mknodat fs/namei.c:3789 [inline]
__x64_sys_mknodat+0x116/0x160 fs/namei.c:3789
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f65676ece89
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffe535fde28 EFLAGS: 00000246 ORIG_RAX: 0000000000000103
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f65676ece89
RDX: 0000000000000040 RSI: 0000000020000080 RDI: 0000000000000005
RBP: 00007f65676ac720 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000701 R11: 0000000000000246 R12: 00007f65676ac7b0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 257c777502d8ae36 ]---
RIP: 0010:vle_compressed_index_clusterofs drivers/staging/erofs/unzip_vle.c:1470 [inline]
RIP: 0010:z_erofs_map_blocks_iter+0x632/0x1aa0 drivers/staging/erofs/unzip_vle.c:1624
Code: 0f b6 8c 24 9c 00 00 00 48 ba 00 00 00 00 00 fc ff df 48 d3 e3 44 01 f3 81 e3 ff 0f 00 00 48 03 5c 24 30 48 89 d8 48 c1 e8 03 <0f> b6 0c 10 48 8d 43 01 48 89 c6 48 c1 ee 03 0f b6 14 16 48 89 de
RSP: 0018:ffff8880b065f1e0 EFLAGS: 00010206
RAX: 0000a10ffffffe36 RBX: 0005087ffffff1b0 RCX: 0000000000000005
RDX: dffffc0000000000 RSI: 0000000000197d00 RDI: ffff8880a934f15c
RBP: fffffffffffffffb R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880a934f0c0
R13: 0000000000000000 R14: 0000000000197d30 R15: ffff88808cbaf4c0
FS: 0000555556675300(0000) GS:ffff8880ba000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555d5db7c038 CR3: 000000009776e000 CR4: 00000000003406f0
Reply all
Reply to author
Forward
0 new messages