Skip to content

Commit

Permalink
ipcns: fix use after free in free_ipc_ns()
Browse files Browse the repository at this point in the history
commit b515498 ("userns: add a user namespace owner of ipc ns") added a
user namespace owner of ipc ns, but it also introduced a use after free in
free_ipc_ns().

Signed-off-by: Xiaotian Feng <[email protected]>
Acked-by: "Serge E. Hallyn" <[email protected]>
Acked-by: David Howells <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Xiaotian Feng authored and torvalds committed Mar 26, 2011
1 parent c03e312 commit be4d250
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ipc/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand All @@ -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);
}

/*
Expand Down

0 comments on commit be4d250

Please sign in to comment.