Commit Graph

11 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
2ac9968401
replace uses of os/exec with golang.org/x/sys/execabs
Go 1.15.7 contained a security fix for CVE-2021-3115, which allowed arbitrary
code to be executed at build time when using cgo on Windows. This issue also
affects Unix users who have “.” listed explicitly in their PATH and are running
“go get” outside of a module or with module mode disabled.

This issue is not limited to the go command itself, and can also affect binaries
that use `os.Command`, `os.LookPath`, etc.

From the related blogpost (ttps://blog.golang.org/path-security):

> Are your own programs affected?
>
> If you use exec.LookPath or exec.Command in your own programs, you only need to
> be concerned if you (or your users) run your program in a directory with untrusted
> contents. If so, then a subprocess could be started using an executable from dot
> instead of from a system directory. (Again, using an executable from dot happens
> always on Windows and only with uncommon PATH settings on Unix.)
>
> If you are concerned, then we’ve published the more restricted variant of os/exec
> as golang.org/x/sys/execabs. You can use it in your program by simply replacing

This patch replaces all uses of `os/exec` with `golang.org/x/sys/execabs`. While
some uses of `os/exec` should not be problematic (e.g. part of tests), it is
probably good to be consistent, in case code gets moved around.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-25 18:11:09 +02:00
ktock
9c01fe20d3 Allow to pass --no-cgroup option to nvidia-container-cli
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-06-14 23:58:22 +09:00
AllenZMC
f4927a2985 fix mis-spelling in nvidia.go
Signed-off-by: 常仲民@daocloud <zhongming.chang@daocloud.io>
2019-08-29 23:03:09 +08:00
Tibor Vass
7ca2c3d68d contrib/nvidia: export helper binary path and list of Nvidia capabilities
Signed-off-by: Tibor Vass <tibor@docker.com>
2019-03-12 15:28:14 -07:00
Jean Rouge
90880078b9 Adding a --load-kmods flag to the NVIDIA OCI hook
Signed-off-by: Jean Rouge <jer329@cornell.edu>
2018-11-15 01:52:11 -08:00
nashasha1
7f03ad6579 Fix typos
Signed-off-by: nashasha1 <a4012017@sina.com>
2018-09-07 16:59:42 +08:00
Kenfe-Mickaël Laventure
875b92c507
Merge pull request #2512 from crosbymichael/gpupath
Add nvidia Opts to lookup containerd binary or hook path
2018-07-31 09:28:33 -07:00
Michael Crosby
e4f33dcfb5 Add nvidia Opts to lookup containerd binary or hook path
This is for consumers like Docker that manage a `docker-containerd`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-31 10:11:25 -04:00
Michael Crosby
81e2859e8b Change gpu Capability type to string
This helps with mappings so that we are not translating multiple times
from caller to hook.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-30 15:37:13 -04:00
Michael Crosby
dd0c04970d nvidia GPU support for caps and multiple uuids
This improves nvidia support for multiple uuids per container and fixes
the API to add individual capabilities.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-27 15:28:59 -04:00
Michael Crosby
b949697a9c Add nvidia gpu support via libnvidia-container
This adds nvidia gpu support via the libnvidia-container project and
`nvidia-container-cli`.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-09 13:37:39 -04:00