Skip to content

Commit

Permalink
runtime: virtcontainers: make rootfs image read-only
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julio Montes committed Jul 23, 2021
1 parent 070590f commit 2859600
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/runtime/virtcontainers/qemu_amd64_test.go
Expand Up @@ -138,6 +138,7 @@ func TestQemuAmd64AppendImage(t *testing.T) {
ID: "mem0",
MemPath: f.Name(),
Size: (uint64)(imageStat.Size()),
ReadOnly: true,
},
}

Expand Down
1 change: 1 addition & 0 deletions src/runtime/virtcontainers/qemu_arch_base.go
Expand Up @@ -406,6 +406,7 @@ func (q *qemuArchBase) appendNvdimmImage(devices []govmmQemu.Device, path string
ID: "mem0",
MemPath: path,
Size: (uint64)(imageStat.Size()),
ReadOnly: true,
}

devices = append(devices, object)
Expand Down

0 comments on commit 2859600

Please sign in to comment.