syzbot


KASAN: use-after-free Read in hpfs_get_ea

Status: upstream: reported C repro on 2025/07/17 19:14
Subsystems: fs
[Documentation on labels]
Reported-by: syzbot+fa88eb476e42878f2844@syzkaller.appspotmail.com
First crash: 10d, last: 3h23m
Cause bisection: failed (error log, bisect log)
  
Discussions (4)
Title Replies (including bot) Last reply
[PATCH] hpfs: add checks for ea addresses 5 (5) 2025/07/24 18:44
[PATCH] hpfs: add checks for ea addresses 2 (3) 2025/07/23 02:45
1 (1) 2025/07/20 12:29
[syzbot] [fs?] KASAN: use-after-free Read in hpfs_get_ea 0 (7) 2025/07/20 07:29
Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in hpfs_get_ea 19 C 6 23h47m 1d00h 0/3 upstream: reported C repro on 2025/07/26 19:47
linux-6.6 KASAN: use-after-free Read in hpfs_get_ea 19 C 3 2h38m 3h00m 0/2 upstream: reported C repro on 2025/07/27 17:30
linux-6.1 KASAN: use-after-free Read in hpfs_get_ea 19 C 6 2h15m 3h02m 0/3 upstream: reported C repro on 2025/07/27 17:28
Last patch testing requests (7)
Created Duration User Patch Repo Result
2025/07/20 12:35 1h12m apokusinski01@gmail.com patch upstream OK log
2025/07/20 07:29 14m purvayeshi550@gmail.com patch upstream report log
2025/07/20 06:54 6m purvayeshi550@gmail.com patch upstream error
2025/07/19 07:57 17m purvayeshi550@gmail.com patch upstream report log
2025/07/19 00:58 0m kapoorarnav43@gmail.com patch upstream error
2025/07/18 12:57 14m kapoorarnav43@gmail.com patch upstream report log
2025/07/18 12:32 0m kapoorarnav43@gmail.com patch upstream error

Sample crash report:
hpfs: filesystem error: invalid number of hotfixes: 2066844986, used: 2066844985; already mounted read-only
hpfs: filesystem error: improperly stopped
hpfs: You really don't want any checks? You are crazy...
hpfs: hpfs_map_sector(): read error
hpfs: code page support is disabled
==================================================================
BUG: KASAN: use-after-free in strcmp+0x6f/0xc0 lib/string.c:283
Read of size 1 at addr ffff888072cad8a6 by task syz-executor121/5841

CPU: 0 UID: 0 PID: 5841 Comm: syz-executor121 Not tainted 6.16.0-rc7-syzkaller-00127-g302f88ff3584 #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
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
 strcmp+0x6f/0xc0 lib/string.c:283
 hpfs_get_ea+0x114/0xdb0 fs/hpfs/ea.c:139
 hpfs_read_inode+0x19d/0x1010 fs/hpfs/inode.c:63
 hpfs_fill_super+0x12bd/0x2070 fs/hpfs/super.c:654
 get_tree_bdev_flags+0x40e/0x4d0 fs/super.c:1681
 vfs_get_tree+0x92/0x2b0 fs/super.c:1804
 do_new_mount+0x24a/0xa40 fs/namespace.c:3902
 do_mount fs/namespace.c:4239 [inline]
 __do_sys_mount fs/namespace.c:4450 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4427
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fe7b46905ea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007ffd6fdcd5f8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fe7b46905ea
RDX: 0000200000009e80 RSI: 0000200000009ec0 RDI: 00007ffd6fdcd640
RBP: 0000000000000004 R08: 00007ffd6fdcd680 R09: 0000000000009dff
R10: 0000000000000041 R11: 0000000000000202 R12: 0000200000009ec0
R13: 00007ffd6fdcd680 R14: 0000000000010000 R15: 0000000000000003
 </TASK>

