Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to go1.23.6 #340

Merged
merged 3 commits into from
Feb 27, 2025
Merged

update to go1.23.6 #340

merged 3 commits into from
Feb 27, 2025

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 24, 2024

Makefile: set CGO_LDFLAGS=-latomic on arm/v6

Compiling with Go >= 1.22 on arm/v6 is failing with the following error
message:

27.84 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]

For these Go versions, we need to manually link to libatomic as arm/v6
does not support atomic intrinsics and neither the CGo, nor the C
toolchain automatically link to that library.

update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336)

go1.22.11 (released 2025-01-16) includes security fixes to the crypto/x509 and
net/http packages, as well as bug fixes to the runtime. See the Go 1.22.11
milestone on our issue tracker for details.

Hello gophers,

We have just released Go versions 1.23.5 and 1.22.11, minor point releases.

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

  • crypto/x509: usage of IPv6 zone IDs can bypass URI name constraints

    A certificate with a URI which has a IPv6 address with a zone ID may
    incorrectly satisfy a URI name constraint that applies to the certificate
    chain.

    Certificates containing URIs are not permitted in the web PKI, so this
    only affects users of private PKIs which make use of URIs.

    Thanks to Juho Forsén of Mattermost for reporting this issue.

    This is CVE-2024-45341 and Go issue https://go.dev/issue/71156.

  • net/http: sensitive headers incorrectly sent after cross-domain redirect

    The HTTP client drops sensitive headers after following a cross-domain redirect.
    For example, a request to a.com/ containing an Authorization header which is
    redirected to b.com/ will not send that header to b.com.

    In the event that the client received a subsequent same-domain redirect, however,
    the sensitive headers would be restored. For example, a chain of redirects from
    a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization
    header to b.com/2.

    Thanks to Kyle Seely for reporting this issue.

    This is CVE-2024-45336 and Go issue https://go.dev/issue/70530.

update to go1.23.6

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah self-assigned this Oct 24, 2024
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.92%. Comparing base (1041211) to head (a767624).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #340      +/-   ##
==========================================
- Coverage   50.54%   49.92%   -0.62%     
==========================================
  Files           9       13       +4     
  Lines         645      653       +8     
==========================================
  Hits          326      326              
- Misses        273      281       +8     
  Partials       46       46              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thaJeztah
Copy link
Member Author

Looks like CGO is unhappy with some things;

 > [linux/amd64->arm/v6 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
0.568 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION=v0.8.2-6-gafc81a0 REVISION=afc81a08baa99a4edcb010b689b59620d9977137 DESTDIR=/out
0.595 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
25.69 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
27.84 # runtime/cgo
27.84 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:47:6: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:49:10: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:69:9: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:71:3: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.85 make: *** [Makefile:27: build-secretservice] Error 1

@crazy-max
Copy link
Member

Looks like CGO is unhappy with some things;

 > [linux/amd64->arm/v6 build-linux 1/1] RUN --mount=type=bind,target=.     --mount=type=cache,target=/root/.cache     --mount=type=cache,target=/go/pkg/mod     --mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
0.568 + make build-pass build-secretservice PACKAGE=github.com/docker/docker-credential-helpers VERSION=v0.8.2-6-gafc81a0 REVISION=afc81a08baa99a4edcb010b689b59620d9977137 DESTDIR=/out
0.595 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-pass" -o "/out/docker-credential-pass" ./pass/cmd/
25.69 go build -trimpath -ldflags="-s -w -X github.com/docker/docker-credential-helpers/credentials.Version=v0.8.2-6-gafc81a0 -X github.com/docker/docker-credential-helpers/credentials.Revision=afc81a08baa99a4edcb010b689b59620d9977137 -X github.com/docker/docker-credential-helpers/credentials.Package=github.com/docker/docker-credential-helpers -X github.com/docker/docker-credential-helpers/credentials.Name=docker-credential-secretservice" -o "/out/docker-credential-secretservice" ./secretservice/cmd/
27.84 # runtime/cgo
27.84 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:47:6: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:49:10: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:69:9: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.84 gcc_libinit.c:71:3: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]
27.85 make: *** [Makefile:27: build-secretservice] Error 1

I think we need to set CGO_CFLAGS to -Wno-atomic-alignment

@thaJeztah thaJeztah changed the title update to go1.22.8 update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336) Jan 20, 2025
Makefile Outdated
Comment on lines 12 to 19
# prevent warnings; see https://github.com/docker/docker-credential-helpers/pull/340#issuecomment-2437593837
# gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment]
export CGO_CFLAGS = -Wno-atomic-alignment

