summaryrefslogtreecommitdiff
path: root/kernel/capability.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/capability.c')
-rw-r--r--kernel/capability.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/kernel/capability.c b/kernel/capability.c
index b4a8c99b99f4..518d167dbaeb 100644
--- a/kernel/capability.c
+++ b/kernel/capability.c
@@ -84,13 +84,15 @@ static inline void cap_set_pg(int pgrp, kernel_cap_t *effective,
kernel_cap_t *inheritable,
kernel_cap_t *permitted)
{
- task_t *g, *target;
-
- do_each_thread(g, target) {
- if (target->pgrp != pgrp)
- continue;
- security_capset_set(target, effective, inheritable, permitted);
- } while_each_thread(g, target);
+ task_t *g, *target;
+ struct list_head *l;
+ struct pid *pid;
+
+ for_each_task_pid(pgrp, PIDTYPE_PGID, g, l, pid) {
+ target = g;
+ while_each_thread(g, target)
+ security_capset_set(target, effective, inheritable, permitted);
+ }
}
/*