Hello,
syzbot found the following issue on:
HEAD commit: 3e3f2b9e9fca BACKPORT: f2fs: fix to account dirty data in ..
git tree: android14-6.1
console+strace:
https://syzkaller.appspot.com/x/log.txt?x=14cc0adf980000
kernel config:
https://syzkaller.appspot.com/x/.config?x=8f475bced78b11d3
dashboard link:
https://syzkaller.appspot.com/bug?extid=e1370dc6128e4079c651
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=11e398c4580000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=108d7cf8580000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/47e832a1c910/disk-3e3f2b9e.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/1cfb614b7994/vmlinux-3e3f2b9e.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/5e23c7ad3c44/bzImage-3e3f2b9e.xz
mounted in repro:
https://storage.googleapis.com/syzbot-assets/7ece018a50cf/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+e1370d...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246
Read of size 1 at addr ffff888120dc3a67 by task syz-executor274/298
CPU: 0 PID: 298 Comm: syz-executor274 Not tainted 6.1.118-syzkaller-00074-g3e3f2b9e9fca #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:316 [inline]
print_report+0x158/0x4e0 mm/kasan/report.c:427
kasan_report+0x13c/0x170 mm/kasan/report.c:531
__asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:348
ext4_htree_fill_tree+0x1316/0x13e0 fs/ext4/namei.c:1246
ext4_dx_readdir fs/ext4/dir.c:605 [inline]
ext4_readdir+0x2e6f/0x3860 fs/ext4/dir.c:142
iterate_dir+0x265/0x600
__do_sys_getdents64 fs/readdir.c:369 [inline]
__se_sys_getdents64+0x1c1/0x460 fs/readdir.c:354
__x64_sys_getdents64+0x7b/0x90 fs/readdir.c:354
x64_sys_call+0x5ae/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:218
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f856d732a53
Code: c1 66 0f 1f 44 00 00 48 83 c4 08 48 89 ef 5b 5d e9 e2 12 fb ff 66 90 b8 ff ff ff 7f 48 39 c2 48 0f 47 d0 b8 d9 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 05 c3 0f 1f 40 00 48 c7 c2 b8 ff ff ff f7 d8
RSP: 002b:00007fff362977e8 EFLAGS: 00000293 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 0000555586650830 RCX: 00007f856d732a53
RDX: 0000000000008000 RSI: 0000555586650830 RDI: 0000000000000004
RBP: 0000555586650804 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001000 R11: 0000000000000293 R12: ffffffffffffffb8
R13: 0000000000000010 R14: 0000555586650800 R15: 431bde82d7b634db
</TASK>
The buggy address belongs to the physical page:
page:ffffea00048370c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x120dc3
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 dead000000000100 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x500cc2(GFP_HIGHUSER|__GFP_ACCOUNT), pid 227, tgid 227 (sshd), ts
14246216928, free_ts
14246318487
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590
prep_new_page+0x1b/0x110 mm/page_alloc.c:2597
get_page_from_freelist+0x2f41/0x2fc0 mm/page_alloc.c:4462
__alloc_pages+0x234/0x610 mm/page_alloc.c:5759
__alloc_pages_node include/linux/gfp.h:236 [inline]
alloc_pages_node include/linux/gfp.h:259 [inline]
alloc_pages include/linux/gfp.h:270 [inline]
pipe_write+0x56a/0x1990 fs/pipe.c:501
call_write_iter include/linux/fs.h:2274 [inline]
new_sync_write fs/read_write.c:491 [inline]
vfs_write+0xaf6/0xed0 fs/read_write.c:584
ksys_write+0x199/0x2c0 fs/read_write.c:637
__do_sys_write fs/read_write.c:649 [inline]
__se_sys_write fs/read_write.c:646 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:646
x64_sys_call+0x2f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1498 [inline]
free_pcp_prepare mm/page_alloc.c:1572 [inline]
free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3511
free_unref_page+0xb2/0x5c0 mm/page_alloc.c:3607
__folio_put_small mm/swap.c:105 [inline]
__folio_put+0xaa/0xe0 mm/swap.c:128
folio_put include/linux/mm.h:1431 [inline]
put_page include/linux/mm.h:1483 [inline]
anon_pipe_buf_release+0x187/0x200 fs/pipe.c:138
pipe_buf_release include/linux/pipe_fs_i.h:199 [inline]
pipe_read+0x5a6/0x1040 fs/pipe.c:324
call_read_iter include/linux/fs.h:2268 [inline]
new_sync_read fs/read_write.c:389 [inline]
vfs_read+0x801/0xae0 fs/read_write.c:470
ksys_read+0x199/0x2c0 fs/read_write.c:613
__do_sys_read fs/read_write.c:623 [inline]
__se_sys_read fs/read_write.c:621 [inline]
__x64_sys_read+0x7b/0x90 fs/read_write.c:621
x64_sys_call+0x28/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:1
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
entry_SYSCALL_64_after_hwframe+0x68/0xd2
Memory state around the buggy address:
ffff888120dc3900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888120dc3980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888120dc3a00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888120dc3a80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888120dc3b00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
---
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 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 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