mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikulas Patocka <mikulas@twibright.com>
To: ZW Tang <tangzw515@gmail.com>
Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>,
	 linux-kernel@vger.kernel.org
Subject: Re: [BUG] hpfs: KASAN use-after-free in hpfs_get_ea()
Date: Tue, 11 Aug 2026 09:47:21 +0200 (CEST)	[thread overview]
Message-ID: <1071222b-a18b-62c5-5c6d-4e5fa8c94d58@twibright.com> (raw)
In-Reply-To: <CAA2SOT6j_6JJVOH3Vu0mDQKX+iebEkHaEhJ_9ofykZLHd98u6Q@mail.gmail.com>



On Tue, 11 Aug 2026, ZW Tang wrote:

> Hi,
> 
> I am reporting a KASAN use-after-free issue triggered by a syzkaller
> reproducer on Linux 7.2-rc3.
> 
> Although a similar HPFS issue appears to have been reported before, I
> can still trigger this KASAN use-after-free on Linux 7.2-rc3 with the
> attached syzkaller reproducer.
> 
> The reproducer mounts a crafted HPFS filesystem image. During mount, HPFS
> reports several filesystem errors and then triggers a KASAN use-after-free
> in strcmp(), called from hpfs_get_ea(). The crash happens while HPFS is
> reading inode metadata during hpfs_fill_super().
> 
> This looks like a potential HPFS extended-attribute parsing or lifetime
> handling issue when processing a malformed filesystem image. The HPFS code
> appears to pass an invalid or already-freed string pointer to strcmp() from
> hpfs_get_ea().
> 
> Reproducer:
> syz reproducer: https://pastebin.com/raw/GRAS4KFk
> console output: https://pastebin.com/raw/bnUVVvva
> kernel config: https://pastebin.com/raw/nRnxH6Bi
> 
> Kernel:
> kernel version: 7.2.0-rc3 #1
> preemption model: PREEMPT(full)
> HEAD commit: 1137d8b5df06137fb49513cc923b3b24d94cb809
> environment: QEMU Ubuntu 24.10
> taint: Not tainted
> 
> Relevant log:
> 
> loop0: detected capacity change from 0 to 128
> 
> hpfs: filesystem error: invalid number of hotfixes: 2066844986, used:
> 2066844985; already mounted read-only
> hpfs: filesystem error: improperly stopped
> hpfs: filesystem error: warning: spare dnodes used, try chkdsk
> 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+0xa7/0xb0
> Read of size 1 at addr ffff8880776368a6 by task syz.0.17/10816
> 
> CPU: 0 UID: 0 PID: 10816 Comm: syz.0.17 Not tainted 7.2.0-rc3 #1 PREEMPT(full)
> Hardware name: QEMU Ubuntu 24.10 PC (i440FX + PIIX, 1996), BIOS
> 1.16.3-debian-1.16.3-2 04/01/2014
> 
> Call Trace:
> <TASK>
> dump_stack_lvl
> print_report
> kasan_report
> strcmp
> hpfs_get_ea
> hpfs_read_inode
> hpfs_fill_super
> get_tree_bdev_flags
> vfs_get_tree
> fc_mount
> path_mount
> do_mount
> __x64_sys_mount
> do_syscall_64
> entry_SYSCALL_64_after_hwframe
> </TASK>
> 
> The syzkaller program uses syz_mount_image$hpfs() with mount options including
> err_ro, chkdsk_no, case_asis, and check_none. The crafted image appears to

Hi

The check_none option just does what it's supposed to do - disable 
consistency checking. As a consequence of using the this option, the 
filesystem hit the error. Don't fuzz the filesystem with the check_none 
option.

Mikulas

> drive HPFS into the inode / extended-attribute parsing path, where the stale
> string pointer is later dereferenced by strcmp().
> 
> The system then panics because panic_on_warn is set:
> 
> Kernel panic - not syncing: KASAN: panic_on_warn set ...
> 
> Thanks
> 
> 

      reply	other threads:[~2026-08-11  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11  4:27 ZW Tang
2026-08-11  7:47 ` Mikulas Patocka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1071222b-a18b-62c5-5c6d-4e5fa8c94d58@twibright.com \
    --to=mikulas@twibright.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    --cc=tangzw515@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®