File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,24 @@ func checkMountDestination(rootfs, dest string) error {
299299 invalidDestinations := []string {
300300 "/proc" ,
301301 }
302+ // White list, it should be sub directories of invalid destinations
303+ validDestinations := []string {
304+ // These entries can be bind mounted by files emulated by fuse,
305+ // so commands like top, free displays stats in container.
306+ "/proc/cpuinfo" ,
307+ "/proc/diskstats" ,
308+ "/proc/meminfo" ,
309+ "/proc/stats" ,
310+ }
311+ for _ , valid := range validDestinations {
312+ path , err := filepath .Rel (filepath .Join (rootfs , valid ), dest )
313+ if err != nil {
314+ return err
315+ }
316+ if path == "." {
317+ return nil
318+ }
319+ }
302320 for _ , invalid := range invalidDestinations {
303321 path , err := filepath .Rel (filepath .Join (rootfs , invalid ), dest )
304322 if err != nil {
You can’t perform that action at this time.
0 commit comments