Skip to content

Validate payload reads and entrypoint bounds#12

Open
ericlewis wants to merge 1 commit into
define-loader-runtime-contractfrom
harden-payload-load
Open

Validate payload reads and entrypoint bounds#12
ericlewis wants to merge 1 commit into
define-loader-runtime-contractfrom
harden-payload-load

Conversation

@ericlewis

Copy link
Copy Markdown
Collaborator

Summary

  • Check header and payload reads for exact lengths.
  • Reject empty, too large, or overflowed payload sizes.
  • Validate the entry point is inside the loaded payload.
  • Use fixed-width integer and address-sized math.

Why

payload.bin can be missing, cut short, or changed. The loader used to trust the size and entry point from that file. A bad file could make the loader read into the wrong memory or jump outside the payload.

Verification

  • python3 generate_start.py
  • cmake -S . -B /tmp/playbrew-verify-harden-payload-load
  • cmake --build /tmp/playbrew-verify-harden-payload-load
  • git diff --check

Why: payload.bin can be missing, cut short, or changed. The loader used to trust the size and entry point from that file without checking them. A bad file could make the loader read into the wrong memory or jump outside the payload. This checks the reads and only runs the payload when the size and entry point are safe.
@ericlewis ericlewis added firmware Firmware hooks, patching, and version-specific code security Input validation and hardening labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

firmware Firmware hooks, patching, and version-specific code security Input validation and hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant