[Android 5.15] KASAN: use-after-free Read in ext4_listxattr

3 views
Skip to first unread message

syzbot

unread,
May 18, 2026, 1:03:21 AM (yesterday) May 18
to syzkaller-a...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 7f4b368e0410 Merge 5.15.206 into android13-5.15-lts
git tree: android13-5.15-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=1193f02e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=daefb08bb2811735
dashboard link: https://syzkaller.appspot.com/bug?extid=497e40b21797638daf43
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12cdfcc8580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1572cd6a580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/4451345c6abf/disk-7f4b368e.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/5e418dd662b5/vmlinux-7f4b368e.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a0939c5bbfe1/bzImage-7f4b368e.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/49db81276873/mount_0.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=17fb37ba580000)
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/21ff6279a3f9/mount_6.gz
fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=1531d8ec580000)

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

loop2: detected capacity change from 0 to 2048
EXT4-fs (loop2): mounted filesystem without journal. Opts: init_itable,acl,mb_optimize_scan=0x0000000000000001,,errors=continue. Quota mode: none.
==================================================================
BUG: KASAN: use-after-free in ext4_xattr_list_entries fs/ext4/xattr.c:670 [inline]
BUG: KASAN: use-after-free in ext4_xattr_ibody_list fs/ext4/xattr.c:740 [inline]
BUG: KASAN: use-after-free in ext4_listxattr+0x4a6/0xc50 fs/ext4/xattr.c:765
Read of size 4 at addr ffff88812f387044 by task syz.2.17/372

CPU: 1 PID: 372 Comm: syz.2.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
Call Trace:
<TASK>
__dump_stack+0x21/0x30 lib/dump_stack.c:88
dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106
print_address_description+0x7f/0x2c0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:427 [inline]
kasan_report+0xf1/0x140 mm/kasan/report.c:444
__asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308
ext4_xattr_list_entries fs/ext4/xattr.c:670 [inline]
ext4_xattr_ibody_list fs/ext4/xattr.c:740 [inline]
ext4_listxattr+0x4a6/0xc50 fs/ext4/xattr.c:765
vfs_listxattr fs/xattr.c:448 [inline]
listxattr+0x294/0x300 fs/xattr.c:783
path_listxattr+0xe1/0x1b0 fs/xattr.c:807
__do_sys_listxattr fs/xattr.c:819 [inline]
__se_sys_listxattr fs/xattr.c:816 [inline]
__x64_sys_listxattr+0x80/0x90 fs/xattr.c:816
x64_sys_call+0xd7/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:195
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fa68ffb6e59
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:00007ffe1d1f6a78 EFLAGS: 00000246 ORIG_RAX: 00000000000000c2
RAX: ffffffffffffffda RBX: 00007fa69022ffa0 RCX: 00007fa68ffb6e59
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00002000000004c0
RBP: 00007fa69004cd6f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fa69022ffac R14: 00007fa69022ffa0 R15: 00007fa69022ffa0
</TASK>

The buggy address belongs to the page:
page:ffffea0004bce1c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x12f387
flags: 0x4000000000000000(zone=1)
raw: 4000000000000000 ffffea0004bce208 ffffea0004bce148 0000000000000000
raw: 0000000000000001 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 0x100cca(GFP_HIGHUSER_MOVABLE), pid 372, ts 30750278168, free_ts 30752131537
set_page_owner include/linux/page_owner.h:33 [inline]
post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605
prep_new_page+0x1c/0x110 mm/page_alloc.c:2611
get_page_from_freelist+0x2d3a/0x2dc0 mm/page_alloc.c:4485
__alloc_pages+0x1a2/0x460 mm/page_alloc.c:5822
__alloc_pages_node include/linux/gfp.h:595 [inline]
alloc_pages_node include/linux/gfp.h:609 [inline]
alloc_pages include/linux/gfp.h:622 [inline]
shmem_alloc_page mm/shmem.c:1587 [inline]
shmem_alloc_and_acct_page+0x4a2/0x8d0 mm/shmem.c:1612
shmem_getpage_gfp+0xfe5/0x2310 mm/shmem.c:1908
shmem_getpage mm/shmem.c:152 [inline]
shmem_write_begin+0xce/0x1b0 mm/shmem.c:2476
generic_perform_write+0x2b7/0x690 mm/filemap.c:3870
__generic_file_write_iter+0x268/0x480 mm/filemap.c:3998
generic_file_write_iter+0xa9/0x1d0 mm/filemap.c:4030
call_write_iter include/linux/fs.h:2212 [inline]
new_sync_write fs/read_write.c:507 [inline]
vfs_write+0x835/0xfd0 fs/read_write.c:594
ksys_write+0x149/0x250 fs/read_write.c:647
__do_sys_write fs/read_write.c:659 [inline]
__se_sys_write fs/read_write.c:656 [inline]
__x64_sys_write+0x7b/0x90 fs/read_write.c:656
x64_sys_call+0x8ef/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:2
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
page last free stack trace:
reset_page_owner include/linux/page_owner.h:26 [inline]
free_pages_prepare mm/page_alloc.c:1472 [inline]
free_pcp_prepare mm/page_alloc.c:1544 [inline]
free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534
free_unref_page_list+0x13a/0x9d0 mm/page_alloc.c:3671
release_pages+0x1006/0x1060 mm/swap.c:1015
__pagevec_release+0x71/0xe0 mm/swap.c:1035
pagevec_release include/linux/pagevec.h:81 [inline]
shmem_undo_range+0x595/0x1470 mm/shmem.c:965
shmem_truncate_range mm/shmem.c:1064 [inline]
shmem_evict_inode+0x21a/0xa10 mm/shmem.c:1146
evict+0x4c9/0x8d0 fs/inode.c:650
iput_final fs/inode.c:1779 [inline]
iput+0x635/0x7c0 fs/inode.c:1805
dentry_unlink_inode+0x32f/0x3e0 fs/dcache.c:380
__dentry_kill+0x44f/0x650 fs/dcache.c:586
dentry_kill+0xc0/0x2a0 fs/dcache.c:-1
dput+0x47/0x90 fs/dcache.c:893
__fput+0x580/0x8b0 fs/file_table.c:319
____fput+0x15/0x20 fs/file_table.c:339
task_work_run+0x127/0x190 kernel/task_work.c:188
tracehook_notify_resume include/linux/tracehook.h:189 [inline]
exit_to_user_mode_loop+0xd0/0xe0 kernel/entry/common.c:181

Memory state around the buggy address:
ffff88812f386f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff88812f386f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88812f387000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff88812f387080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff88812f387100: 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
Reply all
Reply to author
Forward
0 new messages