Commit graph

44765 commits

Author SHA1 Message Date
Sebastiaan van Stijn
ec3c08d618
Merge pull request #44261 from thaJeztah/remove_deprecated_pkgs
remove aliases for deprecated pkg/urlutil, pkg/fsutils, pkg/pubsub
2022-10-14 01:35:01 +02:00
Sebastiaan van Stijn
c0309cfe69
Merge pull request #44284 from thaJeztah/replace_IsAnInteractiveSession
cmd/dockerd: replace deprecated windows.IsAnInteractiveSession()
2022-10-14 01:28:10 +02:00
Sebastiaan van Stijn
f29a3eb9c7
Merge pull request #44278 from thaJeztah/overlay_remove_kernel_check_override
daemon/graphdriver/overlay2: remove deprecated overrideKernelCheck
2022-10-13 22:35:25 +02:00
Sebastiaan van Stijn
ffcddc908e
cmd/dockerd: replace deprecated windows.IsAnInteractiveSession()
The `IsAnInteractiveSession` was deprecated, and `IsWindowsService` is marked
as the recommended replacement.

For details, see 280f808b4a

> CL 244958 includes isWindowsService function that determines if a
> process is running as a service. The code of the function is based on
> public .Net implementation.
>
> IsAnInteractiveSession function implements similar functionality, but
> is based on an old Stackoverflow post., which is not as authoritative
> as code written by Microsoft for their official product.
>
> This change copies CL 244958 isWindowsService function into svc package
> and makes it public. The intention is that future users will prefer
> IsWindowsService to IsAnInteractiveSession.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-11 22:54:40 +02:00
Brian Goff
058010187b
Merge pull request #44271 from thaJeztah/pidfile_windows_cleanup
pkg/pidfile: windows: replace magic consts for golang.org/x/sys consts
2022-10-10 09:30:06 -07:00
Sebastiaan van Stijn
e35700eb50
daemon/graphdriver/overlay2: remove deprecated overrideKernelCheck
Commit 955c1f881a (Docker v17.12.0) replaced
detection of support for multiple lowerdirs (as required by overlay2) to not
depend on the kernel version. The `overlay2.override_kernel_check` was still
used to print a warning that older kernel versions may not have full support.

After this, commit e226aea280 (Docker v20.10.0,
backported to v19.03.7) removed uses of the `overlay2.override_kernel_check`
option altogether, but we were still parsing it.

This patch changes the `parseOptions()` function to not parse the option,
printing a deprecation warning instead. We should change this to be an error,
but the  `overlay2.override_kernel_check` option was not deprecated in the
documentation, so keeping it around for one more release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-10 14:58:40 +02:00
Sebastiaan van Stijn
b43a7ac530
integration/plugin: remove deprecated overlay2.override_kernel_check
It's no longer used since e226aea280

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-10 14:46:08 +02:00
Samuel Karp
c9d2b7df77
Merge pull request #44222 from thaJeztah/godoc_instead_of_readme 2022-10-10 00:06:17 -07:00
Samuel Karp
620fbb5655
Merge pull request #44272 from thaJeztah/remove_solaris_leftovers 2022-10-09 23:56:31 -07:00
Sebastiaan van Stijn
de705907a5
client: remove solaris build-tag, simplify and gofumpt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-09 22:41:55 +02:00
Sebastiaan van Stijn
d33428f0bf
pkg/system: remove solaris left-over
It was removed everywhere else, so we may as well remove it here.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-09 14:59:19 +02:00
Sebastiaan van Stijn
a35bcd01c5
pkg/pidfile: replace uses of windows.Close() with windows.CloseHandle()
Since https://golang.org/cl/4600042, Close is a straight wrapper of CloseHandle.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-09 13:27:58 +02:00
Sebastiaan van Stijn
89de943401
pkg/pidfile: windows: replace magic consts for golang.org/x/sys consts
These consts were defined locally, but are now defined in golang.org/x/sys, so
we can use those.

