Repository navigation
Stale-read detectors for the surviving pools: ASan poisoning + make jit-checked (#1665) - #1705
Merged
Merged
Conversation
The two recycling pools #1665 kept keep a parked object "allocated" to ASan, so a stale read of one was invisible (#1661). Under __SANITIZE_ADDRESS__ only: - a NUM on the per-thread freelist is poisoned whole except its link word; under ASan the link moves from data+0 (the number itself) to data+8, so a stale NUMBER read is reported too. Unpoisoned on pop. - a call env parked on chunk->env_cache has values[], names[], assign_counts[], the three hash arrays and the Env struct poisoned, except `parent` (read by vm_take_call_env). Unpoisoned on take; the cycle collector lifts the poison when it walks chunk -> env_cache and restores it for surviving chunks; chunk_free lifts it before the drop. Every other build expands the hooks to nothing: all 29 release objects are byte-identical to the base (cmp). tests/test_pool_poison.c plants a stale read of a parked NUM's number, a parked env's values[0] and a parked Env field; suite [0ff] requires each to be reported as use-after-poison at the planted address, and a control (freelist pop, call-env take, a collection over a parked env, chunk_free of a parked env) to stay sanitizer-clean with leaks on. Release builds announce a skip. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF
…ccess -DEIGS_JIT_CHECKED (the new jit-checked variant) makes the emitter call a witness before every direct env->values[slot] access: GET_LOCAL, SET_LOCAL, LOCAL_DOT_GET/SET (the %r12 values base) check that the cached base is still the current frame's fn_env->values and that slot < fn_env->count, the interpreter's range check; the inline EnvIC hit paths of GET_NAME and SET_NAME* check slot_idx < target->count. A violation prints the opcode, offset, chunk and line and aborts. The scanner charges the extra bytes to the size estimate. Nothing is emitted, declared or defined in the default build: release jit.o and vm.o are byte-identical to the base. CI runs the JIT-tier sections (82 100 129 130 0fd 0fe) against the checked build in the jit-differential job. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Part of #1665: the detector items for the two recycling layers that stay (the NUM freelist and call-env recycling).
What it adds
__SANITIZE_ADDRESS__):values,names,assign_countsand the hash arrays are poisoned, plus theEnvstruct exceptparent, whichvm_take_call_envreads to match the closure.chunk_free.cmp.make jit-checked(EIGS_JIT_CHECKED):valuesbase still matches the frame env and thatslot < count.slot < count.[0fg]: three planted stale reads (a parked num, a parked env slot, a parked env field) and a clean control.Evidence
use-after-poisonat the planted address;[0fg]red.jit-checked:EIGS_JIT_CHECKED: local slot out of range (1 vs 1) at GET_LOCAL offset 5 in chunk 'g' line 6, rc 134, on all four reproducers at both JIT tiers. The release build with the same revert printsok.jit-smokepasses;jit_diffpasses on release and on jit-checked (256 programs);freestanding-check,werror_switch_check, suite labels and the changelog pass.Caveats
[0ff]was taken by B0 (Slot-access API, rehearsal build and migration gate (#1665 arm D B0) #1702), so this section is[0fg].Review
Built by a Claude builder after three Codex Cloud attempts ended in ERROR with no output. The builder's self-check (plants, mutation train and byte-identical objects) is the evidence above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF