Repository navigation
fix(od): bound row widths and budget output growth - #2620
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 05dae69 | Commit Preview URL Branch Preview URL |
Oct 08 2026, 02:12 AM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
odrejects-w/--widthabove 65,536 bytes before rendering, including empty input. It pads each numeric field in an eight-byte stack buffer instead of allocating an entire requested-width row. Output uses existing budgeted, fallible growth; rendering consumes the shared work budget. Padding arithmetic remains safe on 32-bit targets.Why
An untrusted script could request a 2^60-byte allocation with one byte of input. Allocation failure can abort the embedding process; timeout and panic recovery cannot contain that failure. This fixes Codex Security finding
commit:beb2051713d48191994f971d65a5f6fd.Before / After
Before: two safe regressions failed against the pre-fix implementation: width 65,538 exited successfully, and a 65,536-byte trailer row bypassed a 4 KiB live-memory budget. The destructive allocation was not executed.
After, actual CLI smoke:
Regression coverage: decimal/octal/hex/multiplier enormous widths, empty input, multiple types, exact ceiling, tight live/work budgets, recovery, and output above the capture cap flowing through pipelines. A portable GNU differential test compares 21 valid-width layout cases on Linux; local macOS lacks GNU od.
Validation: HTTP-feature workspace tests (excluding the unchanged CPython artifact crate), 19 single-threaded failpoint tests, all-feature clippy, knowledge/documentation checks, and both benchmark harnesses. Full performance harness: 96 cases, zero errors, 100% output match.
Local limitations: default-stack
just pre-praborts in the existing nested-if parser test, reproduced on unchanged maindaae80ac6a3f2e2a316e61ef9726bea02f63c9d5. With 8 MiB test-thread stacks all core integration tests pass, but full pre-pr reaches the unchanged CPython module's 64 KiB alignment assertion, also reproduced in isolation. No runtime limits, assertions, or CI gates were changed. Full Linux CI must pass before merge.Zero/misaligned-width safety is tested directly: GNU od can abort on
-w0, so invalid widths are excluded from the external oracle. The initial CI failure exposed this oracle failure; assertions and runtime protections remain intact.Risk
Low. Widths above 65,536 bytes are an intentional sandbox restriction, documented as L-OD-002. Ordinary GNU layouts and pipeline behavior are preserved. No dependency changes.
Checklist