Also added some documentation about how this function works, taking the description
from the GetExitCodeProcess function (processthreadsapi.h) API reference:
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getexitcodeprocess

> The GetExitCodeProcess function returns a valid error code defined by the
> application only after the thread terminates. Therefore, an application should
> not use `STILL_ACTIVE` (259) as an error code (`STILL_ACTIVE` is a macro for
> `STATUS_PENDING` (minwinbase.h)). If a thread returns `STILL_ACTIVE` (259) as
> an error code, then applications that test for that value could interpret it
> to mean that the thread is still running, and continue to test for the
> completion of the thread after the thread has terminated, which could put
> the application into an infinite loop.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-09 12:48:35 +02:00
Samuel Karp
9582dd10e1
Merge pull request #44267 from thaJeztah/pkg_loopback_xsysunix 2022-10-09 01:20:06 -07:00
Sebastiaan van Stijn
c7c02eea81
pkg/loopback: use ioctl helpers from x/sys/unix
Use the IoctlRetInt, IoctlSetInt and IoctlLoopSetStatus64 helper
functions defined in the golang.org/x/sys/unix package instead of
manually wrapping these using a locally defined function.

Inspired by 3cc3d8a560

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-08 21:20:29 +02:00
Sebastiaan van Stijn
6742f74e0e
vendor: golang.org/x/sys v0.0.0-20221006211917-84dc82d7e875
full diff: 3c1f35247d...84dc82d7e8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-08 21:19:33 +02:00
Sebastiaan van Stijn
c218211012
Merge pull request #44255 from thaJeztah/pkg_system_remove_GetExitCode
pkg/system: move GetExitCode() to pkg/idtools, and un-export
2022-10-07 18:10:03 +02:00
Sebastiaan van Stijn
e034b7b04d
Merge pull request #44253 from thaJeztah/pkg_sys_umask
pkg/system: remove Umask() utility
2022-10-07 17:25:52 +02:00
Samuel Karp
968a0bcd63
Merge pull request #43055 from thaJeztah/use_containerd_oci_devices_part2 2022-10-07 00:36:40 -07:00
Sebastiaan van Stijn
4347080b46
pkg/system: remove Umask() utility
It was only used in a couple of places, and in most places shouldn't be used
as those locations were in unix/linux-only files, so didn't need the wrapper.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-06 22:22:29 +02:00
Sebastiaan van Stijn
59c77c8f5b
Merge pull request #44250 from thaJeztah/fix_pkg_dir
pkg/directory: Size(): add back type-casts to account for platform differences
2022-10-06 21:44:46 +02:00
Sebastiaan van Stijn
1515e02c8a
Merge pull request #44215 from corhere/fix-unlockosthread-pdeathsig
Stop subprocesses from getting unexpectedly killed
2022-10-06 20:08:53 +02:00
Sebastiaan van Stijn
76ce3fd9c9
remove aliases for deprecated pkg/pubsub
The aliases are included in the 22 release branch, so we can remove them
from master.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-06 16:41:00 +02:00
Sebastiaan van Stijn
c1729f876c
remove aliases for deprecated pkg/fsutils
The aliases are included in the 22 release branch, so we can remove them
from master.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-06 02:51:24 +02:00
Sebastiaan van Stijn
ce2abb82c0
remove aliases for deprecated pkg/urlutil
The aliases are included in the 22 release branch, so we can remove them
from master.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-06 02:48:42 +02:00
Akihiro Suda
88c6ec40a4
Merge pull request #44258 from thaJeztah/bump_selinux
vendor: github.com/opencontainers/selinux v1.10.2
2022-10-06 07:36:12 +09:00
Sebastiaan van Stijn
a5e1baf3ab
vendor: github.com/opencontainers/selinux v1.10.2
full diff: https://github.com/opencontainers/selinux/compare/v1.10.1...v1.10.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-05 22:36:16 +02:00
Sebastiaan van Stijn
49940ab5ee
Merge pull request #44216 from cpuguy83/volume_unnamed_label
Volume prune: only prune anonymous volumes by default
2022-10-05 19:34:47 +02:00
Cory Snider
1f22b15030 Lock OS threads when exec'ing with Pdeathsig
On Linux, when (os/exec.Cmd).SysProcAttr.Pdeathsig is set, the signal
will be sent to the process when the OS thread on which cmd.Start() was
executed dies. The runtime terminates an OS thread when a goroutine
exits after being wired to the thread with runtime.LockOSThread(). If
other goroutines are allowed to be scheduled onto a thread which called
cmd.Start(), an unrelated goroutine could cause the thread to be
terminated and prematurely signal the command. See
https://github.com/golang/go/issues/27505 for more information.

