summaryrefslogtreecommitdiff
path: root/include/linux/bnge/git@git.tavy.me:linux.git
diff options
context:
space:
mode:
authorDavid Maximiliano Hermitte <davemadmaxxx@gmail.com>2026-07-08 21:56:36 +0000
committerViacheslav Dubeyko <slava@dubeyko.com>2026-07-14 10:22:16 -0700
commit53c3c138d672765c26884c55728307a65c634328 (patch)
treed651fa17394efaf36dc558dbffe5feaca3cfb487 /include/linux/bnge/git@git.tavy.me:linux.git
parentdc59e4fea9d83f03bad6bddf3fa2e52491777482 (diff)
hfs: validate catalog CNIDs before instantiating inodes
hfs_cat_find_brec() first resolves a catalog thread record by CNID and then looks up the corresponding catalog record by parent/name. On a corrupted filesystem image, the second lookup may find a record whose CNID does not match the CNID that was requested. Validate the record found by the second lookup before returning it. Read the already-found record with hfs_bnode_read(), require the exact fixed size for file and directory records, reject other record types, and verify that the stored CNID matches the requested CNID. Also validate reserved CNIDs in hfs_read_inode() before populating the inode, propagate hfs_read_inode() failures from the resource-fork lookup path, and reject bad resource-fork and root inodes. Keep hfs_write_inode() unchanged, so corrupted catalog records are rejected before reaching its existing reserved-CNID BUG() path. Reported-by: syzbot+97e301b4b82ae803d21b@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=97e301b4b82ae803d21b Cc: George Anthony Vernon <contact@gvernon.com> Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: David Maximiliano Hermitte <davemadmaxxx@gmail.com> Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com> Link: https://lore.kernel.org/r/20260708215636.73815-1-davemadmaxxx@gmail.com Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Diffstat (limited to 'include/linux/bnge/git@git.tavy.me:linux.git')
0 files changed, 0 insertions, 0 deletions