[codex] Guard PDB field-list recursion#8287
Draft
plafosse wants to merge 1 commit into
Draft
Conversation
74ed5e3 to
39bbb05
Compare
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.
Warning
This patch was completely vibe coded. Treat it as a CI and validation candidate, not a reviewed final fix.
Refs Vector35/binaryninja#1620
Rationale
The D2 Sentry crash points at a stack overflow while Binary Ninja imports PDB type information. The likely failure path is below
pdb-ng's existing type-resolution guard:pdb-rsrecursively parses nestedLF_FIELDLISTrecords while building rawTypeData, so malformed or adversarial PDB input can recurse beforepdb-nggets a chance to apply its owntype_stacklimits.This PR changes that parser path to fail closed with a typed recursion-limit error instead of exhausting the process stack.
What Changed
pdb-rssource used bypdb-ngso the parser fix is local to the plugin build.pdb-ngmanifests to use the vendored path dependency.TypeRecordRecursionLimitand cap nestedLF_FIELDLISTparsing at 32 levels.Validation
cargo +1.91.1-aarch64-apple-darwin test --manifest-path /private/tmp/pdb-rs-test/Cargo.toml --offline --lib fieldlist_recursion_limittest_branch.