open-nomad/plugins/drivers
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 allow configuration of Docker hostnames in bridge mode (#11173) 2021-09-16 08:13:09 +02:00
testutils chore: fixup inconsistent method receiver names. (#11704) 2021-12-20 11:44:21 +01:00
utils gofmt all the files 2021-10-01 10:14:28 -04:00
client.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
cstructs.go
driver.go allow configuration of Docker hostnames in bridge mode (#11173) 2021-09-16 08:13:09 +02:00
errors.go
execstreaming.go implemment streaming exec handling in driver grpc handlers 2019-05-09 16:49:08 -04:00
plugin.go drivers: pass logger through driver plugin client 2019-01-25 09:38:41 -05:00
server.go fix integer bounds checks (#11815) 2022-01-25 11:16:48 -05:00
task_handle.go core: propagate remote task handles 2021-04-27 15:07:03 -07:00
utils.go allow configuration of Docker hostnames in bridge mode (#11173) 2021-09-16 08:13:09 +02:00
utils_test.go allow configuration of Docker hostnames in bridge mode (#11173) 2021-09-16 08:13:09 +02:00
versions.go