Commit Graph

54223 Commits

Author SHA1 Message Date
Paweł Gronowski
30406d42e3 update to go1.24.7
This includes 1 security fix:

- net/http: CrossOriginProtection bypass patterns are over-broad

    When passing patterns to CrossOriginProtection.AddInsecureBypassPattern,
    requests that would have redirected to those patterns (e.g. without a trailing
    slash) were also exempted, which might be unexpected.

    Thanks to Marco Gazerro for reporting this issue.

    This is CVE-2025-47910 and Go issue https://go.dev/issue/75054.

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-03 20:31:17 +02:00
Paweł Gronowski
1c220f2f3f Merge pull request #50885 from crazy-max/buildkit-0.24.0
vendor: update buildkit to v0.24.0
2025-09-03 20:26:50 +02:00
Austin Vazquez
e2e9f36c5f api/types/system: move SecurityOpt type and DecodeSecurityOptions to client
This change moves the `system.SecurityOpt` type and `system.DecodeSecurityOptions` function to the client and adds a set of unit tests to capture current implementation. This change also create a set of daemon backend copies for usage.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-03 12:49:06 -05:00
Kevin Alvarez
d47b0db4f9 vendor: update buildkit to v0.24.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-03 18:41:21 +02:00
Paweł Gronowski
2f15be1679 Merge pull request #50886 from austinvazquez/fix-vendoring-for-client-mod
fix: client vendor with config struct changes
2025-09-03 18:13:12 +02:00
Austin Vazquez
ca97d071b7 fix: client vendor with config struct changes
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-09-03 10:32:58 -05:00
Rob Murray
04e09bbfe6 Merge pull request #50845 from robmry/iterate_over_nftables_rules
nftables: iterate over rules
2025-09-03 16:29:48 +01:00
Albin Kerouanton
4021bd7947 Merge pull request #50864 from akerouanton/bridge-driver-config
libnet/d/bridge: Register: pass a Configuration struct
2025-09-03 16:20:38 +02:00
Austin Vazquez
50d281f074 Merge pull request #50847 from vvoland/client-config-opt
client: Migrate tests to use functional opts and extract `clientConfig`
2025-09-03 06:41:11 -07:00
Sebastiaan van Stijn
3c34c9d031 Merge pull request #50880 from akerouanton/fix-empty-pbs-slices-warning
daemon/srv/r/ctr: handlePortBindingsBC: fix warning
2025-09-03 14:50:32 +02:00
Sebastiaan van Stijn
4293b81f14 Merge pull request #50879 from thaJeztah/rm_contrib_udev
contrib: remove udev rules for hiding loopback devices
2025-09-03 12:46:54 +02:00
Sebastiaan van Stijn
37d6a1909b libcontainerd/remote: wrapError: don't convert c8d errdefs error
The moby codebase is now able to handle containerd errdefs errors directly
so there's no need to wrap a c8d "NotFound" error. We still need to look
if we can remove this function altogether; it's unclear what conditions
could result in the string-matching being needed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 12:31:57 +02:00
Sebastiaan van Stijn
36303969b9 libcontainerd/remote: container.NewTask: move vars to where used
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 12:31:53 +02:00
Albin Kerouanton
f37094ad4f libnet/d/bridge: CreateEndpoint: use d.config directly
newDriver, which creates a new instance of the bridge driver, is the
only place where the driver config field is set. So there's no need to
gate access to it with a mutex.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 12:10:16 +02:00
Albin Kerouanton
ae24edfc0d libnet/d/bridge: merge configure into newDriver
configure must be called every time newDriver is called... so merge them
together.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 12:10:16 +02:00
Albin Kerouanton
2436458227 libnet/d/bridge: Register: pass a Configuration struct
Libnetwork passes a map[string]any to the bridge driver's Register
function. This forces the daemon to convert its configuration into a
map, and the driver to convert that map back into a struct.

This is unnecessary complexity, and makes it harder to track down where
and how bridge driver configuration fields are set.

Refactor libnetwork to let the daemon register the bridge.Configuration
directly through a new option `OptionBridgeConfig`.

