Skip to content

Handle DWARF string sections larger than 2 GB - #1207

Open
David Quiceno (v-davidquiceno-ascendion) wants to merge 4 commits into
microsoft:mainfrom
v-davidquiceno-ascendion:fix/large-debug-str
Open

Handle DWARF string sections larger than 2 GB#1207
David Quiceno (v-davidquiceno-ascendion) wants to merge 4 commits into
microsoft:mainfrom
v-davidquiceno-ascendion:fix/large-debug-str

Conversation

@v-davidquiceno-ascendion

@v-davidquiceno-ascendion David Quiceno (v-davidquiceno-ascendion) commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • Add a string-reader abstraction for DWARF string sections.
  • Add the opt-in --dwarf-string-read-threshold CLI option.
  • Use file-backed reads only when that option is supplied and the DWARF string section reaches the configured limit.
  • Preserve the existing in-memory behavior by default and for sections below the configured limit.
  • Add regression tests for reads beyond 2 GB and for the opt-in threshold behavior.

Root cause

ELFSharp materializes section contents in a byte array. Sections larger than int.MaxValue overflow when their size is converted to a 32-bit integer, preventing BinSkim from analyzing otherwise valid ELF binaries.

Validation

  • All 154 Test.UnitTests.BinaryParsers tests passed.
  • All 85 Test.UnitTests.BinSkim.Driver tests passed.
  • The new CLI option is present in BinSkim analyze --help.
  • The earlier custom-package validation successfully analyzed the affected Minecraft Switch artifact.

@v-davidquiceno-ascendion
David Quiceno (v-davidquiceno-ascendion) marked this pull request as ready for review August 3, 2026 17:23
@jamoor-moj

Copy link
Copy Markdown

@microsoft-github-policy-service agree company="Microsoft"

@v-davidquiceno-ascendion

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

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.

2 participants