From: "Eric W. Biederman" <ebiederm@xmission.com>
To: Hangyu Hua <hbh25y@gmail.com>
Cc: akpm@linux-foundation.org, songmuchun@bytedance.com,
longman@redhat.com, roman.gushchin@linux.dev, legion@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipc: mqueue: fix possible memory leak in init_mqueue_fs()
Date: Fri, 15 Jul 2022 13:20:23 -0500 [thread overview]
Message-ID: <87v8ryz194.fsf@email.froward.int.ebiederm.org> (raw)
In-Reply-To: <20220715062301.19311-1-hbh25y@gmail.com> (Hangyu Hua's message of "Fri, 15 Jul 2022 14:23:01 +0800")
Hangyu Hua <hbh25y@gmail.com> writes:
> commit db7cfc380900 ("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.
Alex can you review this change?
> Fixes: dc55e35f9e81 ("ipc: Store mqueue sysctls in the ipc namespace")
> Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
> ---
> ipc/mqueue.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/ipc/mqueue.c b/ipc/mqueue.c
> index 12ad7860bb88..83370fef8879 100644
> --- a/ipc/mqueue.c
> +++ b/ipc/mqueue.c
> @@ -1746,6 +1746,7 @@ static int __init init_mqueue_fs(void)
> unregister_filesystem(&mqueue_fs_type);
> out_sysctl:
> kmem_cache_destroy(mqueue_inode_cachep);
> + retire_mq_sysctls(&init_ipc_ns);
> return error;
> }
Thanks,
Eric
next prev parent reply other threads:[~2022-07-15 18:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 6:23 Hangyu Hua
2022-07-15 18:20 ` Eric W. Biederman [this message]
2022-07-19 22:21 ` Eric W. Biederman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v8ryz194.fsf@email.froward.int.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=hbh25y@gmail.com \
--cc=legion@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=roman.gushchin@linux.dev \
--cc=songmuchun@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®