Hello,
syzbot found the following issue on:
HEAD commit: 8d23314f588a Merge 5.10.225 into android13-5.10-lts
git tree: android13-5.10-lts
console+strace:
https://syzkaller.appspot.com/x/log.txt?x=156b8407980000
kernel config:
https://syzkaller.appspot.com/x/.config?x=889d6bbfedaebd06
dashboard link:
https://syzkaller.appspot.com/bug?extid=5371fd14aab16dddac77
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=1064b49f980000
C reproducer:
https://syzkaller.appspot.com/x/repro.c?x=17c767c7980000
Downloadable assets:
disk image:
https://storage.googleapis.com/syzbot-assets/09c1893905da/disk-8d23314f.raw.xz
vmlinux:
https://storage.googleapis.com/syzbot-assets/5294d841c477/vmlinux-8d23314f.xz
kernel image:
https://storage.googleapis.com/syzbot-assets/a9c3f12eb021/bzImage-8d23314f.xz
mounted in repro:
https://storage.googleapis.com/syzbot-assets/9b19ee5ee36b/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by:
syzbot+5371fd...@syzkaller.appspotmail.com
==================================================================
BUG: KASAN: use-after-free in ext4_insert_dentry+0x392/0x710 fs/ext4/namei.c:2117
Write of size 254 at addr ffff88811efedf0c by task syz-executor940/288
CPU: 0 PID: 288 Comm: syz-executor940 Not tainted 5.10.225-syzkaller-00513-g8d23314f588a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118
print_address_description+0x81/0x3b0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:435 [inline]
kasan_report+0x179/0x1c0 mm/kasan/report.c:452
kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189
memcpy+0x44/0x70 mm/kasan/shadow.c:66
ext4_insert_dentry+0x392/0x710 fs/ext4/namei.c:2117
add_dirent_to_buf+0x3ac/0x780 fs/ext4/namei.c:2161
make_indexed_dir+0xe9f/0x1500 fs/ext4/namei.c:2352
ext4_add_entry+0xdcf/0x1280 fs/ext4/namei.c:2458
__ext4_link+0x4e9/0x790 fs/ext4/namei.c:3645
ext4_link+0x1f3/0x290 fs/ext4/namei.c:3686
vfs_link+0x68f/0x890 fs/namei.c:4213
do_linkat+0x471/0x8b0 fs/namei.c:4281
__do_sys_link fs/namei.c:4310 [inline]
__se_sys_link fs/namei.c:4308 [inline]
__x64_sys_link+0x68/0x80 fs/namei.c:4308
do_syscall_64+0x34/0x70
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f1ee2ad91e9
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:00007ffe2ecefa98 EFLAGS: 00000246 ORIG_RAX: 0000000000000056
RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f1ee2ad91e9
RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240
RBP: 0000000020000000 R08: 00007ffe2ecefad0 R09: 00007ffe2ecefad0
R10: 00007ffe2ecefad0 R11: 0000000000000246 R12: 0000000000000001
R13: 0000000000000000 R14: 431bde82d7b634db R15: 00007ffe2ecefaf0
The buggy address belongs to the page:
page:ffffea00047bfb40 refcount:3 mapcount:0 mapping:ffff88810919b9d0 index:0x3f pfn:0x11efed
aops:def_blk_aops ino:0
flags: 0x400000000000202a(referenced|dirty|active|private)
raw: 400000000000202a dead000000000100 dead000000000122 ffff88810919b9d0
raw: 000000000000003f ffff88811caddb28 00000003ffffffff ffff888100142000
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff888100142000
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 288, ts 21289013851, free_ts 15562747002
set_page_owner include/linux/page_owner.h:35 [inline]
post_alloc_hook mm/page_alloc.c:2456 [inline]
prep_new_page+0x166/0x180 mm/page_alloc.c:2462
get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254
__alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348
__alloc_pages include/linux/gfp.h:544 [inline]
__alloc_pages_node include/linux/gfp.h:557 [inline]
alloc_pages_node include/linux/gfp.h:571 [inline]
alloc_pages include/linux/gfp.h:590 [inline]
__page_cache_alloc include/linux/pagemap.h:290 [inline]
pagecache_get_page+0x669/0x950 mm/filemap.c:1848
find_or_create_page include/linux/pagemap.h:402 [inline]
grow_dev_page fs/buffer.c:976 [inline]
grow_buffers fs/buffer.c:1045 [inline]
__getblk_slow fs/buffer.c:1072 [inline]
__getblk_gfp+0x221/0x7e0 fs/buffer.c:1370
sb_getblk include/linux/buffer_head.h:361 [inline]
ext4_getblk+0x259/0x660 fs/ext4/inode.c:877
ext4_bread+0x2f/0x1b0 fs/ext4/inode.c:922
ext4_append+0x29a/0x4d0 fs/ext4/namei.c:83
make_indexed_dir+0x505/0x1500 fs/ext4/namei.c:2278
ext4_add_entry+0xdcf/0x1280 fs/ext4/namei.c:2458
__ext4_link+0x4e9/0x790 fs/ext4/namei.c:3645
ext4_link+0x1f3/0x290 fs/ext4/namei.c:3686
vfs_link+0x68f/0x890 fs/namei.c:4213
do_linkat+0x471/0x8b0 fs/namei.c:4281
__do_sys_link fs/namei.c:4310 [inline]
__se_sys_link fs/namei.c:4308 [inline]
__x64_sys_link+0x68/0x80 fs/namei.c:4308
do_syscall_64+0x34/0x70
page last free stack trace:
reset_page_owner include/linux/page_owner.h:28 [inline]
free_pages_prepare mm/page_alloc.c:1349 [inline]
free_pcp_prepare mm/page_alloc.c:1421 [inline]
free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336
free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443
release_pages+0xea0/0xef0 mm/swap.c:1103
free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
tlb_flush_mmu mm/mmu_gather.c:247 [inline]
tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:326
unmap_region+0x31c/0x370 mm/mmap.c:2810
__do_munmap+0x699/0x8c0 mm/mmap.c:3041
__do_sys_brk mm/mmap.c:273 [inline]
__se_sys_brk+0x3cf/0x730 mm/mmap.c:211
__x64_sys_brk+0x38/0x40 mm/mmap.c:211
do_syscall_64+0x34/0x70
entry_SYSCALL_64_after_hwframe+0x61/0xcb
Memory state around the buggy address:
ffff88811efedf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88811efedf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88811efee000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88811efee080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88811efee100: 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