Skip to content

Add direct readlinkat syscall coverage#236

Merged
jserv merged 1 commit into
sysprog21:mainfrom
Xalestar:test/readlinkat-coverage
Jul 24, 2026
Merged

Add direct readlinkat syscall coverage#236
jserv merged 1 commit into
sysprog21:mainfrom
Xalestar:test/readlinkat-coverage

Conversation

@Xalestar

@Xalestar Xalestar commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add direct readlinkat(2) tests for absolute paths and dirfd-relative paths.
  • Verify truncation without implicit NUL termination.
  • Verify EBADF handling for an invalid dirfd.
  • Make the syscall coverage audit reject stale indirect-coverage exemptions.
  • Report only exemptions actually used by the audit.

Related to #224.

Testing

  • .ci/check-format.sh
  • .ci/check-newline.sh
  • .ci/check-security.sh
  • python3 scripts/check-syscall-coverage.py
  • make check — 70 passed
  • make test-matrix-elfuse-aarch64 — 242 passed, 0 failed, 4 skipped

Summary 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

    • Direct readlinkat(2) tests in tests/test-file-ops.c for absolute path, dirfd-relative, truncation without terminator, and invalid dirfd -> EBADF.
  • Refactors

    • scripts/check-syscall-coverage.py now fails on unused indirect exemptions and prints only those actually used.
    • Removed five obsolete entries from INDIRECT_COVERAGE (incl. readlinkat, faccessat, truncate, exit_group, getxattr).

Written for commit 5836ae0. Summary will update on new commits.

Review in cubic

cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv
jserv requested a review from Max042004 July 23, 2026 11:17
@Max042004

Copy link
Copy Markdown
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
Xalestar force-pushed the test/readlinkat-coverage branch from ed1fdfb to 5836ae0 Compare July 23, 2026 15:32
@Xalestar

Copy link
Copy Markdown
Contributor Author

Amended the commit message with a body. No code changes.

@jserv
jserv merged commit 69d5453 into sysprog21:main Jul 24, 2026
10 checks passed
@jserv

jserv commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Thank @Xalestar for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants