container: Do not restrict path access for privileged containers
Privileged containers should see and reach all host paths. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
42d2fa6576
commit
e23d986cf2
1 changed files with 22 additions and 19 deletions
|
@ -466,6 +466,8 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
|||
specgen.SetProcessSelinuxLabel(sb.processLabel)
|
||||
specgen.SetLinuxMountLabel(sb.mountLabel)
|
||||
|
||||
if containerConfig.GetLinux().GetSecurityContext() != nil &&
|
||||
containerConfig.GetLinux().GetSecurityContext().Privileged == false {
|
||||
for _, mp := range []string{
|
||||
"/proc/kcore",
|
||||
"/proc/latency_stats",
|
||||
|
@ -488,6 +490,7 @@ func (s *Server) createSandboxContainer(ctx context.Context, containerID string,
|
|||
specgen.AddLinuxReadonlyPaths(rp)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Join the namespace paths for the pod sandbox container.
|
||||
podInfraState := s.runtime.ContainerStatus(sb.infraContainer)
|
||||
|
||||
|
|
Loading…
Reference in a new issue