diff --git a/include/linux/pid.h b/include/linux/pid.h index 4817c6671e772560b4f715cdb695de24c68ad937..e29a900a84992f308ced20ed5ce4e9a4f2685f09 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h @@ -110,9 +110,8 @@ extern struct pid_namespace init_pid_ns; * see also find_task_by_pid() set in include/linux/sched.h */ extern struct pid *FASTCALL(find_pid_ns(int nr, struct pid_namespace *ns)); - -#define find_vpid(pid) find_pid_ns(pid, current->nsproxy->pid_ns) -#define find_pid(pid) find_pid_ns(pid, &init_pid_ns) +extern struct pid *find_vpid(int nr); +extern struct pid *find_pid(int nr); /* * Lookup a PID in the hash table, and return with it's count elevated. diff --git a/kernel/capability.c b/kernel/capability.c index 0d0d886d1e84e8753799955f0e6ea7523d5612b2..efbd9cdce1322d8a6e0c93ada872d68aadacf38e 100644 --- a/kernel/capability.c +++ b/kernel/capability.c @@ -96,7 +96,7 @@ static inline int cap_set_pg(int pgrp_nr, kernel_cap_t *effective, int found = 0; struct pid *pgrp; - pgrp = find_pid_ns(pgrp_nr, current->nsproxy->pid_ns); + pgrp = find_vpid(pgrp_nr); do_each_pid_task(pgrp, PIDTYPE_PGID, g) { target = g; while_each_thread(g, target) { diff --git a/kernel/pid.c b/kernel/pid.c index bed9e7f80a50cee36e09c630c02688edd6b97624..8040533d1a042d63b8fe4975d2822ee2737aa941 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -302,6 +302,18 @@ struct pid * fastcall find_pid_ns(int nr, struct pid_namespace *ns) } EXPORT_SYMBOL_GPL(find_pid_ns); +struct pid *find_vpid(int nr) +{ + return find_pid_ns(nr, current->nsproxy->pid_ns); +} +EXPORT_SYMBOL_GPL(find_vpid); + +struct pid *find_pid(int nr) +{ + return find_pid_ns(nr, &init_pid_ns); +} +EXPORT_SYMBOL_GPL(find_pid); + /* * attach_pid() must be called with the tasklist_lock write-held. */