Commit Graph
9856 Commits
Author SHA1 Message Date
Geoff Johnson 080366b31e Fix s3 InvalidRange error on canceled and resumed layer downloads
Signed-off-by: Geoff Johnson <gjohnson@seatgeek.com>
2026-11-03 13:11:18 -05:00
CrazyMax cbae181dd9 Merge pull request #7358 from crazy-max/test-git-submodule-file-protocol
source/git: test rejection of file-backed submodules
2026-11-03 15:01:08 +01:00
CrazyMax 9b33bb61c6 Merge pull request #7359 from crazy-max/forward-0.34.2-patches
forward v0.34.2 patches
2026-11-03 14:47:51 +01:00
CrazyMax 4f4579ee6f vendor: update fsutil to e075fd9305eb
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-11-03 14:03:34 +01:00
Tonis Tiigi 38693adac8 source/git: fix daemon panic on resolver cache poisoning
resolveMetadata stored its result into the resolver cache through
release(v) where v was a *Metadata. On a failed resolve or a cache
hit it set the pointer to nil, but passing a typed nil pointer as an
interface stores a non-nil value, so a nil *Metadata was cached for
that remote#ref. A later resolve of the same key read it back and
dereferenced nil, crashing buildkitd. Because the cache is shared
across the jobs on a solve state, an untrusted Dockerfile or frontend
could crash the daemon, and one build could poison another's.

Store an untyped nil instead, matching the HTTP source, so only a
successfully resolved Metadata is ever cached.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 4dd98355a71d79bdf93bd3456fda3a64847ce1de)
(cherry picked from commit c1399f7266310397f5615f4751147f886afff6d2)
(cherry picked from commit 16c6856432)
2026-11-03 14:01:52 +01:00
CrazyMax ed7c9781c9 source/git: test rejection of file-backed submodules
Verify that a permissive host Git config cannot enable file-backed
submodules in a remote build context, with and without keeping .git.
Confirm that an unrestricted Git checkout can fetch the same submodule
so the test checks protocol enforcement rather than an invalid fixture.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-11-03 11:53:13 +01:00
CrazyMax a53be3c2e7 Merge pull request #7356 from thaJeztah/bump_compress
vendor: github.com/klauspost/compress v1.20.2 (security)
2026-11-03 10:39:41 +01:00
Sebastiaan van Stijn 4607b618d4 vendor: github.com/klauspost/compress v1.20.2
includes a fix for CVE-2026-116591 / [GHSA-fpmh-frq8-7rj8]

full diff: https://github.com/klauspost/compress/compare/v1.20.1...v1.20.2

[GHSA-fpmh-frq8-7rj8]: https://github.com/klauspost/compress/security/advisories/GHSA-fpmh-frq8-7rj8

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-11-03 10:13:16 +01:00
CrazyMax c1cfdbd30b Merge pull request #7328 from thaJeztah/bump_stargz
vendor: github.com/containerd/stargz-snapshotter v0.19.1
2026-10-30 11:00:07 +01:00
CrazyMax 248827b67a Merge pull request #7336 from tonistiigi/fix-gateway-wait
gateway: wait for frontend before HTTP/2 handshake
2026-10-30 10:25:36 +01:00
CrazyMax f585256aa2 Merge pull request #7338 from tonistiigi/fix-sec-exporter-race
solver: fix race on merged edge secondary exporters
2026-10-30 10:25:17 +01:00
Sebastiaan van Stijn 2472fd7a35 vendor: github.com/containerd/stargz-snapshotter v0.19.1
full diff: https://github.com/containerd/stargz-snapshotter/compare/v0.18.2...v0.19.1

Includes fixes for;

- [CVE-2026-71482] / [GHSA-6q59-3mx3-jpgq]
- [CVE-2026-77395] / [GHSA-6j84-h5gg-w3gr]

[GHSA-6q59-3mx3-jpgq]: https://github.com/containerd/stargz-snapshotter/security/advisories/GHSA-6q59-3mx3-jpgq
[GHSA-6j84-h5gg-w3gr]: https://github.com/containerd/stargz-snapshotter/security/advisories/GHSA-6j84-h5gg-w3gr

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-29 23:04:14 +01:00
Sebastiaan van Stijn fcfd2537d4 vendor: github.com/containerd/stargz-snapshotter/estargz v0.19.1
no changes in vendored code