# 10.11 is the minimum supported version for osxkeychain
export MACOSX_DEPLOYMENT_TARGET = 10.11
ifeq "$(shell go env GOOS)" "darwin"
export CGO_CFLAGS = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
export CGO_CFLAGS = $(CGO_CFLAGS) -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah; that trick didn't work;

Makefile:19: *** Recursive variable `CGO_CFLAGS' references itself (eventually).  Stop.
mkdir -p ./bin
Error: Process completed with exit code 2.

@thaJeztah
Copy link
Member Author

booh; still no dice, but different error now 😢

mount=type=bind,source=/tmp/.version,target=/tmp/.version,from=version     --mount=type=bind,source=/tmp/.revision,target=/tmp/.revision,from=version <<EOT (set -ex...):
35.66 ld.lld: error: undefined symbol: __atomic_store_4
35.66 >>> referenced by gcc_libinit.c
35.66 >>>               /tmp/go-link-621867206/000007.o:(_cgo_wait_runtime_init_done)
35.66 >>> referenced by gcc_libinit.c
35.66 >>>               /tmp/go-link-621867206/000007.o:(x_cgo_notify_runtime_init_done)
35.66 >>> referenced by gcc_libinit.c
35.66 >>>               /tmp/go-link-621867206/000007.o:(x_cgo_set_context_function)
35.66 clang: error: linker command failed with exit code 1 (use -v to see invocation)
35.66 
35.69 make: *** [Makefile:31: build-secretservice] Error 1

@thaJeztah thaJeztah force-pushed the bump_golang_1.22.8 branch 2 times, most recently from a637ac3 to 26ce9a9 Compare February 27, 2025 14:05
@thaJeztah thaJeztah marked this pull request as draft February 27, 2025 14:05
@thaJeztah
Copy link
Member Author

Pushed a commit to try what go1.23.6 does

akerouanton and others added 3 commits February 27, 2025 23:39
Compiling with Go >= 1.22 on arm/v6 is failing with the following error
message:

27.84 gcc_libinit.c:44:8: error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0  bytes) [-Werror,-Watomic-alignment]

For these Go versions, we need to manually link to libatomic as arm/v6
does not support atomic intrinsics and neither the CGo, nor the C
toolchain automatically link to that library.

Signed-off-by: Albin Kerouanton <albinker@gmail.com>
go1.22.11 (released 2025-01-16) includes security fixes to the crypto/x509 and
net/http packages, as well as bug fixes to the runtime. See the Go 1.22.11
milestone on our issue tracker for details.

- https://github.com/golang/go/issues?q=milestone%3AGo1.22.11+label%3ACherryPickApproved
- full diff: golang/go@go1.22.10...go1.22.11

Hello gophers,

We have just released Go versions 1.23.5 and 1.22.11, minor point releases.

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

- crypto/x509: usage of IPv6 zone IDs can bypass URI name constraints

  A certificate with a URI which has a IPv6 address with a zone ID may
  incorrectly satisfy a URI name constraint that applies to the certificate
  chain.

  Certificates containing URIs are not permitted in the web PKI, so this
  only affects users of private PKIs which make use of URIs.

  Thanks to Juho Forsén of Mattermost for reporting this issue.

  This is CVE-2024-45341 and Go issue https://go.dev/issue/71156.

- net/http: sensitive headers incorrectly sent after cross-domain redirect

  The HTTP client drops sensitive headers after following a cross-domain redirect.
  For example, a request to a.com/ containing an Authorization header which is
  redirected to b.com/ will not send that header to b.com.

  In the event that the client received a subsequent same-domain redirect, however,
  the sensitive headers would be restored. For example, a chain of redirects from
  a.com/, to b.com/1, and finally to b.com/2 would incorrectly send the Authorization
  header to b.com/2.

  Thanks to Kyle Seely for reporting this issue.

  This is CVE-2024-45336 and Go issue https://go.dev/issue/70530.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah changed the title update to go1.22.11 (fix CVE-2024-45341, CVE-2024-45336) update to go1.23.6 Feb 27, 2025
@thaJeztah thaJeztah marked this pull request as ready for review February 27, 2025 22:42
Copy link
Member Author

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @akerouanton ! I swapped the order of commits, and rebased

LGTM

@thaJeztah thaJeztah merged commit 4e957ec into docker:master Feb 27, 2025
12 checks passed
@thaJeztah thaJeztah deleted the bump_golang_1.22.8 branch February 27, 2025 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants