diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 5290a45ec73..e8d8211b198 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -554,6 +554,7 @@ func checkProcMount(rootfs, dest, source string) error { "/proc/loadavg", "/proc/slabinfo", "/proc/net/dev", + "/proc/sys/kernel/ns_last_pid", } for _, valid := range validProcMounts { path, err := filepath.Rel(filepath.Join(rootfs, valid), dest) diff --git a/libcontainer/rootfs_linux_test.go b/libcontainer/rootfs_linux_test.go index e3bfdc50315..8709a5e47f7 100644 --- a/libcontainer/rootfs_linux_test.go +++ b/libcontainer/rootfs_linux_test.go @@ -38,6 +38,14 @@ func TestCheckMountDestFalsePositive(t *testing.T) { } } +func TestCheckMountDestNsLastPid(t *testing.T) { + dest := "/rootfs/proc/sys/kernel/ns_last_pid" + err := checkProcMount("/rootfs", dest, "/proc") + if err != nil { + t.Fatal("/proc/sys/kernel/ns_last_pid should not return an error") + } +} + func TestNeedsSetupDev(t *testing.T) { config := &configs.Config{ Mounts: []*configs.Mount{