update golang to 1.18.3
go1.18.3 (released 2022-06-01) includes security fixes to the crypto/rand,
crypto/tls, os/exec, and path/filepath packages, as well as bug fixes to the
compiler, and the crypto/tls and text/template/parse packages. See the Go
1.18.3 milestone on our issue tracker for details:
https://github.com/golang/go/issues?q=milestone%3AGo1.18.3+label%3ACherryPickApproved
Hello gophers,
We have just released Go versions 1.18.3 and 1.17.11, minor point releases.
These minor releases include 4 security fixes following the security policy:
- crypto/rand: rand.Read hangs with extremely large buffers
On Windows, rand.Read will hang indefinitely if passed a buffer larger than
1 << 32 - 1 bytes.
Thanks to Davis Goodin and Quim Muntal, working at Microsoft on the Go toolset,
for reporting this issue.
This is [CVE-2022-30634][CVE-2022-30634] and Go issue https://go.dev/issue/52561.
- crypto/tls: session tickets lack random ticket_age_add
Session tickets generated by crypto/tls did not contain a randomly generated
ticket_age_add. This allows an attacker that can observe TLS handshakes to
correlate successive connections by comparing ticket ages during session
resumption.
Thanks to GitHub user nervuri for reporting this.
This is [CVE-2022-30629][CVE-2022-30629] and Go issue https://go.dev/issue/52814.
- `os/exec`: empty `Cmd.Path` can result in running unintended binary on Windows
If, on Windows, `Cmd.Run`, `cmd.Start`, `cmd.Output`, or `cmd.CombinedOutput`
are executed when Cmd.Path is unset and, in the working directory, there are
binaries named either "..com" or "..exe", they will be executed.
Thanks to Chris Darroch, brian m. carlson, and Mikhail Shcherbakov for reporting
this.
This is [CVE-2022-30580][CVE-2022-30580] and Go issue https://go.dev/issue/52574.
- `path/filepath`: Clean(`.\c:`) returns `c:` on Windows
On Windows, the `filepath.Clean` function could convert an invalid path to a
valid, absolute path. For example, Clean(`.\c:`) returned `c:`.
Thanks to Unrud for reporting this issue.
This is [CVE-2022-29804][CVE-2022-29804] and Go issue https://go.dev/issue/52476.
[CVE-2022-30634]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30634
[CVE-2022-30629]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30629
[CVE-2022-30580]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-30580
[CVE-2022-29804]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-29804
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-06-02 03:14:47 -04:00
|
|
|
ARG GO_VERSION=1.18.3
|
2019-07-17 07:59:16 -04:00
|
|
|
|
|
|
|
FROM golang:${GO_VERSION}-alpine AS base
|
2019-09-11 03:36:53 -04:00
|
|
|
ENV GO111MODULE=off
|
2018-10-02 20:57:42 -04:00
|
|
|
RUN apk --no-cache add \
|
2017-09-08 10:43:04 -04:00
|
|
|
bash \
|
2017-11-03 05:09:06 -04:00
|
|
|
btrfs-progs-dev \
|
2017-09-08 10:43:04 -04:00
|
|
|
build-base \
|
|
|
|
curl \
|
|
|
|
lvm2-dev \
|
2018-10-02 20:57:42 -04:00
|
|
|
jq
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
RUN mkdir -p /build/
|
2017-09-08 10:43:04 -04:00
|
|
|
RUN mkdir -p /go/src/github.com/docker/docker/
|
|
|
|
WORKDIR /go/src/github.com/docker/docker/
|
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
FROM base AS frozen-images
|
|
|
|
# Get useful and necessary Hub images so we can "docker load" locally instead of pulling
|
|
|
|
COPY contrib/download-frozen-image-v2.sh /
|
|
|
|
RUN /download-frozen-image-v2.sh /build \
|
2021-08-19 17:40:38 -04:00
|
|
|
busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
|
|
|
|
busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 \
|
|
|
|
debian:bullseye-slim@sha256:dacf278785a4daa9de07596ec739dbc07131e189942772210709c5c0777e8437 \
|
|
|
|
hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 \
|
|
|
|
arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1
|
2020-12-16 08:53:49 -05:00
|
|
|
# See also frozenImages in "testutil/environment/protect.go" (which needs to be updated when adding images to this list)
|
2019-04-19 10:15:03 -04:00
|
|
|
|
2019-04-19 10:24:33 -04:00
|
|
|
FROM base AS dockercli
|
|
|
|
ENV INSTALL_BINARY_NAME=dockercli
|
|
|
|
COPY hack/dockerfile/install/install.sh ./install.sh
|
|
|
|
COPY hack/dockerfile/install/$INSTALL_BINARY_NAME.installer ./
|
|
|
|
RUN PREFIX=/build ./install.sh $INSTALL_BINARY_NAME
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:26:10 -04:00
|
|
|
# Build DockerSuite.TestBuild* dependency
|
|
|
|
FROM base AS contrib
|
|
|
|
COPY contrib/syscall-test /build/syscall-test
|
|
|
|
COPY contrib/httpserver/Dockerfile /build/httpserver/Dockerfile
|
|
|
|
COPY contrib/httpserver contrib/httpserver
|
|
|
|
RUN CGO_ENABLED=0 go build -buildmode=pie -o /build/httpserver/httpserver github.com/docker/docker/contrib/httpserver
|
|
|
|
|
|
|
|
# Build the integration tests and copy the resulting binaries to /build/tests
|
2019-04-19 10:24:33 -04:00
|
|
|
FROM base AS builder
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2017-09-12 08:53:20 -04:00
|
|
|
# Set tag and add sources
|
2019-04-19 10:20:24 -04:00
|
|
|
COPY . .
|
2019-04-27 00:38:55 -04:00
|
|
|
# Copy test sources tests that use assert can print errors
|
|
|
|
RUN mkdir -p /build${PWD} && find integration integration-cli -name \*_test.go -exec cp --parents '{}' /build${PWD} \;
|
|
|
|
# Build and install test binaries
|
2019-04-30 03:22:22 -04:00
|
|
|
ARG DOCKER_GITCOMMIT=undefined
|
2017-09-08 10:43:04 -04:00
|
|
|
RUN hack/make.sh build-integration-test-binary
|
2019-04-27 00:38:55 -04:00
|
|
|
RUN mkdir -p /build/tests && find . -name test.main -exec cp --parents '{}' /build/tests \;
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
## Generate testing image
|
2019-06-23 13:39:20 -04:00
|
|
|
FROM alpine:3.10 as runner
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:20:24 -04:00
|
|
|
ENV DOCKER_REMOTE_DAEMON=1
|
|
|
|
ENV DOCKER_INTEGRATION_DAEMON_DEST=/
|
|
|
|
ENTRYPOINT ["/scripts/run.sh"]
|
|
|
|
|
|
|
|
# Add an unprivileged user to be used for tests which need it
|
|
|
|
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
|
|
|
|
|
2017-09-08 10:43:04 -04:00
|
|
|
# GNU tar is used for generating the emptyfs image
|
2018-10-02 20:57:42 -04:00
|
|
|
RUN apk --no-cache add \
|
2017-09-08 10:43:04 -04:00
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
g++ \
|
|
|
|
git \
|
2021-08-19 15:16:01 -04:00
|
|
|
inetutils-ping \
|
2017-09-08 10:43:04 -04:00
|
|
|
iptables \
|
2021-08-19 15:16:01 -04:00
|
|
|
libcap2-bin \
|
2018-01-16 13:49:18 -05:00
|
|
|
pigz \
|
2017-09-08 10:43:04 -04:00
|
|
|
tar \
|
2018-10-02 20:57:42 -04:00
|
|
|
xz
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:20:24 -04:00
|
|
|
COPY hack/test/e2e-run.sh /scripts/run.sh
|
|
|
|
COPY hack/make/.ensure-emptyfs /scripts/ensure-emptyfs.sh
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:02:22 -04:00
|
|
|
COPY integration/testdata /tests/integration/testdata
|
|
|
|
COPY integration/build/testdata /tests/integration/build/testdata
|
|
|
|
COPY integration-cli/fixtures /tests/integration-cli/fixtures
|
2017-09-08 10:43:04 -04:00
|
|
|
|
2019-04-19 10:15:03 -04:00
|
|
|
COPY --from=frozen-images /build/ /docker-frozen-images
|
2019-04-19 10:24:33 -04:00
|
|
|
COPY --from=dockercli /build/ /usr/bin/
|
2019-04-19 10:26:10 -04:00
|
|
|
COPY --from=contrib /build/ /tests/contrib/
|
2019-04-27 00:38:55 -04:00
|
|
|
COPY --from=builder /build/ /
|