containerd/cmd/ctr/commands
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
..
containers feat: Add snapshotter label to the new snapshot for container. 2021-06-28 20:08:01 +08:00
content replace uses of os/exec with golang.org/x/sys/execabs 2021-08-25 18:11:09 +02:00
events ctr events: do not exit on an error 2020-01-29 13:10:16 +09:00
images adds quiet option for ref 2021-04-20 09:20:14 -05:00
install Add optional install path 2018-09-11 10:36:00 -04:00
leases *: replace 3600 seconds with 1 hour 2018-08-02 11:40:03 -07:00
namespaces Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
oci Fix exported comments enforcer in CI 2021-03-12 08:47:05 -08:00
plugins plugin status should be skip, not error 2021-03-15 18:04:37 +08:00
pprof Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
run Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
shim Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
snapshots Fix content.ReaderAt close 2021-05-08 12:39:09 +08:00
tasks Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
version adding go version to client description 2019-10-06 13:38:51 +02:00
client.go implement ctr -connect-timeout 2019-09-16 13:56:53 +02:00
commands_unix.go Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
commands_windows.go Remove redundant build tags 2021-08-05 22:27:46 -07:00
commands.go feat: Add snapshotter label to the new snapshot for container. 2021-06-28 20:08:01 +08:00
resolver.go Support HTTP debug in ctr 2021-03-22 09:32:34 -07:00
signals_linux.go Ignore SIGURG signals in signal forwarder 2020-09-04 16:19:31 -07:00
signals_notlinux.go Run go fmt with Go 1.17 2021-08-22 09:31:50 +09:00
signals.go Ignore SIGURG signals in signal forwarder 2020-09-04 16:19:31 -07:00
utils.go Implemented image encryption/decryption libraries and ctr commands 2019-07-17 15:19:58 -04:00