What happens
docker/qemu/run-aarch64-test.sh and docker/qemu/run-aarch64-userspace.sh
both end with:
docker kill $(docker ps -q --filter ancestor=breenix-qemu-aarch64) 2>/dev/null || true
docker ps --filter ancestor= matches on the image, not the container id,
so this kills any container currently running from breenix-qemu-aarch64 --
not only the one this invocation started. Two concurrent invocations of
either script (or one of each) on the same host share that image, so the
first invocation to finish can kill the second invocation's still-running
QEMU container out from under it.
How it was found
Found while auditing docker/qemu/*aarch64*.sh for the fixed-/tmp-path
hazard #825 reports, in the same pass that gave both scripts'
OUTPUT_DIR a BREENIX_GATE_TMP base. BREENIX_GATE_TMP does not
address this: it separates the two runs' files, but this line still
terminates the other run's process regardless of where its output
lands.
Why it matters
Same failure class as #825: a concurrent run's evidence is corrupted, but
here by killing the peer's QEMU process rather than by overwriting its
serial file. Both scripts are Docker-wrapped legacy tools, superseded by
the native-QEMU scripts CLAUDE.md's Test Scripts section documents, so
this is lower traffic than #825's targets -- but the hazard is real
whenever either script runs.
Shape of a fix
Capture this invocation's own container id (docker run --cidfile or
docker run -d plus the captured id, rather than the current
fire-and-forget &) and docker kill that one id, instead of the whole
image-filter match the current line uses.
What happens
docker/qemu/run-aarch64-test.shanddocker/qemu/run-aarch64-userspace.shboth end with:
docker ps --filter ancestor=matches on the image, not the container id,so this kills any container currently running from
breenix-qemu-aarch64--not only the one this invocation started. Two concurrent invocations of
either script (or one of each) on the same host share that image, so the
first invocation to finish can kill the second invocation's still-running
QEMU container out from under it.
How it was found
Found while auditing
docker/qemu/*aarch64*.shfor the fixed-/tmp-pathhazard #825 reports, in the same pass that gave both scripts'
OUTPUT_DIRaBREENIX_GATE_TMPbase.BREENIX_GATE_TMPdoes notaddress this: it separates the two runs' files, but this line still
terminates the other run's process regardless of where its output
lands.
Why it matters
Same failure class as #825: a concurrent run's evidence is corrupted, but
here by killing the peer's QEMU process rather than by overwriting its
serial file. Both scripts are Docker-wrapped legacy tools, superseded by
the native-QEMU scripts CLAUDE.md's Test Scripts section documents, so
this is lower traffic than #825's targets -- but the hazard is real
whenever either script runs.
Shape of a fix
Capture this invocation's own container id (
docker run --cidfileordocker run -dplus the captured id, rather than the currentfire-and-forget
&) anddocker killthat one id, instead of the wholeimage-filter match the current line uses.