Prevent started subprocesses with Pdeathsig from getting signaled
prematurely by wiring the starting goroutine to the OS thread until the
subprocess has exited. No other goroutines can be scheduled onto a
locked thread so it will remain alive until unlocked or the daemon
process exits.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2022-10-05 12:18:03 -04:00
Brian Goff
a8b20ed105
Merge pull request #44252 from thaJeztah/deprecate_pkg_fsutil
pkg/fsutils: deprecate in favor of containerd/continuity/fs
2022-10-05 08:37:21 -07:00
Sebastiaan van Stijn
ab677c41ea
pkg/system: unconvert
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-05 16:21:04 +02:00
Sebastiaan van Stijn
07b1aa822c
pkg/system: move GetExitCode() to pkg/idtools, and un-export
This utility was only used in a single place, and had no external consumers.
Move it to where it's used.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-05 16:20:33 +02:00
Sebastiaan van Stijn
5b6b42162b
pkg/fsutils: deprecate in favor of containerd/continuity/fs
The pkg/fsutils package was forked in containerd, and later moved to
containerd/continuity/fs. As we're moving more bits to containerd, let's also
use the same implementation to reduce code-duplication and to prevent them from
diverging.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-05 11:36:04 +02:00
Sebastiaan van Stijn
0a861e68df
pkg/directory: Size(): add back type-casts to account for platform differences
I noticed the comment above this code, but didn't see a corresponding type-cast.
Looking at this file's history, I found that these were removed as part of
2f5f0af3fd, which looks to have overlooked some
deliberate type-casts.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-05 10:58:47 +02:00
Sebastiaan van Stijn
109eafc3f8
Merge pull request #44244 from thaJeztah/api_update_swagger_for_builder_version
docs: swagger: update description for default builder version
2022-10-05 10:56:02 +02:00
Sebastiaan van Stijn
974e4540bd
Merge pull request #44243 from thaJeztah/libnetwork_cleanup_outdated_comments
libnetwork: remove some outdated comments
2022-10-05 10:55:34 +02:00
Samuel Karp
d502ef0035
Merge pull request #44246 from thaJeztah/bump_go_1.19.2 2022-10-05 00:29:01 -07:00
Samuel Karp
e4a6520d6e
Merge pull request #44241 from austinvazquez/update-awslogs-doc 2022-10-05 00:27:54 -07:00
Brian Goff
618f26ccbc Volume prune: only prune anonymous volumes by default
This adds a new filter argument to the volume prune endpoint "all".
When this is not set, or it is a false-y value, then only anonymous
volumes are considered for pruning.

When `all` is set to a truth-y value, you get the old behavior.

This is an API change, but I think one that is what most people would
want.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-04 20:55:13 +00:00
Sebastiaan van Stijn
7b4e4c08b5
Update to go 1.19.2 to address CVE-2022-2879, CVE-2022-2880, CVE-2022-41715
From the mailing list:

We have just released Go versions 1.19.2 and 1.18.7, minor point releases.

These minor releases include 3 security fixes following the security policy:

