syzbot


KASAN: use-after-free Read in xattr_find_entry

Status: moderation: reported on 2025/10/24 16:36
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+18fb35a46f8ce4f7e112@syzkaller.appspotmail.com
First crash: 4d07h, last: 2d14h

Sample crash report:
loop0: detected capacity change from 0 to 1024
EXT4-fs (loop0): stripe (8) is not aligned with cluster size (16), stripe is disabled
EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
EXT4-fs warning (device loop0): ext4_expand_extra_isize_ea:2853: Unable to expand inode 15. Delete some EAs or run e2fsck.
loop0: detected capacity change from 1024 to 64
==================================================================
BUG: KASAN: use-after-free in xattr_find_entry+0x1a5/0x280 fs/ext4/xattr.c:334
Read of size 4 at addr ffff888050b34004 by task syz.0.0/5324

CPU: 0 UID: 0 PID: 5324 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~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 print_address_description mm/kasan/report.c:378 [inline]
 print_report+0xca/0x240 mm/kasan/report.c:482
 kasan_report+0x118/0x150 mm/kasan/report.c:595
 xattr_find_entry+0x1a5/0x280 fs/ext4/xattr.c:334
 ext4_xattr_ibody_get+0x25d/0x510 fs/ext4/xattr.c:655
 ext4_xattr_get+0x123/0x6a0 fs/ext4/xattr.c:709
 ext4_get_acl+0x84/0x930 fs/ext4/acl.c:165
 __get_acl+0x279/0x400 fs/posix_acl.c:159
 get_inode_acl fs/posix_acl.c:184 [inline]
 posix_acl_chmod+0x111/0x280 fs/posix_acl.c:616
 notify_change+0xc1a/0xf40 fs/attr.c:546
 chmod_common+0x248/0x400 fs/open.c:650
 do_fchmodat+0x12d/0x200 fs/open.c:697
 __do_sys_chmod fs/open.c:721 [inline]
 __se_sys_chmod fs/open.c:719 [inline]
 __x64_sys_chmod+0x62/0x70 fs/open.c:719
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc606f8efc9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc607e73038 EFLAGS: 00000246 ORIG_RAX: 000000000000005a
RAX: ffffffffffffffda RBX: 00007fc6071e5fa0 RCX: 00007fc606f8efc9
RDX: 0000000000000000 RSI: 0000000000000140 RDI: 0000200000000180
RBP: 00007fc607011f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fc6071e6038 R14: 00007fc6071e5fa0 R15: 00007fffc3e37768
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x50b34
flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff)
raw: 04fff00000000000 ffffea000108f1c8 ffffea000142ce88 0000000000000000
raw: 0000000000000000 ffff888042200f60 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 0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO|__GFP_COMP), pid 5018, tgid 5018 (dhcpcd), ts 76770733860, free_ts 76813693265
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850
 prep_new_page mm/page_alloc.c:1858 [inline]
 get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416
 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline]
 alloc_pages_noprof+0xa9/0x190 mm/mempolicy.c:2507
 pagetable_alloc_noprof include/linux/mm.h:2980 [inline]
 __pte_alloc_one_noprof include/asm-generic/pgalloc.h:75 [inline]
 pte_alloc_one+0x23/0x310 arch/x86/mm/pgtable.c:18
 __pte_alloc+0x25/0x1a0 mm/memory.c:452
 copy_pte_range mm/memory.c:1235 [inline]
 copy_pmd_range+0x7805/0x7f00 mm/memory.c:1389
 copy_pud_range mm/memory.c:1426 [inline]
 copy_p4d_range mm/memory.c:1450 [inline]
 copy_page_range+0xc14/0x1270 mm/memory.c:1538
 dup_mmap+0xf4c/0x1b10 mm/mmap.c:1834
 dup_mm kernel/fork.c:1489 [inline]
 copy_mm+0x13c/0x4b0 kernel/fork.c:1541
 copy_process+0x1706/0x3c00 kernel/fork.c:2181
 kernel_clone+0x21e/0x840 kernel/fork.c:2609
 __do_sys_clone kernel/fork.c:2750 [inline]
 __se_sys_clone kernel/fork.c:2734 [inline]
 __x64_sys_clone+0x18b/0x1e0 kernel/fork.c:2734
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
page last free pid 15 tgid 15 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1394 [inline]
 __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906
 __tlb_remove_table_free mm/mmu_gather.c:227 [inline]
 tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:290
 rcu_do_batch kernel/rcu/tree.c:2605 [inline]
 rcu_core+0xcab/0x1770 kernel/rcu/tree.c:2861
 handle_softirqs+0x286/0x870 kernel/softirq.c:622
 run_ksoftirqd+0x9b/0x100 kernel/softirq.c:1063
 smpboot_thread_fn+0x542/0xa60 kernel/smpboot.c:160
 kthread+0x711/0x8a0 kernel/kthread.c:463
 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Memory state around the buggy address:
 ffff888050b33f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff888050b33f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff888050b34000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                   ^
 ffff888050b34080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888050b34100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/22 09:16 upstream 552c50713f27 252fbbad .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in xattr_find_entry
2025/10/20 16:34 upstream 211ddde0823f d422939c .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in xattr_find_entry
* Struck through repros no longer work on HEAD.