Skip to content

Commit

Permalink
Merge pull request #2573 from jpculp/unmask-sys-firmware
Browse files Browse the repository at this point in the history
host-ctr: Unmask `/sys/firmware` from host containers
  • Loading branch information
jpculp authored Nov 15, 2022
2 parents ce153da + f4c1899 commit 0643430
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions sources/host-ctr/cmd/host-ctr/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,20 @@ func runCtr(containerdSocket string, namespace string, containerID string, sourc
oci.WithHostNamespace(runtimespec.NetworkNamespace),
oci.WithHostHostsFile,
oci.WithHostResolvconf,
// Unmask `/sys/firmware` by passing an alternate list of masked paths
// List is based on the DefaultUnixSpec's MaskedPaths for Linux
// (https://github.com/containerd/containerd/blob/e9af808/oci/spec.go#L164)
oci.WithMaskedPaths([]string{
"/proc/acpi",
"/proc/asound",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
}),
// Pass proxy environment variables to this container
withProxyEnv(),
// Add a default set of mounts regardless of the container type
Expand Down

0 comments on commit 0643430

Please sign in to comment.