The bridge driver now takes a `Configuration` param that needs no
special treatment.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 12:10:10 +02:00
Albin Kerouanton
386a3a6bba libnet/config: mv config_{unsupported,windows}.go
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 12:08:24 +02:00
Albin Kerouanton
18f2e61d08 libnet/config: rm config_freebsd.go
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 12:08:24 +02:00
Paweł Gronowski
1733d00ef1 Merge pull request #48955 from thaJeztah/improve_TestConcurrentPush
integration-cli: TestConcurrentPush: refactor to improve failure logs
2025-09-03 11:54:18 +02:00
Sebastiaan van Stijn
e099f1e409 daemon: Daemon.ContainerExecStart: fix typo in log field
Changing it to `execID`, which is what's used in most/all other places.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 11:34:21 +02:00
Albin Kerouanton
6e512cc292 libnet/d/ipvlan: Register: remove unused config param
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:23:07 +02:00
Albin Kerouanton
459f4f431d libnet/d/macvlan: Register: remove unused config param
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:23:07 +02:00
Albin Kerouanton
43014a891b libnet/d/overlay: Register: remove unused config param
The overlaydrivers takes a config parameter, but actually never uses
it — drop it.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:23:07 +02:00
Albin Kerouanton
18efa5513d libnet: makeDriverConfig: drop support for label-based config
makeDriverConfig is written in such a way that it seems to support
label-based driver configuration. That is, you could hypothetically use
labels starting with `com.docker.network.driver.<driver-name>.` to
define the configuration of a driver.

These labels come from the Controller's `cfg.Labels` which are set by
the daemon through libnet's OptionLabels which takes the list of labels
set on the daemon through dockerd's --label flag, or the equivalent
daemon.json field.

However, the daemon forbids setting labels that start with
`com.docker.*`. For instance:

    label com.docker.network.driver.bridge.EnableProxy=false is not allowed: the namespaces com.docker.*, io.docker.*, and org.dockerproject.* are reserved for internal use

Hence, this is dead code — remove it.

Also, makeDriverConfig is checking if the Controller's cfg field is
nil... But the Controller struct is instantiated in a single place (i.e.
NewController) and it always set that field. Drop that nil check too.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:23:07 +02:00
Albin Kerouanton
1470048e00 libnet: remove drivers_freebsd.go
As it stands, libnetwork pkg can't be compiled on FreeBSD, so no need to
keep this file around.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:23:07 +02:00
Albin Kerouanton
4ea085187a libnet/d/bridge: export Configuration
Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:23:07 +02:00
Albin Kerouanton
7b75f355e5 daemon/srv/r/ctr: handlePortBindingsBC: fix warning
Commit 0ca7ac325 was merged before a review comment was addressed.