full diff: https://github.com/containerd/stargz-snapshotter/compare/estargz/v0.19.0...estargz/v0.19.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-29 23:04:14 +01:00
Sebastiaan van Stijn ca688aa1a7 vendor: github.com/hanwen/go-fuse/v2 v2.11.0
full diff: https://github.com/hanwen/go-fuse/compare/v2.8.0...v2.11.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-29 23:04:11 +01:00
CrazyMax cd8ee2441a Merge pull request #7327 from thaJeztah/bump_x_deps
vendor: update golang.org/x/* dependencies
2026-10-29 17:02:36 +01:00
Tonis Tiigi b94ff2bc54 solver: fix race on merged edge secondary exporters
When a job merged an edge into another, mergeTo appended the dependency
cache keys to the target edge's secondaryExporters on the scheduler
goroutine. Cache export reads the same slice through the exporter of a
result loaded from that edge, and runs outside the scheduler, e.g. for
build history provenance or cache export while another build is still
running and merging into the shared edge.

Guard secondaryExporters with a mutex and let ExportTo iterate over a
copy, so nested exports run without holding the lock.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-28 20:57:07 -07:00
Tonis Tiigi 6f8e518aa5 runcexecutor: increase container start timeout to 15 seconds
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-28 18:24:44 -07:00
Tonis Tiigi 44e8bc7a68 gateway: wait for frontend before HTTP/2 handshake
Wait for initial frontend data before starting ServeConn so
container startup does not consume the HTTP/2 preface timeout.
Close pipe descriptors on cancellation to unblock the wait.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-28 18:24:32 -07:00
CrazyMax c19b15f577 Merge pull request #7332 from tonistiigi/fix-commit-cancel
cache: avoid losing finalize commit on cancel
2026-10-28 16:24:33 +01:00
CrazyMax d5eb31c03b Merge pull request #7331 from tonistiigi/1027-update-fsutil
vendor: update fsutil to ca65610c2295
2026-10-28 11:52:19 +01:00
CrazyMax 55f04a2c9f Merge pull request #7325 from tonistiigi/race-fixes
data race and correctness fixes
2026-10-28 11:48:45 +01:00
Sebastiaan van Stijn bfcd3f1aa3 vendor: golang.org/x/net v0.61.0
- quic: properly check for allowed frame types in a packet

full diff: https://github.com/golang/net/compare/v0.60.0...v0.61.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:41 +01:00
Sebastiaan van Stijn 2d5664c31c vendor: golang.org/x/crypto v0.58.0
full diff: https://github.com/golang/crypto/compare/v0.57.0...v0.58.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:40 +01:00
Sebastiaan van Stijn ff60ce831e vendor: golang.org/x/text v0.43.0
- secure/bidirule: lazily precompute ASCII table
- unicode/bidi: avoid quadratic behavior in Paragraph.Order and Paragraph.Line

full diff: https://github.com/golang/text/compare/v0.42.0...v0.43.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:40 +01:00
Sebastiaan van Stijn 49b4661a5e vendor: golang.org/x/term v0.47.0
full diff: https://github.com/golang/term/compare/v0.46.0...v0.47.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:40 +01:00
Sebastiaan van Stijn 168a310f21 vendor: golang.org/x/sync v0.24.0
full diff: https://github.com/golang/sync/compare/v0.23.0...v0.24.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:40 +01:00
Sebastiaan van Stijn 1eb500d37f vendor: golang.org/x/mod v0.42.0
full diff: https://github.com/golang/mod/compare/v0.41.0...v0.42.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:40 +01:00
Sebastiaan van Stijn 7796528a9f vendor: golang.org/x/sys v0.49.0
- cpu: add amd64 v2/v3/v4 feature bits
- darwin: expose setpriority PRIO_DARWIN_* constants
- unix/darwin: add missing pwritev test case on darwin/arm64
- unix/darwin: add O_EXEC and O_SEARCH on darwin
- unix/darwin: pass fcntl data as unsafe.Pointer in FcntlF{lock,store} on darwin
- unix/linux: don't warn about closed stderr from child process
- unix/linux: unify ppc64x syscall wrappers
- unix: add listns syscall introduced in Linux 6.19
- unix: add Mmsghdr for linux
- unix: add PrctlArg5Ptr
- unix: align the getdents buffer
- unix: extend z/OS support
- unix: keep generated types compilable with current cgo
- unix: pass xattr data as unsafe.Pointer in BSD xattr syscalls
- unix: provide linux/sparc64 assembly for syscalls
- unix: return syscall error in *listxattrNS on BSD
- unix: update glibc to 2.44
- unix: update linux to v7.2
- unix: use the stat64 family and fix Stat_t on linux/sparc64
- windows: drop arm

full diff: https://github.com/golang/sys/compare/v0.48.0...v0.49.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-28 11:02:40 +01:00
Tonis Tiigi b11ba3d44e llbsolver: serialize provenance predicate access
When a build has several exporters, runExporters runs them in parallel
and each one calls the same provenance attestation ContentFunc. Every
call finalized the shared ProvenanceCreator predicate (FinishedOn,
Layers, SysUsage, CompatibilityVersion) while another exporter could be
JSON-encoding it, which the race detector reports as a data race.

Add PredicateJSON, which finalizes and encodes the predicate under a
per-creator mutex and returns the encoded bytes, so no caller keeps a
reference to the shared predicate. Make Predicate unexported so all
callers go through the locked path.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:56:01 -07:00
Tonis Tiigi a868d25987 containerdexecutor: fix race on err in event loops
The resize and signal goroutines in runProcess both assigned the err
variable of the enclosing function, so concurrent Resize and Signal
calls on a process raced, and either goroutine could log the other's
error. Use a local error in each goroutine.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:55:53 -07:00
Tonis Tiigi 5f6d366632 llbsolver: release exec error refs after discard
resultProxy.loadResult added the refs of a failed exec to errResults
without holding rp.mu, and borrowed the ExecError so its finalizer would
not release them. If the proxy was released while the load was still
running, for example by the gateway forwarder discarding a lazy ref
whose ReadFile was evaluating it, Release had already run and the refs
were never released. They stayed in use until the daemon restarted, and
prune could not remove them.

Check rp.released under rp.mu after the load and release the refs
right away if the proxy is already gone.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:55:53 -07:00
Tonis Tiigi 4af257bc9a solver: check job membership by key in TestStaleEdgeMerge
require.Contains on a map[*Job]struct{} compares the job with every key
using reflect.DeepEqual, which dereferences other jobs and reads their
live progress state while its goroutines run. This raced under -race.
Check membership with a map lookup instead.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:55:53 -07:00
Tonis Tiigi b190bef7d3 progress: make writer closed flag atomic
progressWriter.Close set done while other goroutines could still be
writing to the writer, for example a shared vertex writing its snapshot
into the progress of a job that is finishing. Write read the flag
without synchronization. Make done an atomic.Bool.

Add a test that closes a writer while it is being written to; it
reports the race under -race without the fix.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:55:53 -07:00
Tonis Tiigi 87e6fb7cd0 llbsolver: synchronize ExecError borrow flag
The ExecError of a failed exec is cached by the shared op and returned
to every build that shares the vertex. Each resultProxy then set
OwnerBorrowed on the same error concurrently, which races. Add
ExecError.Borrow that sets the flag under a mutex and use it from
loadResult, Release and the finalizer. Ref ownership is unchanged.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:55:53 -07:00
Tonis Tiigi df10cbfc95 cache: avoid losing finalize commit on cancel
On the containerd worker the snapshotter is a gRPC client. If a build
is cancelled while finalize is committing a lazy ref, containerd can
apply the commit while the client returns Canceled. finalize then
deleted the lease protecting the committed snapshot and kept
equalMutable, so the record pointed at a mutable snapshot that no
longer existed. Every later build using the record failed with "failed
to stat active key during commit: snapshot ... does not exist" until
the daemon restarted.

Run finalize without cancellation so the commit result is not lost. If
Commit still returns an error, check whether the target snapshot was
committed and, if so, complete the finalize. Keep the lease when that
cannot be determined.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:07:02 -07:00
Tonis Tiigi 1e1de658cd vendor: update fsutil to ca65610c2295
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-27 22:05:33 -07:00
Tõnis Tiigi 6d392427ee Merge pull request #7318 from infosiftr/expose-history
Fix `EXPOSE` history to be valid syntax
2026-10-27 22:02:10 -07:00
Tõnis Tiigi dfa0ec11ab Merge pull request #7326 from thaJeztah/bump_x_net
vendor: golang.org/x/net v0.60.0
2026-10-27 22:00:50 -07:00
Tõnis Tiigi c43cdd0300 Merge pull request #7330 from crazy-max/docs-frontend-overview
readme: improve the frontend overview
2026-10-27 22:00:00 -07:00
CrazyMax 86c5ad7363 readme: refresh and expand the frontend overview
Give frontends a dedicated section with short descriptions to help readers
compare build languages and tools, including Docker Sandbox Kit.

Remove the unavailable JSON Gateway, refresh moved links, and note that
Earthly is no longer actively maintained.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-10-27 15:53:50 +01:00
Sebastiaan van Stijn ae979d58fe vendor: golang.org/x/net v0.60.0
Includes fixes for;

- CVE-2026-78659 / [GO-2026-6603]
- CVE-2026-78660 / [GO-2026-6610]
- CVE-2026-78669 / [GO-2026-6611]
- CVE-2026-78663 / [GO-2026-6612]
- CVE-2026-97032 / [GO-2026-6617]

full diff: full diff: https://github.com/golang/net/compare/v0.59.0...v0.60.0

[GO-2026-6603]: https://pkg.go.dev/vuln/GO-2026-6603
[GO-2026-6610]: https://pkg.go.dev/vuln/GO-2026-6610
[GO-2026-6611]: https://pkg.go.dev/vuln/GO-2026-6611
[GO-2026-6612]: https://pkg.go.dev/vuln/GO-2026-6612
[GO-2026-6617]: https://pkg.go.dev/vuln/GO-2026-6617

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-10-27 10:02:16 +01:00
CrazyMax 892eaeac95 Merge pull request #7205 from thaJeztah/bump_go_winio
vendor: github.com/Microsoft/go-winio v0.6.3
2026-10-27 09:47:43 +01:00
Tõnis Tiigi 7ce6ee1065 Merge pull request #7322 from tonistiigi/fixes-data-races
Fixes for data races.
2026-10-26 14:16:22 -07:00
Tõnis Tiigi afaf5b752b Merge pull request #7312 from tonistiigi/fix-cache-deps-match
solver: fix matching alternative cache input keys
2026-10-26 12:15:00 -07:00
CrazyMax aa93d79433 Merge pull request #7321 from moby/dependabot/github_actions/docker/login-action-4.7.0
build(deps): bump docker/login-action from 4.6.0 to 4.7.0
2026-10-26 16:36:22 +01:00
CrazyMax aff22aaa7d solver: synchronize index IDs with cache tracing
Protect index ID assignment with the cache-key mutex used by trace readers.
Add a concurrent regression test that fails under the race detector.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-10-26 16:14:24 +01:00
Tonis Tiigi 5225f50f0b dockerfile: wait for ssh-agent before reading its output
testSSHFileDescriptorsClosed read ssh-agent's stderr buffer while the
agent was still running and os/exec's copy goroutine was writing to
it, which races when the test binary is built with -race. Kill the
agent and Wait for it before reading; Wait guarantees the copy has
finished and the full output is available.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-25 20:08:26 -07:00
Tonis Tiigi a8594fca77 client: lock gateway exec test output buffer
testPrompt polled the container output bytes.Buffer with String() while
the gateway client's output goroutine wrote to the same buffer, which
races when the test binary is built with -race. Wrap the buffer in a
small mutex-protected writer shared by the output streams and the
prompt.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-25 20:08:26 -07:00
Tonis Tiigi 2efe98b13a executor: make resolv.conf generation flags atomic
GetResolvConf read and wrote the package-level notFirstRun and
lastNotEmpty flags inside its flightcontrol callback. flightcontrol
only serializes calls with the same key, so calls for different roots,
or for resolv.conf and resolv-host.conf at once, raced on them. Make
both flags atomic.Bool; the sequential behavior is unchanged.

Add a test that generates resolv.conf for several roots concurrently;
it reports the race under -race without the fix.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-25 20:08:26 -07:00
Tonis Tiigi 8c78c7128f cache: synchronize isDead check in getRecord
getRecord checked rec.isDead() holding only cm.mu, while finalize
updates equalMutable and the mutable's dead flag under the record
mutex, so a concurrent Get and Finalize of a lazily committed ref
raced. Take the record mutex for the check; lock order stays cm.mu
then record mutex, as in get().

Records restored from metadata also did not follow the rule that
records sharing data share a mutex: the immutable got a new mutex
instead of the equal mutable's, as mutableRef.commit does. Share it,
so finalize and lookups of the mutable synchronize after a restart.

Add tests for both cases; they report the races under -race without
the fix.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-10-25 20:08:26 -07:00