linux/fs/hfs
Dan Carpenter 40a1e01420 hfs: fix potential use after free in hfs_correct_next_unused_CNID()
[ Upstream commit c105e76bb1 ]

This code calls hfs_bnode_put(node) which drops the refcount and then
dreferences "node" on the next line.  It's only safe to use "node"
when we're holding a reference so flip these two lines around.

Fixes: a06ec283e1 ("hfs: add logic of correcting a next unused CNID")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/aN-Xw8KnbSnuIcLk@stanley.mountain
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2025-12-18 14:02:52 +01:00
..
attr.c hfs: move hfs_xattr_handlers to .rodata 2023-10-09 16:24:19 +02:00
bfind.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bitmap.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
bnode.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
brec.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
btree.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
btree.h hfs: add lock nesting notation to hfs_find_init 2021-07-15 10:13:49 -07:00
catalog.c hfs: fix potential use after free in hfs_correct_next_unused_CNID() 2025-12-18 14:02:52 +01:00
dir.c Change inode_operations.mkdir to return struct dentry * 2025-02-27 20:00:17 +01:00
extent.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
hfs.h address hfs on-disk corruption robustness review comments 2008-02-06 10:41:05 -08:00
hfs_fs.h hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
inode.c hfs/hfsplus: rework debug output subsystem 2025-09-24 16:30:34 -07:00
Kconfig fs: add CONFIG_BUFFER_HEAD 2023-08-02 09:13:09 -06:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mdb.c hfs: add logic of correcting a next unused CNID 2025-08-31 18:15:21 -07:00
part_tbl.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
string.c get rid of 'parent' argument of ->d_compare() 2016-07-31 16:37:25 -04:00
super.c hfs: add logic of correcting a next unused CNID 2025-08-31 18:15:21 -07:00
sysdep.c Pass parent directory inode and expected name to ->d_revalidate() 2025-01-27 19:25:23 -05:00
trans.c hfs: Fix OOB Write in hfs_asc2mac 2022-12-11 19:30:19 -08:00