From: Dan Carpenter <error27@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: serge@hallyn.com, "Eric W. Biederman" <ebiederm@xmission.com>,
David Howells <dhowells@redhat.com>,
Daniel Lezcano <daniel.lezcano@free.fr>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch -next] ipcns: use after free in free_ipc_ns()
Date: Mon, 28 Mar 2011 11:50:48 +0300 [thread overview]
Message-ID: <20110328085048.GI1885@bicker> (raw)
We dereference "ns" after it has been freed. This was introduced in
b515498f5bb5 "userns: add a user namespace owner of ipc ns".
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);
}
/*
next reply other threads:[~2011-03-28 8:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-28 8:50 Dan Carpenter [this message]
2011-03-28 11:55 ` [patch -next] ipcns: use after free in free_ipc_ns() 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=20110328085048.GI1885@bicker \
--to=error27@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=daniel.lezcano@free.fr \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.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