android_kernel_motorola_sm6225/fs/configfs
Xiyu Yang 96fc3559de configfs: fix config_item refcnt leak in configfs_rmdir()
[ Upstream commit 8aebfffacfa379ba400da573a5bf9e49634e38cb ]

configfs_rmdir() invokes configfs_get_config_item(), which returns a
reference of the specified config_item object to "parent_item" with
increased refcnt.

When configfs_rmdir() returns, local variable "parent_item" becomes
invalid, so the refcount should be decreased to keep refcount balanced.

The reference counting issue happens in one exception handling path of
configfs_rmdir(). When down_write_killable() fails, the function forgets
to decrease the refcnt increased by configfs_get_config_item(), causing
a refcnt leak.

Fix this issue by calling config_item_put() when down_write_killable()
fails.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-05-27 17:37:32 +02:00
..
configfs_internal.h configfs: new object reprsenting tree fragments 2019-11-12 19:20:46 +01:00
dir.c configfs: fix config_item refcnt leak in configfs_rmdir() 2020-05-27 17:37:32 +02:00
file.c configfs: provide exclusion between IO and removals 2019-11-12 19:20:47 +01:00
inode.c vfs: change inode times to use struct timespec64 2018-06-05 16:57:31 -07:00
item.c configfs: use kvasprintf() instead of open-coding it 2018-06-19 07:08:12 +02:00
Kconfig
Makefile
mount.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00
symlink.c configfs: fix a deadlock in configfs_symlink() 2019-11-12 19:20:47 +01:00