Add direct readlinkat syscall coverage#236
Merged
Merged
Conversation
Collaborator
|
Please comply with https://cbea.ms/git-commit/ |
The syscall coverage audit exempted readlinkat on the grounds that libc readlink() and the procfs symlink paths exercise it indirectly. Indirect coverage cannot distinguish a working handler from a missing one, so add direct syscall(SYS_readlinkat, ...) tests for absolute paths, dirfd relative paths, truncation without NUL termination, and EBADF on an invalid dirfd. The exemption table only ever grew: entries survived after direct tests appeared, so a later test regression would still pass the audit. Make the audit fail on exemptions it did not use, and drop the five entries that are already covered directly.
Xalestar
force-pushed
the
test/readlinkat-coverage
branch
from
July 23, 2026 15:32
ed1fdfb to
5836ae0
Compare
Contributor
Author
|
Amended the commit message with a body. No code changes. |
Contributor
|
Thank @Xalestar for contributing! |
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
readlinkat(2)tests for absolute paths and dirfd-relative paths.EBADFhandling for an invalid dirfd.Related to #224.
Testing
.ci/check-format.sh.ci/check-newline.sh.ci/check-security.shpython3 scripts/check-syscall-coverage.pymake check— 70 passedmake test-matrix-elfuse-aarch64— 242 passed, 0 failed, 4 skippedSummary by cubic
Add direct readlinkat(2) tests and tighten the syscall coverage audit to fail on stale indirect exemptions. Covers absolute and dirfd-relative reads, truncation without NUL, and EBADF.
New Features
readlinkat(2)tests intests/test-file-ops.cfor absolute path, dirfd-relative, truncation without terminator, and invalid dirfd ->EBADF.Refactors
scripts/check-syscall-coverage.pynow fails on unused indirect exemptions and prints only those actually used.INDIRECT_COVERAGE(incl.readlinkat,faccessat,truncate,exit_group,getxattr).Written for commit 5836ae0. Summary will update on new commits.