Update the warning message returned by handlePortBindingsBC to handle
the case where multiple empty port bindings slices are sent to the API.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-03 11:16:51 +02:00
Sebastiaan van Stijn
fbad7b568d libcontainerd/remote: task.Exec: log warning on cleanup failure
Not exactly sure what errors we can expect here if the process failed
to start, but logging as a warning instead of discarding won't do harm.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 11:00:11 +02:00
Sebastiaan van Stijn
e67b3b0b90 libcontainerd/remote: task.Exec: rename processID -> execID
This argument is set from ExecConfig.ID, which we refer to as "execID"
in most places; rename the argument to match that terminology.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 10:58:33 +02:00
Sebastiaan van Stijn
003e17ff5a libcontainerd/remote: task.Exec: preserve parent context during cleanup
Use `context.WithoutCancel()` to preserve the parent context during cleanup
instead of creating a new context. This still prevents context-cancellation
from terminating the cleanup, but makes sure that tracing and logging are
wired up; https://github.com/containerd/containerd/blob/v2.1.4/client/process.go#L232-L263

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 10:58:17 +02:00
Sebastiaan van Stijn
167b0e9ea6 libcontainerd/remote: task.Exec: make defer error-handling more explicit
Use a named output variable to more clearly indicate what error is being
checked, and scope `err` variables used in this function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 10:15:37 +02:00
Sebastiaan van Stijn
55c929c97f libcontainerd/remote: rename var that shadowed import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-03 09:58:48 +02:00
Sebastiaan van Stijn
abfe332072 Merge pull request #50874 from akerouanton/bc-empty-pbs-slices
daemon: backfill empty PBs slices for backward compat
2025-09-02 23:49:34 +02:00
Sebastiaan van Stijn
023ae2e218 contrib: remove udev rules for hiding loopback devices
This reverts commit dbb47f63ab, which
added these rules to hide loopback devices from udisks. These rules
were for devicemapper, which we no longer support, and use hard-coded
paths, making them not practical for other purposes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-02 23:30:07 +02:00
Sebastiaan van Stijn
44a5c7556e Merge pull request #50866 from akerouanton/remove-dummy-manager-netdrivers
libnet/drivers: rm dummy '*manager' drivers
2025-09-02 23:22:56 +02:00
Rob Murray
2edfe3768f Merge pull request #50877 from robmry/bump-minimum-go-version
Bump go.mod minimum-go-version to 1.24
2025-09-02 21:59:24 +01:00
Albin Kerouanton
0ca7ac3258 daemon: backfill empty PBs slices for backward compat
So far, on ContainerStart, the daemon was silently backfilling empty
PortBindings slices with a PortBinding with unspecified HostIP and
HostPort. This was done by github.com/docker/go-connections/nat.SortPortMap.

This backfilling doesn't make much sense, and we're trying to remove
that package. So, move the backfilling to the API server, keep it for
older API versions, deprecate it for API 1.52, and drop it for API 1.53
and above.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-02 22:45:04 +02:00
Albin Kerouanton
4d2a293ff3 libnet/drvapi: make NetworkAllocate optional
This method is only used by the cnmallocator to allocate Swarm-scoped
network resources. Its only concrete implementation is in the ovmanager.
Other network drivers are implementing it too to adhere to the
driverapi.Driver interface, but they all return a 'not implemented'
error.

Extract this method into a separate interface, and add a dedicated
RegisterNetworkAllocator to the driver registry. Update the cnmallocator
to load 'network allocators' instead of 'drivers'.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-02 21:55:03 +02:00
Albin Kerouanton
cbd04b6f08 libnet/cnmallocator: use a list of local netdrivers
The cnmallocator package has a map of supported network drivers which
are registered using a pkg-local driver registry. This registry is then
used to load drivers, and if they have a 'local' DataScope, they aren't
used for anything. Drivers with a 'global' DataScope are called to
allocate cluster-wide network resources.

Instantiating builtin network drivers may have unintended side-effects
(e.g. the bridge driver registers a callback that should run when
firewalld is reloaded), so libnetwork has dummy '*manager' drivers that
do nothing but carry the same Capability than the original driver they
masquerade.

Put 'local drivers' (e.g. those with DataScope 'local') into a separate
list that just contains drivers' name, and don't register them into the
cnmallocator's driver registry.

Remove all the dummy '*manager' drivers as they're not needed anymore.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
2025-09-02 21:53:50 +02:00
Rob Murray
478d1fc8ba Bump go.mod minimum-go-version to 1.24
Match the minor version of Go used in the dev container
(and therefore in CI).

Signed-off-by: Rob Murray <rob.murray@docker.com>
2025-09-02 18:59:19 +01:00
Sebastiaan van Stijn
269960a4c6 integration-cli: TestConcurrentPush: refactor to improve failure logs
This tests, when failing, only produced a non-informative "exit status 1",
which limits investigating why it failed.

This patch:

- Rewrites the parallel pushes to use an error-group, and asserts each
  push to get the failure output of the command.
- Simplifies the Dockerfile that's used for building the test-image,
  removing steps that were not needed for the test.
- Adds a cleanup step to make sure the images are deleted after the
  test, or if the test fails (although the test-suite should already
  handle this).

