[PATCH] ld/pdb: Fix PDB source-info substream overflow
Project / Subsystem
binutils / ld/pdb
Date
2026-09-30
Proposer
Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
Source type
public_inbox
Consensus
Proposed
Sentiment
—/10
All attributes
- project
- binutils
- subsystem
- ld/pdb
- patch_id
- —
- discussion_id
- 20260930193657.733-8-oleg.tolmatcev@gmail.com
- source_type
- public_inbox
- title
- [PATCH] ld/pdb: Fix PDB source-info substream overflow
- headline
- ld/pdb: Fix PDB source-info substream overflow
- tldr
- Fixes buffer overflow in PDB source-info substream by using a 32-bit count for source files.
- proposer
- Oleg Tolmatcev <oleg.tolmatcev@gmail.com>
- consensus
- Proposed
- outcome
- proposed
- sentiment_score
- —
- technical_tradeoffs
- []
- series_id
- —
- series_role
- standalone
- series_parts
- []
- tags
-
- • pdb
- • linker
- • debugging
- • overflow
- • bugfix
- bugzilla_url
- —
- date
- 2026-09-30T00:00:00.000Z
[PATCH] ld/pdb: Fix PDB source-info substream overflow
This patch resolves a buffer overflow vulnerability in the PDB source-info substream generation. The source_files_count was incorrectly using a 16-bit integer, which would wrap around for links with more than 65535 source file references. This led to an undersized buffer allocation for the substream, causing writes past its boundaries. The fix changes source_files_count to a 32-bit integer and includes new test cases to verify the correction.