Repository navigation
🐛 fix(strict): reject foreign-owned sentinels - #992
Merged
gaborbernat merged 5 commits intoNov 20, 2026
Merged
Conversation
gaborbernat
marked this pull request as draft
November 20, 2026 15:32
gaborbernat
force-pushed
the
fix/strict-foreign-sentinel
branch
from
November 20, 2026 15:48
48673c8 to
e6408fc
Compare
gaborbernat
force-pushed
the
fix/strict-foreign-sentinel
branch
3 times, most recently
from
November 20, 2026 16:39
276eda0 to
4d8b7bb
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 18:24
gaborbernat
marked this pull request as draft
November 20, 2026 19:33
gaborbernat
force-pushed
the
fix/strict-foreign-sentinel
branch
2 times, most recently
from
November 20, 2026 19:59
ff20d1f to
c04a385
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 21:37
gaborbernat
marked this pull request as draft
November 20, 2026 22:00
An attacker who owns the compatibility sentinel in a shared sticky directory can remove it during a strict hold. A legacy soft lock can then enter while the strict lock remains held. Refuse that sentinel before treating it as part of a strict acquisition.
Pass the open sentinel to the sticky-directory ownership check so a caller whose UID matches the overflow value can use its own sentinel.
gaborbernat
force-pushed
the
fix/strict-foreign-sentinel
branch
from
November 20, 2026 22:08
c04a385 to
442f184
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 22:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In a POSIX sticky directory such as
/tmp, a strict lock now accepts a sentinel only when the caller or the directory owner owns it. The sentinel keeps legacy soft locks out while a strict holder is active. The sticky bit lets the file's owner remove that name during the hold. Linux unlink rules, ANT-2026-DYZMWIDJ.Before publishing its claim,
StrictSoftFileLockchecks ownership using the descriptor it opened for the sentinel. On Linux, an account can use its own sentinel when its UID matches the kernel's overflow value and ownership can be verified. A sentinel owned by any other account raisesSoftFileLockProtocolError. The directory owner can remove the conflicting sentinel, or callers can move their lock to a private directory. Linux ownership check in #1099.An older sentinel writable by another account needs replacing while all clients are stopped. Tightening its mode with
fchmodleaves existing writable descriptors usable. On the next acquisition the lock creates a sentinel without group or other write permission.Reported by OSS Scanner (ANT-2026-DYZMWIDJ).