[v5.15] KASAN: slab-out-of-bounds Read in gfs2_file_write_iter

2 views
Skip to first unread message

syzbot

unread,
Sep 4, 2023, 7:06:59 PM9/4/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 8f790700c974 Linux 5.15.130
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1565ca34680000
kernel config: https://syzkaller.appspot.com/x/.config?x=a22cff001b9b10b3
dashboard link: https://syzkaller.appspot.com/bug?extid=a564b38969c3e87f9606
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/97d68b3e1757/disk-8f790700.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/4ecbd3f0457b/vmlinux-8f790700.xz
kernel image: https://storage.googleapis.com/syzbot-assets/68019fbed619/bzImage-8f790700.xz

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

==================================================================
BUG: KASAN: slab-out-of-bounds in should_fault_in_pages fs/gfs2/file.c:784 [inline]
BUG: KASAN: slab-out-of-bounds in gfs2_file_direct_write fs/gfs2/file.c:923 [inline]
BUG: KASAN: slab-out-of-bounds in gfs2_file_write_iter+0x872/0xf10 fs/gfs2/file.c:1139
Read of size 8 at addr ffff88807e72f100 by task syz-executor.2/16768

CPU: 0 PID: 16768 Comm: syz-executor.2 Not tainted 5.15.130-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/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_direct_write fs/gfs2/file.c:923 [inline]
gfs2_file_write_iter+0x872/0xf10 fs/gfs2/file.c:1139
do_iter_readv_writev+0x594/0x7a0
do_iter_write+0x1ea/0x760 fs/read_write.c:855
iter_file_splice_write+0x806/0xfa0 fs/splice.c:689
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0xe3/0x1c0 fs/splice.c:936
splice_direct_to_actor+0x500/0xc10 fs/splice.c:891
do_splice_direct+0x285/0x3d0 fs/splice.c:979
do_sendfile+0x625/0xff0 fs/read_write.c:1249
__do_sys_sendfile64 fs/read_write.c:1317 [inline]
__se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1303
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:0x7faca1bfdae9
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:00007fac98d5e0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00007faca1d1d050 RCX: 00007faca1bfdae9
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000005
RBP: 00007faca1c4947a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000008800000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000006e R14: 00007faca1d1d050 R15: 00007ffcd1bb8e48
</TASK>

Allocated by task 16768:
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc+0x168/0x300 mm/slub.c:4407
kmalloc_array include/linux/slab.h:631 [inline]
kcalloc include/linux/slab.h:660 [inline]
iter_file_splice_write+0x27b/0xfa0 fs/splice.c:628
do_splice_from fs/splice.c:767 [inline]
direct_splice_actor+0xe3/0x1c0 fs/splice.c:936
splice_direct_to_actor+0x500/0xc10 fs/splice.c:891
do_splice_direct+0x285/0x3d0 fs/splice.c:979
do_sendfile+0x625/0xff0 fs/read_write.c:1249
__do_sys_sendfile64 fs/read_write.c:1317 [inline]
__se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1303
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

Last potentially related work creation:
kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3583
inetdev_event+0x38a/0x1490 net/ipv4/devinet.c:1584
notifier_call_chain kernel/notifier.c:83 [inline]
raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:391
call_netdevice_notifiers_info net/core/dev.c:1998 [inline]
call_netdevice_notifiers_extack net/core/dev.c:2010 [inline]
call_netdevice_notifiers net/core/dev.c:2024 [inline]
dev_close_many+0x37c/0x530 net/core/dev.c:1599
unregister_netdevice_many+0x4b0/0x18f0 net/core/dev.c:11043
unregister_netdevice_queue+0x2e6/0x350 net/core/dev.c:11000
unregister_netdevice include/linux/netdevice.h:3011 [inline]
__tun_detach+0x6b4/0x15a0 drivers/net/tun.c:685
tun_detach drivers/net/tun.c:701 [inline]
tun_chr_close+0x104/0x1b0 drivers/net/tun.c:3431
__fput+0x3bf/0x890 fs/file_table.c:280
task_work_run+0x129/0x1a0 kernel/task_work.c:164
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:175
exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208
__syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301
do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
entry_SYSCALL_64_after_hwframe+0x61/0xcb

The buggy address belongs to the object at ffff88807e72f000
which belongs to the cache kmalloc-256 of size 256
The buggy address is located 0 bytes to the right of
256-byte region [ffff88807e72f000, ffff88807e72f100)
The buggy address belongs to the page:
page:ffffea0001f9cb80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e72e
head:ffffea0001f9cb80 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001defa80 0000000900000009 ffff888011c41b40
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 15111, ts 2375957419996, free_ts 2300774350819
prep_new_page mm/page_alloc.c:2426 [inline]
get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
__alloc_pages+0x272/0x700 mm/page_alloc.c:5421
alloc_slab_page mm/slub.c:1775 [inline]
allocate_slab mm/slub.c:1912 [inline]
new_slab+0xbb/0x4b0 mm/slub.c:1975
___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
__slab_alloc mm/slub.c:3095 [inline]
slab_alloc_node mm/slub.c:3186 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc_trace+0x1a0/0x290 mm/slub.c:3245
kmalloc include/linux/slab.h:591 [inline]
kzalloc include/linux/slab.h:721 [inline]
fuse_io_alloc fs/fuse/file.c:706 [inline]
fuse_direct_io+0x1e65/0x26b0 fs/fuse/file.c:1510
fuse_direct_IO+0x8e2/0x12d0 fs/fuse/file.c:2888
fuse_direct_write_iter fs/fuse/file.c:1566 [inline]
fuse_file_write_iter+0x501/0xd80 fs/fuse/file.c:1613
call_write_iter include/linux/fs.h:2103 [inline]
aio_write+0x566/0x780 fs/aio.c:1583
io_submit_one+0x768/0x18d0 fs/aio.c:2002
__do_sys_io_submit fs/aio.c:2061 [inline]
__se_sys_io_submit+0x17b/0x2f0 fs/aio.c:2031
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
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1340 [inline]
free_pcp_prepare mm/page_alloc.c:1391 [inline]
free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
do_slab_free mm/slub.c:3487 [inline]
___cache_free+0xe3/0x100 mm/slub.c:3506
qlist_free_all+0x36/0x90 mm/kasan/quarantine.c:176
kasan_quarantine_reduce+0x162/0x180 mm/kasan/quarantine.c:283
__kasan_slab_alloc+0x2f/0xc0 mm/kasan/common.c:444
kasan_slab_alloc include/linux/kasan.h:254 [inline]
slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
slab_alloc_node mm/slub.c:3220 [inline]
slab_alloc mm/slub.c:3228 [inline]
kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
vm_area_dup kernel/fork.c:357 [inline]
dup_mmap kernel/fork.c:556 [inline]
dup_mm kernel/fork.c:1457 [inline]
copy_mm+0x8d2/0x1370 kernel/fork.c:1509
copy_process+0x1816/0x3ef0 kernel/fork.c:2198
kernel_clone+0x210/0x960 kernel/fork.c:2596
__do_sys_clone kernel/fork.c:2713 [inline]
__se_sys_clone kernel/fork.c:2697 [inline]
__x64_sys_clone+0x23f/0x290 kernel/fork.c:2697
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

Memory state around the buggy address:
ffff88807e72f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88807e72f080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88807e72f100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88807e72f180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88807e72f200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================


---
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 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,
Nov 25, 2023, 8:48:20 AM11/25/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages