Re: [PATCH v2] ld/pdb: Avoid double-free on malformed symbol data

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

  • • Addresses a critical memory safety issue.
  • • Minor change to error handling logic.

All attributes

project
binutils
subsystem
ld/pdb
patch_id
—
discussion_id
57848e11-bb0a-439b-b603-96651f1cb847@suse.com
source_type
public_inbox
title
Re: [PATCH v2] ld/pdb: Avoid double-free on malformed symbol data
headline
ld/pdb: Avoid double-free on malformed symbol data
tldr
Fixes a double-free bug in linker's PDB generation when handling malformed symbol data.
proposer
Jan Beulich <jbeulich@suse.com>
consensus
Proposed
outcome
proposed
sentiment_score
—
technical_tradeoffs
  • • Addresses a critical memory safety issue.
  • • Minor change to error handling logic.
series_id
—
series_role
reply
series_parts
[]
tags
  • • binutils
  • • linker
  • • pdb
  • • windows
  • • memory safety
bugzilla_url
—
date
2026-10-05T00:00:00.000Z

Re: [PATCH v2] ld/pdb: Avoid double-free on malformed symbol data

This patch corrects a double-free error in the linker’s PDB (Program Database) generation. The issue occurred when handle_debugs_section failed, causing create_module_info_substream to free file arrays for all modules, including the current one. Subsequently, populate_module_stream would also attempt to free the same array, leading to the double-free. The fix ensures that the cleanup of the current module’s file array is handled only once by the caller.