- archive/tar: unbounded memory consumption when reading headers

  Reader.Read did not set a limit on the maximum size of file headers.
  A maliciously crafted archive could cause Read to allocate unbounded
  amounts of memory, potentially causing resource exhaustion or panics.
  Reader.Read now limits the maximum size of header blocks to 1 MiB.

  Thanks to Adam Korczynski (ADA Logics) and OSS-Fuzz for reporting this issue.

  This is CVE-2022-2879 and Go issue https://go.dev/issue/54853.

- net/http/httputil: ReverseProxy should not forward unparseable query parameters

  Requests forwarded by ReverseProxy included the raw query parameters from the
  inbound request, including unparseable parameters rejected by net/http. This
  could permit query parameter smuggling when a Go proxy forwards a parameter
  with an unparseable value.

  ReverseProxy will now sanitize the query parameters in the forwarded query
  when the outbound request's Form field is set after the ReverseProxy.Director
  function returns, indicating that the proxy has parsed the query parameters.
  Proxies which do not parse query parameters continue to forward the original
  query parameters unchanged.

  Thanks to Gal Goldstein (Security Researcher, Oxeye) and
  Daniel Abeles (Head of Research, Oxeye) for reporting this issue.

  This is CVE-2022-2880 and Go issue https://go.dev/issue/54663.

- regexp/syntax: limit memory used by parsing regexps

  The parsed regexp representation is linear in the size of the input,
  but in some cases the constant factor can be as high as 40,000,
  making relatively small regexps consume much larger amounts of memory.

  Each regexp being parsed is now limited to a 256 MB memory footprint.
  Regular expressions whose representation would use more space than that
  are now rejected. Normal use of regular expressions is unaffected.

  Thanks to Adam Korczynski (ADA Logics) and OSS-Fuzz for reporting this issue.

  This is CVE-2022-41715 and Go issue https://go.dev/issue/55949.

View the release notes for more information: https://go.dev/doc/devel/release#go1.19.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-04 20:41:45 +02:00
Sebastiaan van Stijn
271243d382
docs: swagger: update description for default builder version
Commit 7b153b9e28 updated the main
swagger file, but didn't update the v1.42 version used for the
documentation as it wasn't created yet at the time.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-04 18:58:18 +02:00
Sebastiaan van Stijn
c523d6d25c
libnetwork: remove some outdated comments
The corresponding "nolint" comments were removed in 2f1c382a6d,
but didn't remove these comments.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-04 15:34:39 +02:00
Austin Vazquez
6f435e0bb9 Update awslogs driver batching documentation.
Before this change, the awslogs collectBatch and processEvent
function documentation still referenced the batchPublishFrequency
constant which was removed in favor of the configurable log stream
forceFlushInterval member.

Signed-off-by: Austin Vazquez <macedonv@amazon.com>
2022-10-03 23:37:14 +00:00
Sebastiaan van Stijn
6c1df4f9c5
Merge pull request #43973 from thaJeztah/containerd_less_panics
containerd-integration: prefer error over panic where possible
2022-10-03 23:28:22 +02:00
Brian Goff
5607c4be00
Merge pull request #44231 from cpuguy83/fix_restore_volumerefs
Fix live-restore w/ restart policies + volume refs
2022-10-03 10:35:26 -07:00
Sebastiaan van Stijn
b14d203884
Merge pull request #44233 from thaJeztah/libnetwork_linting
libnetwork: fix some (linting) issues
2022-10-03 11:02:59 +02:00
Sebastiaan van Stijn
60ace31be0
libnetwork: sandbox.updateDNS(): use const for file permissions
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-02 01:28:05 +02:00
Sebastiaan van Stijn
f0be4d126d
libnetwork: use object-literal for some structs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-02 01:26:15 +02:00
Sebastiaan van Stijn
50a7c67363
libnetwork: fix some whitespace formatting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-02 01:26:14 +02:00
Sebastiaan van Stijn
481185fb8a
libnetwork/osl: fix GoDoc formatting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-10-02 01:26:14 +02:00