[to-be-committed] PR ld/24600: BFD: Fix use-after-free from `_bfd_load_armap'

Maciej W. Rozycki macro@orcam.me.uk
Fri Aug 14 23:18:16 GMT 2026


On Fri, 14 Aug 2026, Maciej W. Rozycki wrote:

>  I saw Alan's fix which takes a different approach and makes temporary 
> allocations from `_bfd_compute_and_push_armap' permanent, however at the 
> cost of keeping intermediate pointer allocations forever.  This variant 
> discards them after use at the cost of temporary higher memory usage in 
> `_bfd_load_armap'.  I'm happy to discuss pros and cons.

 On second thoughts I concluded we can have the pros of both changes and 
the cons of neither, so I've blended them together and sent the result at 
<https://inbox.sourceware.org/binutils/alpine.DEB.2.21.2608142347340.14132@angie.orcam.me.uk/>.  
I've dropped all Alan's clean-ups though, these are best made separately 
and not mixed up with bug fixes obfuscating them.

  Maciej


More information about the Binutils mailing list