open-nomad/drivers/shared/executor
Tim Gross 1dad0e597e
fix integer bounds checks (#11815)
* driver: fix integer conversion error

The shared executor incorrectly parsed the user's group into int32 and
then cast to uint32 without bounds checking. This is harmless because
an out-of-bounds gid will throw an error later, but it triggers
security and code quality scans. Parse directly to uint32 so that we
get correct error handling.

* helper: fix integer conversion error

The autopilot flags helper incorrectly parses a uint64 to a uint which
is machine specific size. Although we don't have 32-bit builds, this
sets off security and code quality scaans. Parse to the machine sized
uint.

* driver: restrict bounds of port map

The plugin server doesn't constrain the maximum integer for port
maps. This could result in a user-visible misconfiguration, but it
also triggers security and code quality scans. Restrict the bounds
before casting to int32 and return an error.

* cpuset: restrict upper bounds of cpuset values

Our cpuset configuration expects values in the range of uint16 to
match the expectations set by the kernel, but we don't constrain the
values before downcasting. An underflow could lead to allocations
failing on the client rather than being caught earlier. This also make
security and code quality scanners happy.

* http: fix integer downcast for per_page parameter

The parser for the `per_page` query parameter downcasts to int32
without bounds checking. This could result in underflow and
nonsensical paging, but there's no server-side consequences for
this. Fixing this will silence some security and code quality scanners
though.
2022-01-25 11:16:48 -05:00
..
proto drivers/exec: pass capabilities through executor RPC 2021-05-17 12:37:40 -06:00
test-resources/busybox
client.go chore: fixup inconsistent method receiver names. (#11704) 2021-12-20 11:44:21 +01:00
exec_utils.go Apply some suggested fixes from staticcheck (#9598) 2020-12-10 07:29:18 -08:00
executor.go deps: pty has new home 2022-01-19 12:33:05 -06:00
executor_basic.go gofmt all the files 2021-10-01 10:14:28 -04:00
executor_linux.go build: upgrade and speedup circleci configuration 2022-01-24 08:28:14 -06:00
executor_linux_test.go test: update tests to properly use AllocDir 2021-10-19 10:49:07 -07:00
executor_plugin.go
executor_test.go build: upgrade and speedup circleci configuration 2022-01-24 08:28:14 -06:00
executor_universal_linux.go fix integer bounds checks (#11815) 2022-01-25 11:16:48 -05:00
executor_unix.go gofmt all the files 2021-10-01 10:14:28 -04:00
executor_windows.go default e.getAllPids in executor_basic 2019-07-18 10:57:27 -04:00
legacy_executor_wrapper.go Legacy executors are executors after all 2020-11-10 10:20:07 -05:00
libcontainer_nsenter_linux.go
pid_collector.go deps: bump gopsutil to v3.21.2 2021-03-30 16:02:51 -04:00
pid_collector_test.go
plugins.go
pty_unix.go deps: pty has new home 2022-01-19 12:33:05 -06:00
pty_windows.go gofmt all the files 2021-10-01 10:14:28 -04:00
resource_container_default.go gofmt all the files 2021-10-01 10:14:28 -04:00
resource_container_linux.go resource_container_linux new getAllPidsByCgroup 2019-07-17 17:31:36 -04:00
server.go drivers/exec: pass capabilities through executor RPC 2021-05-17 12:37:40 -06:00
utils.go drivers/exec+java: Add task configuration to restore previous PID/IPC isolation behavior 2021-02-08 14:26:35 -06:00
utils_test.go drivers/exec+java: Add task configuration to restore previous PID/IPC isolation behavior 2021-02-08 14:26:35 -06:00
utils_unix.go gofmt all the files 2021-10-01 10:14:28 -04:00
utils_windows.go
z_executor_cmd.go drivers: remove duplicate import statements. 2021-06-11 09:38:09 +02:00