runtime: virtcontainers: make rootfs image read-only

Improve security by making rootfs image read-only, nobody
will be able to modify it from the guest.

fixes #1916

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2021-07-22 09:57:23 -05:00
parent 070590fb53
commit 2859600a6f
2 changed files with 2 additions and 0 deletions

View File

@ -138,6 +138,7 @@ func TestQemuAmd64AppendImage(t *testing.T) {
ID: "mem0", ID: "mem0",
MemPath: f.Name(), MemPath: f.Name(),
Size: (uint64)(imageStat.Size()), Size: (uint64)(imageStat.Size()),
ReadOnly: true,
}, },
} }

View File

@ -406,6 +406,7 @@ func (q *qemuArchBase) appendNvdimmImage(devices []govmmQemu.Device, path string
ID: "mem0", ID: "mem0",
MemPath: path, MemPath: path,
Size: (uint64)(imageStat.Size()), Size: (uint64)(imageStat.Size()),
ReadOnly: true,
} }
devices = append(devices, object) devices = append(devices, object)