Skip to content

🐛 fix(identity): limit PID probe to Linux - #1036

Merged
gaborbernat merged 5 commits into
tox-dev:mainfrom
gaborbernat:fix/windows-pid-namespace-host
Nov 20, 2026
Merged

gaborbernat merged 5 commits into
tox-dev:mainfrom
gaborbernat:fix/windows-pid-namespace-host

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

On Windows, host_name() probed a Linux path that Windows resolved on the current drive. A local account able to create that path could change the hostname recorded in a soft-lock marker; after the holder exited and the path changed, owner_is_stale() treated the dead marker as foreign and left a private lock busy. The namespace probe now runs only on Linux and Android. This addresses draft advisory ANT-2026-K9PQD1EN.

Windows path resolution changes lock identity

Python's Windows path rules resolve a rooted path on the current drive. The old probe therefore read a drive-root entry on Windows and could append its inode to the hostname. The platform guard keeps the PID namespace suffix on Linux and Android, where it distinguishes containers sharing a hostname, and leaves other platforms with the escaped kernel hostname.

Behavior changes

Windows soft-lock markers use the same host identity regardless of drive-root entries, so a dead local owner can be checked for recovery. Linux and Android still distinguish PID namespaces. A marker written with a changed host under an affected version remains foreign to a corrected reader; an operator must verify that its owner has exited before using break_lock().

Reported by OSS Scanner: ANT-2026-K9PQD1EN.

@gaborbernat gaborbernat added bug security Fixes a published or draft security advisory labels Nov 20, 2026
The PID-namespace tests now skip on Windows, so their bodies need the same
platform coverage mark used by adjacent tests. A foreign-marker case covers
the retry helper's exhausted path and checks acquisition after an explicit
break.
@gaborbernat
gaborbernat marked this pull request as draft November 20, 2026 15:32
@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 17:33
@gaborbernat
gaborbernat marked this pull request as draft November 20, 2026 20:22
@gaborbernat
gaborbernat marked this pull request as ready for review November 20, 2026 20:24
@gaborbernat
gaborbernat merged commit 4f7a3d7 into tox-dev:main Nov 20, 2026
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug security Fixes a published or draft security advisory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant