mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 23:52:40 +00:00
pid_namespace: make freeing struct pid_namespace rcu-delayed
makes procfs ->premission() instances safety in RCU mode independent from vfsmount_lock. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
1dcddd4abd
commit
1adfcb03e3
2 changed files with 8 additions and 1 deletions
|
@ -132,6 +132,12 @@ out:
|
|||
return ERR_PTR(err);
|
||||
}
|
||||
|
||||
static void delayed_free_pidns(struct rcu_head *p)
|
||||
{
|
||||
kmem_cache_free(pid_ns_cachep,
|
||||
container_of(p, struct pid_namespace, rcu));
|
||||
}
|
||||
|
||||
static void destroy_pid_namespace(struct pid_namespace *ns)
|
||||
{
|
||||
int i;
|
||||
|
@ -140,7 +146,7 @@ static void destroy_pid_namespace(struct pid_namespace *ns)
|
|||
for (i = 0; i < PIDMAP_ENTRIES; i++)
|
||||
kfree(ns->pidmap[i].page);
|
||||
put_user_ns(ns->user_ns);
|
||||
kmem_cache_free(pid_ns_cachep, ns);
|
||||
call_rcu(&ns->rcu, delayed_free_pidns);
|
||||
}
|
||||
|
||||
struct pid_namespace *copy_pid_ns(unsigned long flags,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue