Skip to content

cpio: recognize NUL-padded trailer names - #1

Merged
ScottMoore0 merged 1 commit into
ScottMoore0:mainfrom
EpsilonPhoenix:t3/cpio-padded-trailer
Nov 3, 2026
Merged

ScottMoore0 merged 1 commit into
ScottMoore0:mainfrom
EpsilonPhoenix:t3/cpio-padded-trailer

Conversation

@EpsilonPhoenix

Copy link
Copy Markdown
Contributor

A valid newc archive with c_namesize = 12 and TRAILER!!!\0\0 was rejected with CpioNoTrailer. The initramfs buffer format permits additional trailing NULs within c_namesize.

Recognize the trailer followed by an all-NUL suffix. Ordinary names keep their raw bytes. Update the public trailer-name predicate and validity contract together so the universal parse/build round-trip law remains valid; bump the package to 0.2.0.0 for that contract change.

Add proved regressions for padded trailers, an entry preceding the trailer, non-trailer suffixes, and a malformed padded name.

Validation: scripts/check.sh cpio (including 100 reference cases), scripts/deps.sh cpio, and VERDICT=1 scripts/check.sh cpio pass with Bend 2.0.39 and Lean 4.34.0. Independent GPT-6.1-Terra medium review using review-agent returned no findings. The new padding cases are proof vectors; the existing reference suite covers ordinary archives.

@ScottMoore0
ScottMoore0 merged commit f9a2be1 into ScottMoore0:main Nov 3, 2026
@EpsilonPhoenix
EpsilonPhoenix deleted the t3/cpio-padded-trailer branch November 3, 2026 17:58
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.

2 participants