Before this, a failure looked like:

    make BIND_DIR=. TEST_FILTER='TestConcurrentPush' test-integration-cli
    === FAIL: arm64.integration-cli TestDockerRegistrySuite/TestConcurrentPush (5.49s)
        docker_cli_push_test.go:159: assertion failed: error is not nil: exit status 1: concurrent push failed with error: exit status 1
        check_test.go:476: [dfa779e71fdf8] daemon is not started
        --- FAIL: TestDockerRegistrySuite/TestConcurrentPush (5.49s)

With this patch applied:

    make BIND_DIR=. TEST_FILTER='TestConcurrentPush' test-integration-cli
    === FAIL: arm64.integration-cli TestDockerRegistrySuite/TestConcurrentPush (2.47s)
        docker_cli_push_test.go:156: assertion failed:
            Command:  /usr/local/cli-integration/docker push 127.0.0.1:5000/dockercli/busybox:push2nosuch
            ExitCode: 1
            Error:    exit status 1
            Stdout:   The push refers to repository 127.0.0.1:5000/dockercli/busybox

            Stderr:   tag does not exist: 127.0.0.1:5000/dockercli/busybox:push2nosuch

            Failures:
            ExitCode was 1 expected 0
            Expected no error
        docker_cli_push_test.go:160: assertion failed: error is not nil: exit status 1
        check_test.go:476: [db77ef03a8fd8] daemon is not started
        --- FAIL: TestDockerRegistrySuite/TestConcurrentPush (2.47s)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-09-02 09:51:14 -05:00
Austin Vazquez
4534924212 Merge pull request #50867 from vvoland/c8d-fix-history-nonative
c8d/history: Fix non-native platforms
2025-09-02 05:39:50 -07:00
Paweł Gronowski
8031b077bc gha/arm64: Setup qemu
Make it possible to build non-native images like the other
test-integration workflows

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 12:12:28 +02:00
Paweł Gronowski
64b8770d90 Merge pull request #50861 from akerouanton/firewalld-debug-logs
hack/dind-systemd: enable, collect firewalld debug logs
2025-09-02 11:32:11 +02:00
Paweł Gronowski
ce338dec81 integration/internal: Print Buildkit logs
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 11:14:57 +02:00
Paweł Gronowski
27fca93b65 c8d/history: Fix non-native platforms
When building a non-native platform, it's not unpacked by default.
History tries to read the disk usage of all the layer and it doesn't
handle missing snapshots gracefully.

This patch fixes this.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 11:12:00 +02:00
Paweł Gronowski
ad830a47af integration/internal: Handle Buildkit in GetImageIDFromBody
BuildKit emits some additional events during build and they are not
`build.Result` so don't fail if we encounter one.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-02 11:11:46 +02:00
Rob Murray
d2bb9bda29 Merge pull request #50870 from vvoland/windows-fix-layer-perm
graphdriver/windows: Potential fix for access denied
2025-09-02 09:17:57 +01:00
Sebastiaan van Stijn
0b772bd5da Merge pull request #50858 from tonistiigi/update-buildkit-v0.24.0-rc2
vendor: update buildkit to v0.24.0-rc2
2025-09-01 18:15:23 +02:00
Paweł Gronowski
f66f555ad4 graphdriver/windows: Potential fix for access denied
Use `winio.RunWithPrivileges` to get the privileges.
It's better because it also locks the Go runtime thread so if the Go
scheduler decides to run this code on a different thread, it will still
have the expected privileges.

A naive attempt at fixing an error experienced by Docker Desktop user
when using Windows containers:

```
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessUtilityVMImage \\?\C:\ProgramData\Docker\windowsfilter\<hash1>\UtilityVM: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash2>: Access is denied.
failed to register layer: re-exec error: exit status 1: output: hcsshim::ProcessBaseLayer \\?\C:\ProgramData\Docker\windowsfilter\<hash3>: Access is denied.
```

Unfortunately I can't reproduce the issue on a Windows VM, but this
definitely won't hurt.

At least, I verified that the daemon still works on Windows.

Inspired by: https://github.com/containerd/containerd/issues/8206

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-09-01 16:16:28 +02:00