Merge pull request #1606 from cyphar/rootfs-propagation-no-pivot

specconv: emit an error when using MS_PRIVATE with --no-pivot
This commit is contained in:
Qiang Huang 2017-10-18 09:52:04 +08:00 committed by GitHub
commit 3409d5c555
1 changed files with 3 additions and 0 deletions

View File

@ -203,6 +203,9 @@ func CreateLibcontainerConfig(opts *CreateOpts) (*configs.Config, error) {
if config.RootPropagation, exists = mountPropagationMapping[spec.Linux.RootfsPropagation]; !exists {
return nil, fmt.Errorf("rootfsPropagation=%v is not supported", spec.Linux.RootfsPropagation)
}
if config.NoPivotRoot && (config.RootPropagation&unix.MS_PRIVATE != 0) {
return nil, fmt.Errorf("rootfsPropagation of [r]private is not safe without pivot_root")
}
for _, ns := range spec.Linux.Namespaces {
t, exists := namespaceMapping[ns.Type]