mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
To: "glaubitz@physik.fu-berlin.de" <glaubitz@physik.fu-berlin.de>,
	"yang.chenzhi@vivo.com" <yang.chenzhi@vivo.com>,
	"slava@dubeyko.com" <slava@dubeyko.com>,
	"frank.li@vivo.com" <frank.li@vivo.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re:  [PATCH 0/1] hfs: discuss to add offset/length validation in hfs_brec_lenoff
Date: Mon, 18 Aug 2025 17:59:03 +0000	[thread overview]
Message-ID: <ee40295987f48507fd1a0621f91d952a3ee2f9a4.camel@ibm.com> (raw)
In-Reply-To: <20250818141734.8559-1-yang.chenzhi@vivo.com>

On Mon, 2025-08-18 at 22:17 +0800, Chenzhi Yang wrote:
> From: Yang Chenzhi <yang.chenzhi@vivo.com>
> 
> When running syzbot with a crafted HFS/HFS+ disk image containing
> invalid record offsets or lengths, the filesystem may hang. For
> example, in this case syzbot set the header’s second record offset
> to 0x7f00 while node_size is 4096. HFS/HFS+ failed to detect this
> fault, which eventually led to a crash.
> 

HFS has 512 bytes b-tree node size.

> Since HFS/HFS+ makes heavy use of hfs_brec_lenoff, adding manual
> offset/length checks at every call site would be tedious and
> error-prone.
> 

You are mentioning HFS here. But you've shared fix only for HFS+. Are you
planning to share the fix for HFS too?

Thanks,
Slava.

> Instead, it may be more robust to introduce validation directly
> inside hfs_brec_lenoff (or at a similar central point), ensuring
> that all callers can safely rely on the returned offset and length
> without additional checks.
> 
> Yang Chenzhi (1):
>   hfs: validate record offset in hfsplus_bmap_alloc
> 
>  fs/hfsplus/bnode.c      | 41 ----------------------------------------
>  fs/hfsplus/btree.c      |  6 ++++++
>  fs/hfsplus/hfsplus_fs.h | 42 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+), 41 deletions(-)

      parent reply	other threads:[~2025-08-18 17:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 14:17 Chenzhi Yang
2025-08-18 14:17 ` [PATCH 1/1] hfs: validate record offset in hfsplus_bmap_alloc Chenzhi Yang
2025-08-18 17:57   ` Viacheslav Dubeyko
2025-08-18 17:59 ` Viacheslav Dubeyko [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=ee40295987f48507fd1a0621f91d952a3ee2f9a4.camel@ibm.com \
    --to=slava.dubeyko@ibm.com \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    --cc=yang.chenzhi@vivo.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®