From: Yangtao Li Date: Tue, 5 Aug 2025 16:58:59 +0000 (-0600) Subject: hfsplus: return EIO when type of hidden directory mismatch in hfsplus_fill_super() X-Git-Tag: v5.4.301~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e173b4ee13c1ac9bf86ad779ceed6e63a48c86f;p=thirdparty%2Fkernel%2Fstable.git hfsplus: return EIO when type of hidden directory mismatch in hfsplus_fill_super() [ Upstream commit 9282bc905f0949fab8cf86c0f620ca988761254c ] If Catalog File contains corrupted record for the case of hidden directory's type, regard it as I/O error instead of Invalid argument. Signed-off-by: Yangtao Li Reviewed-by: Viacheslav Dubeyko Link: https://lore.kernel.org/r/20250805165905.3390154-1-frank.li@vivo.com Signed-off-by: Viacheslav Dubeyko Signed-off-by: Sasha Levin --- diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index d744fde41680..db68ed59b4b2 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -539,7 +539,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) if (!hfs_brec_read(&fd, &entry, sizeof(entry))) { hfs_find_exit(&fd); if (entry.type != cpu_to_be16(HFSPLUS_FOLDER)) { - err = -EINVAL; + err = -EIO; goto out_put_root; } inode = hfsplus_iget(sb, be32_to_cpu(entry.folder.id));