Files
buildkit/executor
Dawei Wei 2ee0a47757 executor/oci: pin WCOW cache mount source across mount realization
The Windows cache mount is realized later by HCS from the resolved host
path, so verification alone leaves a check-to-use window in which the
verified entry could be swapped for a junction escaping the cache root
(concurrent cache access). Hold the verified source open with
GENERIC_READ and a share mode that omits FILE_SHARE_DELETE until the
mount is released, so the entry cannot be renamed or deleted (and thus
swapped) during that window. GENERIC_READ rather than DELETE is used so a
concurrent read/traverse open by the mount stack still succeeds;
validated against a real HCS worker (benign cache mounts still mount and
the escape is still rejected).

Add a unit test asserting the source cannot be renamed while pinned and
can be renamed after release.

Signed-off-by: Dawei Wei <wei.dawei.cn@gmail.com>
(cherry picked from commit 39a7b40489a036134a93502ea3d84d71dca072ea)
(cherry picked from commit 473663bad0)
2026-07-16 17:37:11 -07:00
..
2026-01-13 22:09:20 -08:00
2025-05-02 12:19:17 -07:00