[moderation] [ext4?] KASAN: use-after-free Read in ext4_xattr_list_entries (2)

0 views
Skip to first unread message

syzbot

unread,
4:44 PM (5 hours ago) 4:44 PM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6f3ed7fec72f Merge tag 'for-7.1/dm-fixes-3' of git://git.k..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14668b7e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=b4166e8ea5fbf7e3
dashboard link: https://syzkaller.appspot.com/bug?extid=6ba7b664b30ac0a20035
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
CC: [adilger...@dilger.ca ja...@suse.cz liba...@linux.alibaba.com linux...@vger.kernel.org linux-...@vger.kernel.org oja...@linux.ibm.com rites...@gmail.com ty...@mit.edu yi.z...@huawei.com]

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

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-6f3ed7fe.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/3810c8d15f8e/vmlinux-6f3ed7fe.xz
kernel image: https://storage.googleapis.com/syzbot-assets/e1a03916d507/bzImage-6f3ed7fe.xz

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

netlink: 'syz.0.0': attribute type 2 has an invalid length.
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_list_entries+0x302/0x3d0 fs/ext4/xattr.c:724
Read of size 4 at addr ffff888054ea7014 by task syz.0.0/5335

CPU: 0 UID: 0 PID: 5335 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_address_description+0x55/0x1e0 mm/kasan/report.c:378
print_report+0x58/0x70 mm/kasan/report.c:482
kasan_report+0x117/0x150 mm/kasan/report.c:595
ext4_xattr_list_entries+0x302/0x3d0 fs/ext4/xattr.c:724
ext4_xattr_ibody_list fs/ext4/xattr.c:793 [inline]
ext4_listxattr+0x221/0x670 fs/ext4/xattr.c:818
vfs_listxattr fs/xattr.c:511 [inline]
listxattr+0x112/0x2a0 fs/xattr.c:933
filename_listxattr fs/xattr.c:966 [inline]
path_listxattrat+0x1a3/0x3f0 fs/xattr.c:993
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f770139ce59
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f77022ccfe8 EFLAGS: 00000246 ORIG_RAX: 00000000000000c2
RAX: ffffffffffffffda RBX: 00007f7701616090 RCX: 00007f770139ce59
RDX: 00000000000000fa RSI: 00002000000004c0 RDI: 0000200000000200
RBP: 00007f7701432d6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7701616128 R14: 00007f7701616090 R15: 00007fff5c421e28
</TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7f52521e5 pfn:0x54ea7
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
raw: 04fff00000000000 ffffea00015337c8 ffffea000153a748 0000000000000000
raw: 00000007f52521e5 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 5336, tgid 5336 (dhcpcd), ts 89257909293, free_ts 91218540152
set_page_owner include/linux/page_owner.h:32 [inline]
post_alloc_hook+0x22d/0x280 mm/page_alloc.c:1853
prep_new_page mm/page_alloc.c:1861 [inline]
get_page_from_freelist+0x2593/0x2610 mm/page_alloc.c:3941
__alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5221
alloc_pages_mpol+0x235/0x490 mm/mempolicy.c:2490
folio_alloc_mpol_noprof+0x39/0x160 mm/mempolicy.c:2509
vma_alloc_folio_noprof+0xe1/0x1e0 mm/mempolicy.c:2544
folio_prealloc mm/memory.c:-1 [inline]
wp_page_copy mm/memory.c:3875 [inline]
do_wp_page+0x118a/0x4cc0 mm/memory.c:4336
handle_pte_fault mm/memory.c:6443 [inline]
__handle_mm_fault mm/memory.c:6565 [inline]
handle_mm_fault+0x1698/0x3170 mm/memory.c:6734
do_user_addr_fault+0xa73/0x1340 arch/x86/mm/fault.c:1334
handle_page_fault arch/x86/mm/fault.c:1474 [inline]
exc_page_fault+0x6a/0xc0 arch/x86/mm/fault.c:1527
asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:618
page last free pid 5336 tgid 5336 stack trace:
reset_page_owner include/linux/page_owner.h:25 [inline]
__free_pages_prepare mm/page_alloc.c:1397 [inline]
free_unref_folios+0xd9f/0x14c0 mm/page_alloc.c:2999
folios_put_refs+0x9ff/0xb40 mm/swap.c:1008
free_pages_and_swap_cache+0x2b9/0x490 mm/swap_state.c:401
__tlb_batch_free_encoded_pages mm/mmu_gather.c:138 [inline]
tlb_batch_pages_flush mm/mmu_gather.c:151 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:417 [inline]
tlb_flush_mmu+0x6d3/0xa30 mm/mmu_gather.c:424
tlb_finish_mmu+0xf9/0x230 mm/mmu_gather.c:549
exit_mmap+0x498/0x9e0 mm/mmap.c:1313
__mmput+0x118/0x430 kernel/fork.c:1178
exit_mm+0x1f6/0x2d0 kernel/exit.c:582
do_exit+0x6a2/0x22c0 kernel/exit.c:964
do_group_exit+0x21b/0x2d0 kernel/exit.c:1119
__do_sys_exit_group kernel/exit.c:1130 [inline]
__se_sys_exit_group kernel/exit.c:1128 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1128
x64_sys_call+0x221a/0x2240 arch/x86/include/generated/asm/syscalls_64.h:232
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
ffff888054ea6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff888054ea6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888054ea7000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff888054ea7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff888054ea7100: 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 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
Reply all
Reply to author
Forward
0 new messages