Commit Graph
9871 Commits
Author SHA1 Message Date
Tõnis Tiigi 86cdec9ddc Merge pull request #7258 from astokes-docker/source-http-retry
source/http: retry transient request failures
2026-11-03 19:59:29 -08:00
Tõnis Tiigi 54ab11c4dc Merge pull request #7361 from gajohnson/s3-resume-invalid-range
s3: fix resuming interrupted cache downloads
2026-11-03 16:57:31 -08:00
Tõnis Tiigi 513ad39ae8 Merge pull request #7264 from janwaleed09/fix-contenthash-orphans
cache: fix content hash leak for removed records
2026-11-03 15:53:50 -08:00
Tõnis Tiigi 37e92c7720 Merge pull request #7187 from crazy-max/fix-local-cache-ingest-locking
solve: lock local cache ingests across clients
2026-11-03 12:20:20 -08:00
Adam Stokes ec5a999673 source/http: do not retry the best-effort HEAD request
The HEAD request in resolveMetadataRef is an optimization that servers
are not required to support. Its error is already ignored and the code
falls through to the GET, which is retried.

Retrying the HEAD adds nothing, since the GET covers the same failures,
and costs up to ~7s of backoff before the GET even starts.

Signed-off-by: Adam Stokes <adam.stokes@docker.com>
2026-11-03 15:19:10 -05:00
Tõnis Tiigi 0013c35917 Merge pull request #6806 from okhowang/feat/volatile
fix: remove volatile flag in temp mount
2026-11-03 12:17:29 -08:00
Tõnis Tiigi e4f8ad903e Merge pull request #7354 from tonistiigi/fix-release-error-handling
llbsolver: fix resultProxy.Release error handling
2026-11-03 11:22:30 -08:00
CrazyMax b3f8dfd5da Merge pull request #7304 from crazy-max/gha-cache-tlog-threshold
remotecache: honor gha cache transparency log threshold
2026-11-03 19:11:43 +01:00
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 68162560a9 solve: lock local cache ingests across clients
Independent local content stores only coordinate writers within each
store instance. Concurrent cache exports to the same directory can open
the same ingest files, causing rename failures or incomplete writes.

Acquire a filesystem lock per ingest reference before opening a writer
or aborting an ingest. Release it when the writer closes or commits,
including error paths, and report contention as unavailable so existing
retry logic can wait. Preserve references so interrupted uploads remain
resumable, and retain lock files to avoid races with replacement inodes.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-11-03 19:10:11 +01: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
Jan Mohr ea2a15afc3 cache: fix content hash leak for removed records
Signed-off-by: Jan Mohr <jan.mohr.1@web.de>
2026-11-03 10:59:14 +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
Tonis Tiigi bd2512c47c llbsolver: fix resultProxy.Release error handling
Release checked the wrong error variable, so a failing result release
was swallowed and the proxy was left unreleased.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-11-02 18:01:22 -08: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
Adam Stokes 002a5ce713 source/http: retry transient request failures
The HTTP source issues every request with a bare client.Do and returns
the error unchanged, so one dropped connection fails the whole solve.

A solve can hold thousands of independent HTTP sources, each fetched
over its own connection and with little reuse between them, so this is
likely rather than rare on a lossy path. A 2000-URL build reproduces it
within seconds, consistently:

    failed to load cache key: Get "http://...": EOF

Registry fetches already retry this class of error through retryhandler.
Use the same helper here.

Only the request is retried. A failure part way through reading the
response body is not covered, and status-code handling is unchanged.

Signed-off-by: Adam Stokes <adam.stokes@docker.com>
2026-10-28 15:25:13 +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