linux-stable/fs/hfs
Pan Bian 5cf41549e6 hfs: do not free node before using
[ Upstream commit ce96a407ad ]

hfs_bmap_free() frees the node via hfs_bnode_put(node).  However, it
then reads node->this when dumping error message on an error path, which
may result in a use-after-free bug.  This patch frees the node only when
it is never again used.

Link: http://lkml.kernel.org/r/1542963889-128825-1-git-send-email-bianpan2016@163.com
Fixes: a1185ffa2fc ("HFS rewrite")
Signed-off-by: Pan Bian <bianpan2016@163.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Ernesto A. Fernandez <ernesto.mnd.fernandez@gmail.com>
Cc: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-17 09:38:35 +01:00
..
attr.c hfs: Switch to generic xattr handlers 2016-10-06 22:17:38 -04:00
bfind.c hfs/hfsplus: convert printks to pr_<level> 2013-04-30 17:04:05 -07:00
bitmap.c hfs/hfsplus: convert dprint to hfs_dbg 2013-04-30 17:04:05 -07:00
bnode.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
brec.c hfs: prevent btree data loss on root split 2018-11-27 16:09:38 +01:00
btree.c hfs: do not free node before using 2018-12-17 09:38:35 +01:00
btree.h fs/hfs/btree.h: remove duplicate defines 2013-11-13 12:09:32 +09:00
catalog.c fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps 2016-09-27 21:06:22 -04:00
dir.c Merge remote-tracking branch 'ovl/rename2' into for-linus 2016-10-10 23:02:51 -04:00
extent.c hfs/hfsplus: convert dprint to hfs_dbg 2013-04-30 17:04:05 -07:00
hfs.h
hfs_fs.h hfs: Switch to generic xattr handlers 2016-10-06 22:17:38 -04:00
inode.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-10-10 20:16:43 -07:00
Kconfig fs/hfs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:05 -08:00
Makefile
mdb.c HFS wants 8Kb per-superblock allocation; just use kmalloc() 2016-01-04 10:29:34 -05:00
part_tbl.c
string.c get rid of 'parent' argument of ->d_compare() 2016-07-31 16:37:25 -04:00
super.c hfs: Switch to generic xattr handlers 2016-10-06 22:17:38 -04:00
sysdep.c VFS: normal filesystems (and lustre): d_inode() annotations 2015-04-15 15:06:57 -04:00
trans.c qstr: constify instances in hfs 2016-07-20 23:30:06 -04:00