Skip to content

util: add optional -fbounds-safety annotation for readFromFd - #335

Open
LaptopsPlural wants to merge 1 commit into
google:masterfrom
LaptopsPlural:local/util-io-bounds-safety
Open

LaptopsPlural wants to merge 1 commit into
google:masterfrom
LaptopsPlural:local/util-io-bounds-safety

Conversation

@LaptopsPlural

@LaptopsPlural LaptopsPlural commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Secure-by-design memory-safety hardening. Adds inert optional Clang -fbounds-safety macros and annotates the readFromFd buffer path. Default builds unchanged (opt-in OFF).

Contributor: Jeff Bindel via LaptopsPlural. Not a vulnerability PoC.

Test plan

  • Default make / tests
  • Optional bounds-safety ON with supporting Clang (maintainers)

Introduce inert NSJAIL_SIZED_BY macros and annotate util::readFromFd's
buf/len pair. Default builds unchanged; ENABLE_FBOUNDS_SAFETY opts into
Clang -fbounds-safety.
@LaptopsPlural
LaptopsPlural force-pushed the local/util-io-bounds-safety branch 2 times, most recently from 49d5c3f to 1b20317 Compare September 12, 2026 03:31

This branch has not been deployed

No deployments
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