mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Merge pull request #8698 from avagin:gofer-proc
PiperOrigin-RevId: 516677129
This commit is contained in:
@@ -401,6 +401,12 @@ func setupRootFS(spec *specs.Spec, conf *config.Config) error {
|
||||
if err := unix.Mount("runsc-proc", "/proc/proc", "proc", flags|unix.MS_RDONLY, ""); err != nil {
|
||||
util.Fatalf("error mounting proc: %v", err)
|
||||
}
|
||||
// self/fd is bind-mounted, so that the FD return by
|
||||
// OpenProcSelfFD() does not allow escapes with walking ".." .
|
||||
if err := unix.Mount("/proc/proc/self/fd", "/proc/proc/self/fd",
|
||||
"", unix.MS_RDONLY|unix.MS_BIND|unix.MS_NOEXEC, ""); err != nil {
|
||||
util.Fatalf("error mounting proc/self/fd: %v", err)
|
||||
}
|
||||
if err := copyFile("/proc/etc/localtime", "/etc/localtime"); err != nil {
|
||||
log.Warningf("Failed to copy /etc/localtime: %v. UTC timezone will be used.", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user