pe_ILF_object_p and bfd_check_format_matches
Alan Modra
amodra@gmail.com
Thu Apr 13 10:58:59 GMT 2023
On Thu, Apr 13, 2023 at 11:55:10AM +0200, Martin Liška wrote:
> On 4/13/23 04:58, Alan Modra via Binutils wrote:
> > |The last patch wasn't quite correct.|
>
> Heh, I've just noticed that this change caused a crash when ar is called for ~150 files:
>
> ==27734== Invalid read of size 4
> ==27734== at 0x4D576DD: ftello (in /usr/lib64/libc.so.6)
> ==27734== by 0x4958E18: close_one (in /usr/lib64/libbfd-2.40.50.20230412-797.so)
Yes, that will be this part:
> > It is also not correct to restore abfd->iostream unless the iovec
> > changes. abfd->iostream is a FILE* when using cache_iovec, and if
> > the file has been closed and reopened the iostream may have changed.
I saw a similar invalid read in fseeko, and a double free in fclose
due to the above.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list