Skip to content

Validate CPIO timestamp and filename fields - #1

Merged
Aneesh495 merged 1 commit into
mainfrom
fix/cpio-header-validation
Nov 12, 2026
Merged

Aneesh495 merged 1 commit into
mainfrom
fix/cpio-header-validation

Conversation

@Aneesh495

Copy link
Copy Markdown
Owner

The initramfs generator accepted NUL-containing names and timestamps outside the unsigned 32-bit newc field. For example, SOURCE_DATE_EPOCH=4294967296 emitted a nine-digit timestamp and shifted every following header field, producing an invalid archive.

Reject those values before the archive is written. Valid timestamps and archive contents retain their existing encoding.

Validation: reproduced the malformed timestamp header; checked timestamp boundaries 0 and 4294967295, rejection of -1 and 4294967296, NUL-name rejection, and byte-identical 512-byte-aligned output from two normal archive builds; git diff --check passes.

Co-authored-by: Codex <noreply@openai.com>
@Aneesh495
Aneesh495 merged commit c6a1073 into main Nov 12, 2026
2 checks passed
@Aneesh495
Aneesh495 deleted the fix/cpio-header-validation branch November 12, 2026 17:31
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.

1 participant