Skip to content

Commit c1f5551

Browse files
haircommanderopenshift-cherrypick-robot
authored andcommitted
reduce infra container's selinux privilege
before, if a pod was privileged, a pause container was set as privileged. This caused the rest of the containers in the pod to also need to inherit privileged labels from the pod (so they can join the pause container's namespaces). In reality, there's little need for the pause container to have privileged (spc_t) label. It can manage an unprivileged namespace, and containers can join regardless of privilege. Further, the privilege of the pause container doesn't affect its ability to reap (if the pod shares pid). Unconditionally set the pause container's process label, so the rest of the (unprivileged) containers in the pod inherit it. Signed-off-by: Peter Hunt <[email protected]>
1 parent 5592167 commit c1f5551

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/sandbox_run_linux.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ func (s *Server) runPodSandbox(ctx context.Context, req *pb.RunPodSandboxRequest
9999
s.defaultIDMappings,
100100
labelOptions)
101101
mountLabel = podContainer.MountLabel
102-
if !s.privilegedSandbox(req) {
103-
processLabel = podContainer.ProcessLabel
104-
}
102+
processLabel = podContainer.ProcessLabel
103+
105104
if errors.Cause(err) == storage.ErrDuplicateName {
106105
return nil, fmt.Errorf("pod sandbox with name %q already exists", name)
107106
}

0 commit comments

Comments
 (0)