linux-stable/ipc
Zhengchao Shao 86273624a6 ipc: fix memory leak in init_mqueue_fs()
[ Upstream commit 12b677f2c6 ]

When setup_mq_sysctls() failed in init_mqueue_fs(), mqueue_inode_cachep is
not released.  In order to fix this issue, the release path is reordered.

Link: https://lkml.kernel.org/r/20221209092929.1978875-1-shaozhengchao@huawei.com
Fixes: dc55e35f9e ("ipc: Store mqueue sysctls in the ipc namespace")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Cc: Alexey Gladkov <legion@kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Jingyu Wang <jingyuwang_vip@163.com>
Cc: Muchun Song <songmuchun@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Waiman Long <longman@redhat.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>
Cc: YueHaibing <yuehaibing@huawei.com>
Cc: Yu Zhe <yuzhe@nfschina.com>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-31 13:25:48 +01:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
compat.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ipc_sysctl.c ipc: Remove extra braces 2022-05-03 17:25:58 -05:00
mq_sysctl.c ipc: Store mqueue sysctls in the ipc namespace 2022-03-08 13:39:40 -06:00
mqueue.c ipc: fix memory leak in init_mqueue_fs() 2022-12-31 13:25:48 +01:00
msg.c memcg: enable accounting of ipc resources 2021-09-03 09:58:12 -07:00
msgutil.c ipc: Use generic ns_common::count 2020-08-19 14:13:52 +02:00
namespace.c ipc: Free mq_sysctls if ipc namespace creation failed 2022-06-22 17:47:41 -05:00
sem.c ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:30:22 +01:00
shm.c shm: extend forced shm destroy to support objects from several IPC nses 2021-11-20 10:35:54 -08:00
syscall.c y2038: remove CONFIG_64BIT_TIME 2019-11-15 14:38:27 +01:00
util.c proc: remove PDE_DATA() completely 2022-01-22 08:33:37 +02:00
util.h ipc/util.c: use binary search for max_idx 2021-07-01 11:06:07 -07:00