Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

BUG FIXES:

* Fixed `GOMAXPROCS` to prevent Go workloads from being over-threaded against the host CPU capacity. [[GH-98](https://github.com/hashicorp/nomad-driver-exec2/pull/98)]
* Error messages from the `unshare`/`nsenter` shim processes now appear in the allocation logs. [[GH-95](https://github.com/hashicorp/nomad-driver-exec2/pull/95)]

## 0.1.2 (May 12, 2026)
Expand Down
5 changes: 5 additions & 0 deletions pkg/shim/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ func lockdown(defaults bool, elements []string) error {
landlock.Dir("/usr/bin", "rx"),
landlock.Dir("/usr/local/bin", "rx"),
)
// expose /proc read-only so runtimes (Go 1.25+, JVM, dotnet) can read
// /proc/self/cgroup and /proc/self/mountinfo to discover their cgroup
// CPU and memory limits. unshare --mount-proc creates
// an isolated /proc scoped to the task's PID namespace.
paths = append(paths, landlock.Dir("/proc", "r"))
}

return landlock.New(paths...).Lock(landlock.Mandatory)
Expand Down
2 changes: 2 additions & 0 deletions plugin/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@ func (p *Plugin) setOptions(driverTaskConfig *drivers.TaskConfig) (*shim.Options
// if the plugin config.unveil_defaults value is set to true (very common)
// then automatically unveil the sandbox directories
if p.config.UnveilDefaults {
// Expose the task's cgroup read-only so runtimes can read resource limits.
unveil = append(unveil, "r:"+driverTaskConfig.Resources.LinuxResources.CpusetCgroupPath)
unveil = append(unveil, "rwxc:"+driverTaskConfig.Env["NOMAD_TASK_DIR"])
unveil = append(unveil, "rwxc:"+driverTaskConfig.Env["NOMAD_ALLOC_DIR"])
unveil = append(unveil, "rx:"+driverTaskConfig.Env["NOMAD_ALLOC_DIR"]+"/logs")
Expand Down
Loading