go1.20.3 (released 2023-04-04) includes security fixes to the go/parser, html/template, mime/multipart, net/http, and net/textproto packages, as well as bug fixes to the compiler, the linker, the runtime, and the time package. See the Go 1.20.3 milestone on our issue tracker for details: https://github.com/golang/go/issues?q=milestone%3AGo1.20.3+label%3ACherryPickApproved full diff: https://github.com/golang/go/compare/go1.20.2...go1.20.3 go1.19.8 (released 2023-04-04) includes security fixes to the go/parser, html/template, mime/multipart, net/http, and net/textproto packages, as well as bug fixes to the linker, the runtime, and the time package. See the Go 1.19.8 milestone on our issue tracker for details: https://github.com/golang/go/issues?q=milestone%3AGo1.19.8+label%3ACherryPickApproved full diff: https://github.com/golang/go/compare/go1.19.7...go1.19.8 Further details from the announcement on the mailing list: We have just released Go versions 1.20.3 and 1.19.8, minor point releases. These minor releases include 4 security fixes following the security policy: - go/parser: infinite loop in parsing Calling any of the Parse functions on Go source code which contains `//line` directives with very large line numbers can cause an infinite loop due to integer overflow. Thanks to Philippe Antoine (Catena cyber) for reporting this issue. This is CVE-2023-24537 and Go issue https://go.dev/issue/59180. - html/template: backticks not treated as string delimiters Templates did not properly consider backticks (`) as Javascript string delimiters, and as such did not escape them as expected. Backticks are used, since ES6, for JS template literals. If a template contained a Go template action within a Javascript template literal, the contents of the action could be used to terminate the literal, injecting arbitrary Javascript code into the Go template. As ES6 template literals are rather complex, and themselves can do string interpolation, we've decided to simply disallow Go template actions from being used inside of them (e.g. "var a = {{.}}"), since there is no obviously safe way to allow this behavior. This takes the same approach as github.com/google/safehtml. Template.Parse will now return an Error when it encounters templates like this, with a currently unexported ErrorCode with a value of 12. This ErrorCode will be exported in the next major release. Users who rely on this behavior can re-enable it using the GODEBUG flag jstmpllitinterp=1, with the caveat that backticks will now be escaped. This should be used with caution. Thanks to Sohom Datta, Manipal Institute of Technology, for reporting this issue. This is CVE-2023-24538 and Go issue https://go.dev/issue/59234. - net/http, net/textproto: denial of service from excessive memory allocation HTTP and MIME header parsing could allocate large amounts of memory, even when parsing small inputs. Certain unusual patterns of input data could cause the common function used to parse HTTP and MIME headers to allocate substantially more memory than required to hold the parsed headers. An attacker can exploit this behavior to cause an HTTP server to allocate large amounts of memory from a small request, potentially leading to memory exhaustion and a denial of service. Header parsing now correctly allocates only the memory required to hold parsed headers. Thanks to Jakob Ackermann (@das7pad) for discovering this issue. This is CVE-2023-24534 and Go issue https://go.dev/issue/58975. - net/http, net/textproto, mime/multipart: denial of service from excessive resource consumption Multipart form parsing can consume large amounts of CPU and memory when processing form inputs containing very large numbers of parts. This stems from several causes: mime/multipart.Reader.ReadForm limits the total memory a parsed multipart form can consume. ReadForm could undercount the amount of memory consumed, leading it to accept larger inputs than intended. Limiting total memory does not account for increased pressure on the garbage collector from large numbers of small allocations in forms with many parts. ReadForm could allocate a large number of short-lived buffers, further increasing pressure on the garbage collector. The combination of these factors can permit an attacker to cause an program that parses multipart forms to consume large amounts of CPU and memory, potentially resulting in a denial of service. This affects programs that use mime/multipart.Reader.ReadForm, as well as form parsing in the net/http package with the Request methods FormFile, FormValue, ParseMultipartForm, and PostFormValue. ReadForm now does a better job of estimating the memory consumption of parsed forms, and performs many fewer short-lived allocations. In addition, mime/multipart.Reader now imposes the following limits on the size of parsed forms: Forms parsed with ReadForm may contain no more than 1000 parts. This limit may be adjusted with the environment variable GODEBUG=multipartmaxparts=. Form parts parsed with NextPart and NextRawPart may contain no more than 10,000 header fields. In addition, forms parsed with ReadForm may contain no more than 10,000 header fields across all parts. This limit may be adjusted with the environment variable GODEBUG=multipartmaxheaders=. Thanks to Jakob Ackermann for discovering this issue. This is CVE-2023-24536 and Go issue https://go.dev/issue/59153. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
159 lines
5.8 KiB
YAML
159 lines
5.8 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- "release/**"
|
|
tags:
|
|
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- "release/**"
|
|
|
|
name: Release
|
|
|
|
env:
|
|
GO_VERSION: "1.20.3"
|
|
|
|
permissions: # added using https://github.com/step-security/secure-workflows
|
|
contents: read
|
|
|
|
jobs:
|
|
check:
|
|
name: Check Signed Tag
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 5
|
|
outputs:
|
|
stringver: ${{ steps.contentrel.outputs.stringver }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ github.ref }}
|
|
path: src/github.com/containerd/containerd
|
|
|
|
- name: Check signature
|
|
run: |
|
|
releasever=${{ github.ref }}
|
|
releasever="${releasever#refs/tags/}"
|
|
TAGCHECK=$(git tag -v ${releasever} 2>&1 >/dev/null) ||
|
|
echo "${TAGCHECK}" | grep -q "error" && {
|
|
echo "::error::tag ${releasever} is not a signed tag. Failing release process."
|
|
exit 1
|
|
} || {
|
|
echo "Tag ${releasever} is signed."
|
|
exit 0
|
|
}
|
|
working-directory: src/github.com/containerd/containerd
|
|
|
|
- name: Release content
|
|
id: contentrel
|
|
run: |
|
|
RELEASEVER=${{ github.ref }}
|
|
echo "stringver=${RELEASEVER#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
git tag -l ${RELEASEVER#refs/tags/} -n20000 | tail -n +3 | cut -c 5- >release-notes.md
|
|
working-directory: src/github.com/containerd/containerd
|
|
|
|
- name: Save release notes
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: containerd-release-notes
|
|
path: src/github.com/containerd/containerd/release-notes.md
|
|
|
|
build:
|
|
name: Build Release Binaries
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 30
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
# Ubuntu 22.04 can't be used until we drop support for binary compatibility with dynamically-linked glibc 2.17 (CentOS 7).
|
|
# https://github.com/containerd/containerd/issues/7255
|
|
# https://github.com/containerd/containerd/issues/7961
|
|
- dockerfile-ubuntu: 20.04
|
|
dockerfile-platform: linux/amd64
|
|
- dockerfile-ubuntu: 20.04
|
|
dockerfile-platform: linux/arm64
|
|
- dockerfile-ubuntu: 20.04
|
|
dockerfile-platform: linux/ppc64le
|
|
- dockerfile-ubuntu: 20.04
|
|
dockerfile-platform: linux/s390x
|
|
- dockerfile-ubuntu: 20.04
|
|
dockerfile-platform: linux/riscv64
|
|
- dockerfile-ubuntu: 20.04
|
|
dockerfile-platform: windows/amd64
|
|
steps:
|
|
- name: Set RELEASE_VER
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
shell: bash
|
|
run: |
|
|
releasever=${{ github.ref }}
|
|
releasever="${releasever#refs/tags/}"
|
|
echo "RELEASE_VER=${releasever}" >> $GITHUB_ENV
|
|
- name: Checkout containerd
|
|
uses: actions/checkout@v3
|
|
with:
|
|
# Intentionally use github.repository instead of containerd/containerd to
|
|
# make this action runnable on forks.
|
|
# See https://github.com/containerd/containerd/issues/5098 for the context.
|
|
repository: ${{ github.repository }}
|
|
ref: ${{ github.ref }}
|
|
path: src/github.com/containerd/containerd
|
|
|
|
- name: Setup buildx instance
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
use: true
|
|
- uses: crazy-max/ghaction-github-runtime@v2 # sets up needed vars for caching to github
|
|
- name: Make
|
|
shell: bash
|
|
run: |
|
|
cache="--cache-from=type=gha,scope=containerd-release --cache-to=type=gha,scope=containerd-release"
|
|
if [[ "${PLATFORM}" =~ "windows" ]]; then
|
|
# For Windows the cni build script generates a config but shells out to powershell (and also assume it is running on windows) to get a gateway and subnet.
|
|
# The values provided here are taken from packages that we previously generated.
|
|
export GATEWAY=172.21.16.1
|
|
export PREFIX_LEN=12
|
|
BUILD_ARGS="--build-arg GATEWAY --build-arg PREFIX_LEN"
|
|
fi
|
|
docker buildx build ${cache} --build-arg RELEASE_VER --build-arg UBUNTU_VERSION=${{ matrix.dockerfile-ubuntu }} --build-arg GO_VERSION ${BUILD_ARGS} -f .github/workflows/release/Dockerfile --platform=${PLATFORM} -o releases/ .
|
|
echo PLATFORM_CLEAN=${PLATFORM/\//-} >> $GITHUB_ENV
|
|
|
|
# Remove symlinks since we don't want these in the release Artifacts
|
|
find ./releases/ -maxdepth 1 -type l | xargs rm
|
|
working-directory: src/github.com/containerd/containerd
|
|
env:
|
|
PLATFORM: ${{ matrix.dockerfile-platform }}
|
|
- name: Save Artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: release-tars-${{env.PLATFORM_CLEAN}}
|
|
path: src/github.com/containerd/containerd/releases/*.tar.gz*
|
|
|
|
release:
|
|
name: Create containerd Release
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
permissions:
|
|
contents: write
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 10
|
|
needs: [build, check]
|
|
steps:
|
|
- name: Download builds and release notes
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
path: builds
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
fail_on_unmatched_files: true
|
|
name: containerd ${{ needs.check.outputs.stringver }}
|
|
draft: false
|
|
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
|
|
body_path: ./builds/containerd-release-notes/release-notes.md
|
|
files: |
|
|
builds/release-tars-**/*
|