Fix capability.c to work with threaded init
PATCH 1/1 Fix capability.c to work with threaded init
From: Sukadev Bhattiprolu <sukadev-r/[email protected]>
Subject: [PATCH] Fix capability.c to work with threaded init
When setting capabilities, cap_set_all() must skip all threads of the container_init process - not just the main thread.
Signed-off-by Sukadev Bhattiprolu <sukadev-r/[email protected]>
--- kernel/capability.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/capability.c +1 -1
@@ -137,7 +137,7 @@ static inline int cap_set_all(kernel_capint found =0 ; do_each_thread(g, target) { -if (target == current ||is_container_init (target)) +if (target == current ||is_container_init (target->group_leader))continue ; found =1 ; if (security_capset_check(target, effective, inheritable,