Restore statx request-mask filtering - #1656
Open
a-shannon wants to merge 2 commits into
Open
Conversation
a-shannon
marked this pull request as ready for review
August 10, 2026 00:23
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.
Summary
PR #379 added a forward-compatibility guard that masks unknown
statxrequest bits before invoking the kernel. After #787 enabled bitflags'
externally-defined-flags support,
StatxFlags::all()becameu32::MAX, somask & StatxFlags::all()became an identity operation and the guard stoppedfiltering unknown bits.
This change:
StatxRequestFlagscontaining the 14 currently namedelementary request bits;
STATX__RESERVEDwithEINVAL;StatxFlagsexternal-flags behavior unchanged; andnot
StatxFlags::all().This restores the future-kernel safety boundary intended by #379. It does not
claim a vulnerability on current kernels.
Testing
Focused local validation recorded:
statxintegration 2/2;statxintegration 2/2;fstest-target Clippy with-D warningsfor bothbackends;
git diff --check; andThis does not claim a repository-wide Clippy, MSRV, or CI pass.
Relation to #1467
This is complementary to #1467, not a replacement for it. #1467 adds
MNT_ID_UNIQUE,SUBVOL,WRITE_ATOMIC, and the write-atomic attribute.Whichever PR lands second should extend the private request allowlist with the
newly named request bits during rebase.