Re: [PATCH v2] hfsplus: validate attribute key name length on every read path

From: Kyuwon Cho

Date: Fri Dec 04 2026 - 20:46:24 EST


On Fri, Dec 04, 2026 at 03:15:59PM -0800, Viacheslav Dubeyko wrote:
> I think hfs_bnode_read_key() should return an error (-EIO) for an
> invalid key, and hfs_brec_insert() and hfs_brec_update_parent() should
> propagate it.

Agreed. The exact v1 reproducer was clean in three runs on the v2 KASAN
kernel. My node-split test used valid keys, however, so it did not exercise a
corrupt first record after a split. I will add that case before v3.

In v3 I will make hfs_bnode_read_key() return an error, derive the offset from
the record index, and propagate -EIO through insertion and parent updates. I
will also remove the duplicate attribute-tree check from the validation
helper.