Skip to content

Commit c579d60

Browse files
HBh25Yebiederm
authored andcommitted
ipc: mqueue: fix possible memory leak in init_mqueue_fs()
commit db7cfc3 ("ipc: Free mq_sysctls if ipc namespace creation failed") Here's a similar memory leak to the one fixed by the patch above. retire_mq_sysctls need to be called when init_mqueue_fs fails after setup_mq_sysctls. Fixes: dc55e35 ("ipc: Store mqueue sysctls in the ipc namespace") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Link: https://lkml.kernel.org/r/20220715062301.19311-1-hbh25y@gmail.com Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
1 parent f2906aa commit c579d60

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ipc/mqueue.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,6 +1746,7 @@ static int __init init_mqueue_fs(void)
17461746
unregister_filesystem(&mqueue_fs_type);
17471747
out_sysctl:
17481748
kmem_cache_destroy(mqueue_inode_cachep);
1749+
retire_mq_sysctls(&init_ipc_ns);
17491750
return error;
17501751
}
17511752

0 commit comments

Comments
 (0)