Merge pull request #595 from crosbymichael/masking
Update masked and ro paths
This commit is contained in:
commit
146643f1f9
12
spec.go
12
spec.go
|
@ -294,15 +294,9 @@ func createLibcontainerConfig(cgroupName string, spec *specs.LinuxSpec) (*config
|
|||
return nil, err
|
||||
}
|
||||
config.Cgroups = c
|
||||
if config.Readonlyfs {
|
||||
setReadonly(config)
|
||||
config.MaskPaths = []string{
|
||||
"/proc/kcore",
|
||||
}
|
||||
config.ReadonlyPaths = []string{
|
||||
"/proc/sys", "/proc/sysrq-trigger", "/proc/irq", "/proc/bus",
|
||||
}
|
||||
}
|
||||
// set extra path masking for libcontainer for the various unsafe places in proc
|
||||
config.MaskPaths = maskedPaths
|
||||
config.ReadonlyPaths = readonlyPaths
|
||||
seccomp, err := setupSeccomp(&spec.Linux.Seccomp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
17
utils.go
17
utils.go
|
@ -122,6 +122,23 @@ var allowedDevices = []*configs.Device{
|
|||
},
|
||||
}
|
||||
|
||||
var (
|
||||
maskedPaths = []string{
|
||||
"/proc/kcore",
|
||||
"/proc/latency_stats",
|
||||
"/proc/timer_stats",
|
||||
"/proc/sched_debug",
|
||||
}
|
||||
readonlyPaths = []string{
|
||||
"/proc/asound",
|
||||
"/proc/bus",
|
||||
"/proc/fs",
|
||||
"/proc/irq",
|
||||
"/proc/sys",
|
||||
"/proc/sysrq-trigger",
|
||||
}
|
||||
)
|
||||
|
||||
var container libcontainer.Container
|
||||
|
||||
func containerPreload(context *cli.Context) error {
|
||||
|
|
Loading…
Reference in New Issue