Commit Graph

16 Commits

Author SHA1 Message Date
Seth Hoenig
b242957990 ci: swap ci parallelization for unconstrained gomaxprocs 2022-03-15 12:58:52 -05:00
Tim Gross
358a46819b 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
James Rasell
ab9ba35e6a chore: fixup inconsistent method receiver names. (#11704) 2021-12-20 11:44:21 +01:00
James Rasell
3bffe443ac chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
Nick Ethier
85f6a56c6f lib/cpuset: add String and ContainsAny helpers 2021-04-13 13:28:36 -04:00
Nick Ethier
94c7aec159 scheduler: implement scheduling of reserved cores 2021-03-19 00:29:07 -04:00
Nick Ethier
b1041a164c structs: add struct fields and funcs for reservable cpu cores 2021-03-18 22:49:06 -04:00
Kris Hicks
071f4c7596 Add gocritic to golangci-lint config (#9556) 2020-12-08 12:47:04 -08:00
Seth Hoenig
15fb4c990a deps: Switch to Go modules for dependency management
This PR switches the Nomad repository from using govendor to Go modules
for managing dependencies. Aspects of the Nomad workflow remain pretty
much the same. The usual Makefile targets should continue to work as
they always did. The API submodule simply defers to the parent Nomad
version on the repository, keeping the semantics of API versioning that
currently exists.
2020-06-02 14:30:36 -05:00
Nick Ethier
d6ada19db1 circbufwritter: add defer to stop ticker in flush loop 2019-01-28 14:33:20 -05:00
Nick Ethier
160cdf8059 circbufwriter: defer unlock in Write since it will not block 2019-01-28 12:15:12 -05:00
Nick Ethier
c6cc1e62e7 circbufwriter: Add tests 2019-01-28 12:04:41 -05:00
Nick Ethier
6837a73708 add circbufwriter package 2019-01-28 11:35:21 -05:00
Preetha Appan
a2284d0f3e code review feedback 2018-09-04 16:10:11 -05:00
Preetha Appan
d40338c8b9 Move topk and delay heap to separate packages under lib 2018-09-04 16:10:11 -05:00
Preetha Appan
f57f5865bb Move delayheap to lib package 2018-03-14 16:10:32 -05:00