Commit Graph

110 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
Rob Murray
4b97831992 Merge pull request #50671 from mmorel-35/github.com/hashicorp/go-multierror
chore: use errors.Join instead of github.com/hashicorp/go-multierror
2025-08-08 19:40:36 +01:00
Matthieu MOREL
050fbbccca chore: use errors.Join instead of github.com/hashicorp/go-multierror
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 19:19:21 +02:00
Matthieu MOREL
96f8c6395e chore: enable use-any rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-08-08 17:07:07 +02:00
Austin Vazquez
b25b421f97 update to go1.24.6
Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>
2025-08-07 17:14:22 -05:00
Sebastiaan van Stijn
e30b8e3393 update golangci-lint settings
The github.com/docker/docker/reference package was moved to
github.com/moby/moby/v2/daemon/internal/refstore, so this
check no longer did anything (and no aliasing needed).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-08-05 17:32:31 +02:00
Paweł Gronowski
2dcd8b8def golangci: Replace old package name with moby/v2
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-08-04 16:35:44 +02:00
Derek McGowan
0abcdb7405 Update golangci for lazyregexp
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-24 12:21:11 -07:00
Sebastiaan van Stijn
b5d7d6c1e7 Merge pull request #50465 from thaJeztah/less_lazyregexp
remove uses of lazyregexp in tests, test-utilities and packages used externally
2025-07-21 22:49:30 +02:00
Sebastiaan van Stijn
f651a5d5e9 registry: remove uses of lazyregexp
This package is imported by the CLI; implement a more basic approach.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:24:46 +02:00
Sebastiaan van Stijn
b33b4bd290 internal/testutils/networking: rm uses of lazyregexp
It's not needed for test-utilities.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-21 21:24:13 +02:00
Sebastiaan van Stijn
a089c51160 pkg/idtools: remove deprecated functions and types
Remove;

- `MkdirAllAndChown`
- `MkdirAndChown`
- `MkdirAllAndChownNew`
- `GetRootUIDGID`
- `FromUserIdentityMapping`
- `ToUserIdentityMapping`
- `CurrentIdentity`
- `IdentityMapping`
- `Identity.Chown`
- `IDMap`

Also remove the temporary consts that were previously in use by BuildKit;

- `SeTakeOwnershipPrivilege`
- `ContainerAdministratorSidString`
- `ContainerUserSidString`

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-20 23:06:16 +02:00
Paweł Gronowski
0a047e825c update to go1.24.5
- https://github.com/golang/go/issues?q=milestone%3AGo1.24.5+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.4...go1.24.5

This minor releases include 1 security fixes following the security policy:

- cmd/go: unexpected command execution in untrusted VCS repositories

    Various uses of the Go toolchain in untrusted VCS repositories can result in
    unexpected code execution. When using the Go toolchain in directories fetched
    using various VCS tools (such as directly cloning Git or Mercurial repositories)
    can cause the toolchain to execute unexpected commands, if said directory
    contains multiple VCS configuration metadata (such as a '.hg' directory in a Git
    repository). This is due to how the Go toolchain attempts to resolve which VCS
    is being used in order to embed build information in binaries and determine
    module versions.

    The toolchain will now abort attempting to resolve which VCS is being used if it
    detects multiple VCS configuration metadata in a module directory or nested VCS
    configuration metadata (such as a '.git' directoy in a parent directory and a
    '.hg' directory in a child directory). This will not prevent the toolchain from
    building modules, but will result in binaries omitting VCS related build
    information.

    If this behavior is expected by the user, the old behavior can be re-enabled by
    setting GODEBUG=allowmultiplevcs=1. This should only be done in trusted
    repositories.

    Thanks to RyotaK (https://ryotak.net) of GMO Flatt Security Inc for reporting
    this issue.

    This is CVE-2025-4674 and https://go.dev/issue/74380.

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

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-07-08 19:21:37 +02:00
Sebastiaan van Stijn
0683bc6355 fix some inconsistency in import aliases
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-01 21:48:26 +02:00
Sebastiaan van Stijn
650ab23785 Merge pull request #49920 from mmorel-35/fix-nakedret
pluginrpc-gen: align generator with generated
2025-06-30 12:18:27 +02:00
Matthieu MOREL
6b8afec95b fix redefines-builtin-id from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:45 +00:00
Matthieu MOREL
90ab64cbda fix increment-decrement from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:38 +00:00
Matthieu MOREL
381d9d0723 fix use-errors-new from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:38 +00:00
Matthieu MOREL
f0136d1dba fix superfluous-else from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:38 +00:00
Matthieu MOREL
369c8f828e fix var-declaration from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-26 12:07:24 +00:00
Matthieu MOREL
b40fe5cb8b pluginrpc-gen: align generator with generated
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-25 07:51:37 +02:00
Sebastiaan van Stijn
b7ef527bdc pkg/idtools: deprecate IdentityMapping, Identity.Chown
The IdentityMapping and Identity types are still used internally, but
should be considered transitional.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-06-16 17:38:40 +02:00
Matthieu MOREL
6d737371b8 fix comparison rule from errorlint
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-13 08:26:56 +00:00
Matthieu MOREL
20b6075380 fix badCall from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-08 09:02:11 +02:00
Matthieu MOREL
c466ae0f71 fix badLock from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
19f5ac3c81 fix initClause from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
aa632664b6 fix mapKey from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
5ad4e4edf7 fix deprecatedComment from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
b8a4f6534f fix stringsCompare and stringConcatSimplify from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
a62de57aa1 fix sprintfQuotedString from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
bc9ec5fc02 fix emptyStringTest from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:59 +02:00
Matthieu MOREL
469afa5f8f fix httpNoBody from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Matthieu MOREL
8f7faa01d1 fix boolExprSimplify from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Matthieu MOREL
e5be7b54b1 fix yodaStyleExpr from go-critic
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Matthieu MOREL
64075850fc fix go-critic linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-07 09:57:58 +02:00
Paweł Gronowski
1603ad636e update to go1.24.4
- https://github.com/golang/go/issues?q=milestone%3AGo1.24.4+label%3ACherryPickApproved
- full diff: https://github.com/golang/go/compare/go1.24.3...go1.24.4

This release includes 3 security fixes following the security policy:

- net/http: sensitive headers not cleared on cross-origin redirect

    Proxy-Authorization and Proxy-Authenticate headers persisted on cross-origin redirects potentially leaking sensitive information.

    Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue.

    This is CVE-2025-4673 and Go issue https://go.dev/issue/73816.

- os: inconsistent handling of O_CREATE|O_EXCL on Unix and Windows

    os.OpenFile(path, os.O_CREATE|O_EXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with O_CREATE and O_EXCL flags never follows symlinks. On Windows, when the target path was a symlink to a nonexistent location, OpenFile would create a file in that location.

    OpenFile now always returns an error when the O_CREATE and O_EXCL flags are both set and the target path is a symlink.

    Thanks to Junyoung Park and Dong-uk Kim of KAIST Hacking Lab for discovering this issue.

    This is CVE-2025-0913 and Go issue https://go.dev/issue/73702.

- crypto/x509: usage of ExtKeyUsageAny disables policy validation

    Calling Verify with a VerifyOptions.KeyUsages that contains ExtKeyUsageAny unintentionally disabledpolicy validation. This only affected certificate chains which contain policy graphs, which are rather uncommon.

    Thanks to Krzysztof Skrzętnicki (@Tener) of Teleport for reporting this issue.

    This is CVE-2025-22874 and Go issue https://go.dev/issue/73612.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-06-06 19:35:32 +02:00
Matthieu MOREL
9b5d8cd186 fix thelper linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-06-05 21:42:05 +00:00
Matthieu MOREL
637e8142ce clean up golangci-lint config for deprectated errdefs.*
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-28 05:42:45 +00:00
Sebastiaan van Stijn
48733b0751 Merge pull request #47883 from dmcgowan/errdefs-check-containerd
Update errdefs package to use containerd/errdefs
2025-05-16 18:20:41 +02:00
Paweł Gronowski
c04dec1143 Merge pull request #49998 from thaJeztah/fix_linting
daemon: startIngressWorker: fix S1000: should use for range (staticcheck)
2025-05-16 11:44:56 +00:00
Matthieu MOREL
205ba05feb fix usestdlibvars
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-15 18:24:58 +02:00
Derek McGowan
a90a9d899b Ignore deprecations for internal errdefs package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-05-15 08:05:50 -07:00
Sebastiaan van Stijn
68e025a11b daemon: startIngressWorker: fix S1000: should use for range (staticcheck)
daemon/network.go:156:3: S1000: should use for range instead of for { select {} } (staticcheck)
            for {
            ^

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-15 14:49:34 +02:00
Matthieu MOREL
7b5d2b4ec3 chore: bump golangci-lint to v2
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-15 10:00:16 +02:00
Sebastiaan van Stijn
e991c7185d update to go1.24.3
release notes: https://go.dev/doc/go1.24

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-05-12 10:31:00 +02:00
Sebastiaan van Stijn
42d149e45d fix duplicate import, and force consistent alias for bolt
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-22 11:31:10 +02:00
Sebastiaan van Stijn
d8a5e8928b replace uses of idtools.MkdirAllAndChown, MkdirAllAndChownNew
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-09 12:04:42 +02:00
Sebastiaan van Stijn
d96d20d45f update golangci-lint exceptions
These are no longer needed since d0154d3e59

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-09 12:00:50 +02:00
Derek McGowan
57a042b77c deprecate pkg/(chroot)archive for github.com/moby/go-archive
- pkg/archive: deprecate, and add aliases
  Keeping the tests in this commit; also moves various utilities
  into a _test.go file, as they were now only used in tests.
- pkg/chrootarchive: deprecate and add aliase
  deprecate pkg/archive and add aliases
  keeping the tests in this commit
- Add temporary exceptions for deprecation linting errors, because
  this commit is to verify everything works with the aliases.
- remove tests that depend on un-exported types

    === RUN   TestDisablePigz
    --- FAIL: TestDisablePigz (0.00s)
    panic: interface conversion: io.Reader is *archive.readCloserWrapper, not *archive.readCloserWrapper (types from different packages) [recovered]

- pkg/archive, pkg/chrootarchive: remove test files

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-04-08 10:56:58 -07:00
Sebastiaan van Stijn
79b22645fc Merge pull request #49737 from thaJeztah/bump_golang_1.23.8
update to go1.23.8 (fix CVE-2025-22871)
2025-04-05 11:00:11 +02:00