Skip to content

GLKFS append: refuse oversized files, NULL-safe CRC - #2

Closed
Pitchfork-and-Torch wants to merge 2 commits into
mainfrom
cursor/glkfs-append-truncation-guard
Closed

Pitchfork-and-Torch wants to merge 2 commits into
mainfrom
cursor/glkfs-append-truncation-guard

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner

Summary

  • glk_fs_append read into a 2048-byte scratch buffer via glk_fs_read, which silently caps. A larger file plus a zero-length append could rewrite a truncated copy.
  • Append now checks the inode size first and returns GLK_ERR_FULL instead of truncating.
  • crc32_bytes treats a NULL payload as zero-fill so glk_fs_write(name, NULL, n) matches the bytes on disk.

Test plan

  • Extended test_storage_v39 (append of 2100-byte file returns FULL)
  • Host CRC/append guard smoke
  • Full ctest (10/10)

Pitchfork-and-Torch and others added 2 commits September 7, 2026 20:14
…leton, observe-only Bench, host CI. Authorized research RTOS. MIT.
Check inode size before the fixed scratch read, and treat NULL write
payloads as zero-fill for CRC so vault-sized appends fail closed.
@Pitchfork-and-Torch

Copy link
Copy Markdown
Owner Author

Folded into single-commit main (d6a9c20). Public product history stays one commit. Branch will be deleted.

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