Bind mount PCI paths for TPUs as read only.

PiperOrigin-RevId: 552912189
This commit is contained in:
Lucas Manning
2023-08-01 13:56:45 -07:00
committed by gVisor bot
parent 8baec93b4c
commit fa9163e7a0
+1 -1
View File
@@ -176,7 +176,7 @@ func tpuProxyUpdateChroot(chroot string, conf *config.Config) error {
if err != nil {
return fmt.Errorf("error parsing path %q: %v", sysAccelPath, err)
}
if err := mountInChroot(chroot, sysPCIDeviceDir, sysPCIDeviceDir, "bind", unix.MS_BIND); err != nil {
if err := mountInChroot(chroot, sysPCIDeviceDir, sysPCIDeviceDir, "bind", unix.MS_BIND|unix.MS_RDONLY); err != nil {
return fmt.Errorf("error mounting %q in chroot: %v", sysAccelPath, err)
}
}