[v5.15] KASAN: stack-out-of-bounds Read in gfs2_file_buffered_write (2)

0 views
Skip to first unread message

syzbot

unread,
Jan 13, 2024, 4:08:24 PMJan 13
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 26c690eff0a5 Linux 5.15.146
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13ffa2dbe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=dc70d39e176dd118
dashboard link: https://syzkaller.appspot.com/bug?extid=43147f1cd55d15dfbf7d
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/40141853e0d3/disk-26c690ef.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/87e1356f3f98/vmlinux-26c690ef.xz
kernel image: https://storage.googleapis.com/syzbot-assets/77c63c93083b/bzImage-26c690ef.xz

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

==================================================================
BUG: KASAN: stack-out-of-bounds in should_fault_in_pages fs/gfs2/file.c:784 [inline]
BUG: KASAN: stack-out-of-bounds in gfs2_file_buffered_write+0x505/0x850 fs/gfs2/file.c:1069
Read of size 8 at addr ffffc90005bbfd30 by task syz-executor.3/5642

CPU: 0 PID: 5642 Comm: syz-executor.3 Not tainted 5.15.146-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
print_address_description+0x63/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
should_fault_in_pages fs/gfs2/file.c:784 [inline]
gfs2_file_buffered_write+0x505/0x850 fs/gfs2/file.c:1069
gfs2_file_write_iter+0x4a2/0xf10 fs/gfs2/file.c:1165
call_write_iter include/linux/fs.h:2146 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0xacf/0xe50 fs/read_write.c:594
ksys_write+0x1a2/0x2c0 fs/read_write.c:647
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:0x7f6390809da9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f638ed8b0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f6390938f80 RCX: 00007f6390809da9
RDX: 0000000000000020 RSI: 00000000200000c0 RDI: 0000000000000004
RBP: 00007f639085647a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f6390938f80 R15: 00007ffcfebdbe18
</TASK>


addr ffffc90005bbfd30 is located in stack of task syz-executor.3/5642 at offset 48 in frame:
vfs_write+0x0/0xe50

this frame has 3 objects:
[32, 48) 'iov.i'
[64, 112) 'kiocb.i'
[144, 184) 'iter.i'

Memory state around the buggy address:
ffffc90005bbfc00: 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00 00 00
ffffc90005bbfc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90005bbfd00: f1 f1 f1 f1 00 00 f2 f2 00 00 00 00 00 00 f2 f2
^
ffffc90005bbfd80: f2 f2 00 00 00 00 00 f3 f3 f3 f3 f3 00 00 00 00
ffffc90005bbfe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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 report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

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

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

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

syzbot

unread,
Apr 12, 2024, 6:01:38 AMApr 12
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: cdfd0a7f0139 Linux 5.15.154
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10fe43b7180000
kernel config: https://syzkaller.appspot.com/x/.config?x=a0d657e4df0a8dde
dashboard link: https://syzkaller.appspot.com/bug?extid=43147f1cd55d15dfbf7d
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=151b13d5180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1006e3b7180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/093210fbc9bd/disk-cdfd0a7f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/dbab34a8852d/vmlinux-cdfd0a7f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e3e218d1a57e/Image-cdfd0a7f.gz.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/81960bf17b8b/mount_1.gz
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/803422bcbcc3/mount_4.gz

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

gfs2: fsid=syz:syz.0: first mount done, others may mount
==================================================================
BUG: KASAN: stack-out-of-bounds in should_fault_in_pages fs/gfs2/file.c:784 [inline]
BUG: KASAN: stack-out-of-bounds in gfs2_file_buffered_write+0x4c8/0x874 fs/gfs2/file.c:1069
Read of size 8 at addr ffff80001ca86fb0 by task syz-executor161/3964

CPU: 1 PID: 3964 Comm: syz-executor161 Not tainted 5.15.154-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x174/0x1e4 mm/kasan/report.c:451
__asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309
should_fault_in_pages fs/gfs2/file.c:784 [inline]
gfs2_file_buffered_write+0x4c8/0x874 fs/gfs2/file.c:1069
gfs2_file_write_iter+0x3b8/0xc80 fs/gfs2/file.c:1165
__kernel_write+0x488/0x8b0 fs/read_write.c:539
__dump_emit+0x200/0x338 fs/coredump.c:875
dump_emit+0x288/0x36c fs/coredump.c:912
elf_core_dump+0x2598/0x3640 fs/binfmt_elf.c:2237
do_coredump+0x12c8/0x2890 fs/coredump.c:826
get_signal+0x3dc/0x1550 kernel/signal.c:2875
do_signal arch/arm64/kernel/signal.c:890 [inline]
do_notify_resume+0x320/0x32b8 arch/arm64/kernel/signal.c:943
prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline]
exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline]
el0_da+0x118/0x20c arch/arm64/kernel/entry-common.c:495
el0t_64_sync_handler+0xc0/0xe4 arch/arm64/kernel/entry-common.c:629
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584


addr ffff80001ca86fb0 is located in stack of task syz-executor161/3964 at offset 48 in frame:
new_sync_read fs/read_write.c:405 [inline]
__kernel_write+0x0/0x8b0 fs/read_write.c:485

this frame has 3 objects:
[32, 48) 'iov'
[64, 112) 'kiocb'
[144, 184) 'iter'

Memory state around the buggy address:
ffff80001ca86e80: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
ffff80001ca86f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff80001ca86f80: f1 f1 f1 f1 00 00 f2 f2 00 00 00 00 00 00 f2 f2
^
ffff80001ca87000: f2 f2 00 00 00 00 00 f3 f3 f3 f3 f3 00 00 00 00
ffff80001ca87080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
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.
Reply all
Reply to author
Forward
0 new messages