mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 1sh1ro <yangguikun19@qq.com>
To: Viacheslav Dubeyko <slava@dubeyko.com>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	Yangtao Li <frank.li@vivo.com>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] hfs: keep the internal B-tree inodes out of the VFS open path
Date: Mon, 12 Oct 2026 15:44:38 +0800	[thread overview]
Message-ID: <tencent_463A9FACA88DD4806FE391162761D3B42807@qq.com> (raw)
In-Reply-To: <fb6a6e2ff419fc197c793d9a98fccd2d1332e49d.camel@dubeyko.com>

Hi Viacheslav,

v2, following your suggestion.  hfs_btree_open() no longer patches i_mode
up by hand: there is now an hfs_system_iget()/hfs_system_read_inode()
pair, the HFS counterpart of hfsplus_iget()/hfsplus_system_read_inode().
The B-tree inodes are created through the generic inode-cache path and
get their S_IFREG there, and the extent-record validation still runs
before hfs_btree_open() succeeds.

hfs_iget() itself is keyed on a catalog record (key + rec) and the
B-tree inodes have no catalog record, so hfs_system_iget() is a sibling
entry point sharing the same inode-cache path.  Folding it into
hfs_iget() is a small change if you prefer that shape.

Patch 2 keeps the alias guard from v1 - a catalog record must not address
CNID 3/4 - as hardening on top of patch 1.  Drop it if you consider
hfs_is_valid_cnid()'s acceptance of HFS_CDR_FIL records for those CNIDs
intentional.

The series applies to v7.3-rc5 and fs/hfs builds clean with clang.

Thanks,
1sh1ro

1sh1ro (2):
  hfs: create the internal B-tree inodes through the generic iget path
  hfs: refuse catalog records that address the reserved B-tree CNIDs

 fs/hfs/btree.c  |  25 +++++--------------------
 fs/hfs/hfs_fs.h |   1 +
 fs/hfs/inode.c  |  85 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+), 20 deletions(-)


      parent reply	other threads:[~2026-10-12  7:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260916080000.0-hfs-fix@localhost>
2026-09-16  9:09 ` [PATCH 1/1] hfs: don't let internal B-tree inodes leak into " 1sh1ro
2026-09-16 18:33   ` Viacheslav Dubeyko
     [not found]     ` <20261012154438.6396-1-yangguikun19@qq.com>
2026-10-12  7:44       ` [PATCH v2 2/2] hfs: refuse catalog records that address the reserved B-tree CNIDs 1sh1ro
2026-10-12 21:30         ` Viacheslav Dubeyko
2026-10-13  6:44           ` [PATCH v3] hfs: give the internal B-tree inodes a type and keep catalog records off them yangguikun
2026-10-13 21:38             ` Viacheslav Dubeyko
2026-10-14  8:03               ` [PATCH v4] hfs: initialize B-tree inodes and validate catalog CNIDs yangguikun
2026-10-14 22:27                 ` Viacheslav Dubeyko
2026-10-15  7:06                   ` [PATCH v5] " yangguikun
2026-10-15 22:34                     ` Viacheslav Dubeyko
2026-10-17  5:14                       ` yangguikun
2026-10-19 23:44                         ` Viacheslav Dubeyko
2026-10-12  7:44       ` [PATCH v2 1/2] hfs: create the internal B-tree inodes through the generic iget path 1sh1ro
2026-10-12 21:26         ` Viacheslav Dubeyko
2026-10-12  7:44     ` 1sh1ro [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=tencent_463A9FACA88DD4806FE391162761D3B42807@qq.com \
    --to=yangguikun19@qq.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 \
    /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®