Re: [PATCH v2] ld/pdb: Fix PDB source-info substream overflow
Project / Subsystem
binutils / ld/pdb
Date
2026-10-05
Proposer
Jan Beulich <jbeulich@suse.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
Technical tradeoffs
- • Increased memory usage for the `source_files_count` variable, though negligible.
- • Fixes a potential crash/corruption bug.
All attributes
- project
- binutils
- subsystem
- ld/pdb
- patch_id
- —
- discussion_id
- 4394290d-8569-48a0-9260-35ebb0ca3f49@suse.com
- source_type
- public_inbox
- title
- Re: [PATCH v2] ld/pdb: Fix PDB source-info substream overflow
- headline
- ld/pdb: Fix PDB source-info substream overflow
- tldr
- A fix for a PDB substream overflow bug in the linker by increasing the size of a counter.
- proposer
- Jan Beulich <jbeulich@suse.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
-
- • Increased memory usage for the `source_files_count` variable, though negligible.
- • Fixes a potential crash/corruption bug.
- series_id
- —
- series_role
- reply
- series_parts
- []
- tags
-
- • binutils
- • linker
- • pdb
- • windows
- • overflow
- bugzilla_url
- —
- date
- 2026-10-05T00:00:00.000Z
Re: [PATCH v2] ld/pdb: Fix PDB source-info substream overflow
This patch addresses a bug in the linker’s PDB (Program Database) handling where a uint16_t counter for source file references could overflow if a link involved more than 65,535 references. This overflow led to a buffer allocation that was too small for the source-info substream, resulting in a write past the buffer’s end. The fix changes the counter to uint32_t to accommodate a larger number of references.