The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x7ff37e28f pfn:0x72cad
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0001cb2b88 ffffea0001cb2b08 0000000000000000
raw: 00000007ff37e28f 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 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO|__GFP_COMP), pid 5826, tgid 5826 (sshd-session), ts 71937590757, free_ts 72068530261
 set_page_owner include/linux/page_owner.h:32 [inline]
 post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704
 prep_new_page mm/page_alloc.c:1712 [inline]
 get_page_from_freelist+0x21d5/0x22b0 mm/page_alloc.c:3669
 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959
 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2419
 folio_alloc_mpol_noprof mm/mempolicy.c:2438 [inline]
 vma_alloc_folio_noprof+0xe4/0x200 mm/mempolicy.c:2473
 folio_prealloc+0x30/0x180 mm/memory.c:-1
 alloc_anon_folio mm/memory.c:5014 [inline]
 do_anonymous_page mm/memory.c:5071 [inline]
 do_pte_missing mm/memory.c:4249 [inline]
 handle_pte_fault mm/memory.c:6069 [inline]
 __handle_mm_fault+0x2c88/0x5620 mm/memory.c:6212
 handle_mm_fault+0x2d5/0x7f0 mm/memory.c:6381
 do_user_addr_fault+0xa81/0x1390 arch/x86/mm/fault.c:1336
 handle_page_fault arch/x86/mm/fault.c:1476 [inline]
 exc_page_fault+0x76/0xf0 arch/x86/mm/fault.c:1532
 asm_exc_page_fault+0x26/0x30 arch/x86/include/asm/idtentry.h:623
page last free pid 5826 tgid 5826 stack trace:
 reset_page_owner include/linux/page_owner.h:25 [inline]
 free_pages_prepare mm/page_alloc.c:1248 [inline]
 free_unref_folios+0xcd2/0x1570 mm/page_alloc.c:2763
 folios_put_refs+0x559/0x640 mm/swap.c:992
 free_pages_and_swap_cache+0x277/0x520 mm/swap_state.c:264
 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline]
 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:397 [inline]
 tlb_flush_mmu+0x3a0/0x680 mm/mmu_gather.c:404
 tlb_finish_mmu+0xc3/0x1d0 mm/mmu_gather.c:497
 vms_clear_ptes+0x42c/0x540 mm/vma.c:1230
 vms_complete_munmap_vmas+0x206/0x8a0 mm/vma.c:1272
 do_vmi_align_munmap+0x358/0x420 mm/vma.c:1531
 do_vmi_munmap+0x253/0x2e0 mm/vma.c:1579
 __vm_munmap+0x23b/0x3d0 mm/vma.c:3108
 __do_sys_munmap mm/mmap.c:1084 [inline]
 __se_sys_munmap mm/mmap.c:1081 [inline]
 __x64_sys_munmap+0x60/0x70 mm/mmap.c:1081
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Memory state around the buggy address:
 ffff888072cad780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888072cad800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888072cad880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                               ^
 ffff888072cad900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888072cad980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/26 21:20 upstream 302f88ff3584 fb8f743d .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: use-after-free Read in hpfs_get_ea
2025/07/17 00:04 upstream 155a3c003e55 44f8051e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: use-after-free Read in hpfs_get_ea
2025/07/16 23:34 upstream 155a3c003e55 44f8051e .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: use-after-free Read in hpfs_get_ea
2025/07/16 21:48 upstream 155a3c003e55 44f8051e .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root KASAN: use-after-free Read in hpfs_get_ea
2025/07/16 21:35 upstream 155a3c003e55 44f8051e .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root KASAN: use-after-free Read in hpfs_get_ea
2025/07/27 03:16 upstream 302f88ff3584 fb8f743d .config console log report syz / log [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs KASAN: use-after-free Read in hpfs_get_ea
2025/07/21 08:25 upstream 89be9a83ccf1 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: use-after-free Read in hpfs_get_ea
2025/07/21 08:24 upstream 89be9a83ccf1 7117feec .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: use-after-free Read in hpfs_get_ea
2025/07/27 16:54 upstream ec2df4364666 fb8f743d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in hpfs_get_ea
2025/07/16 21:19 upstream 155a3c003e55 44f8051e .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root KASAN: use-after-free Read in hpfs_get_ea
2025/07/27 17:07 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 82af5ea7c611 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in hpfs_get_ea
2025/07/27 17:07 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 82af5ea7c611 fb8f743d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: use-after-free Read in hpfs_get_ea
* Struck through repros no longer work on HEAD.