linux-brain/fs/hfs
Pan Bian 5ee5fa61d0 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:28:54 +01:00
..
attr.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bfind.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bitmap.c hfs/hfsplus: convert dprint to hfs_dbg 2013-04-30 17:04:05 -07:00
bnode.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
brec.c hfs: prevent btree data loss on root split 2018-11-27 16:10:46 +01:00
btree.c hfs: do not free node before using 2018-12-17 09:28:54 +01:00
btree.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
catalog.c fs: Replace CURRENT_TIME_SEC with current_time() for inode timestamps 2016-09-27 21:06:22 -04:00
dir.c hfs: fix hfs_readdir() 2017-02-18 22:11:15 -05:00
extent.c fs: semove set but not checked AOP_FLAG_UNINTERRUPTIBLE flag 2017-05-08 17:15:14 -07:00
hfs_fs.h Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
hfs.h address hfs on-disk corruption robustness review comments 2008-02-06 10:41:05 -08:00
inode.c fs: convert a pile of fsync routines to errseq_t based reporting 2017-08-01 08:39:29 -04:00
Kconfig fs/hfs: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:39:05 -08:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mdb.c VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb) 2017-07-17 08:45:34 +01: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 VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb) 2017-07-17 08:45:34 +01: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