From: ebiederm@xmission.com (Eric W. Biederman)
To: Dan Carpenter <error27@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
serge@hallyn.com, David Howells <dhowells@redhat.com>,
Daniel Lezcano <daniel.lezcano@free.fr>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch -next] ipcns: use after free in free_ipc_ns()
Date: Mon, 28 Mar 2011 04:55:31 -0700 [thread overview]
Message-ID: <m1vcz3zcgc.fsf@fess.ebiederm.org> (raw)
In-Reply-To: <20110328085048.GI1885@bicker> (Dan Carpenter's message of "Mon, 28 Mar 2011 11:50:48 +0300")
Dan Carpenter <error27@gmail.com> writes:
> We dereference "ns" after it has been freed. This was introduced in
> b515498f5bb5 "userns: add a user namespace owner of ipc ns".
I think Andrew has already merged this fix.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
>
> diff --git a/ipc/namespace.c b/ipc/namespace.c
> index 3c3e522..8054c8e 100644
> --- a/ipc/namespace.c
> +++ b/ipc/namespace.c
> @@ -104,7 +104,6 @@ static void free_ipc_ns(struct ipc_namespace *ns)
> sem_exit_ns(ns);
> msg_exit_ns(ns);
> shm_exit_ns(ns);
> - kfree(ns);
> atomic_dec(&nr_ipc_ns);
>
> /*
> @@ -113,6 +112,7 @@ static void free_ipc_ns(struct ipc_namespace *ns)
> */
> ipcns_notify(IPCNS_REMOVED);
> put_user_ns(ns->user_ns);
> + kfree(ns);
> }
>
> /*
prev parent reply other threads:[~2011-03-28 11:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 8:50 [patch -next] ipcns: use after free in free_ipc_ns() Dan Carpenter
2011-03-28 11:55 ` Eric W. Biederman [this message]
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=m1vcz3zcgc.fsf@fess.ebiederm.org \
--to=ebiederm@xmission.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.lezcano@free.fr \
--cc=dhowells@redhat.com \
--cc=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=serge@hallyn.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