This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] Fix BZ 20419 -- stack overflow with huge PT_NOTE segment
- From: Paul Pluzhnikov <ppluzhnikov at google dot com>
- To: Siddhesh Poyarekar <siddhesh at gotplt dot org>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sun, 06 May 2018 01:09:15 +0000
- Subject: Re: [patch] Fix BZ 20419 -- stack overflow with huge PT_NOTE segment
- References: <CALoOobPKf5bP6BMt436ufCYYgAvdgQmPz4kBnrYQBn-Jc2uzcA@mail.gmail.com> <87d1623c-d6cb-a72e-aff6-fec12bbaf5f4@gotplt.org>
On Thu, May 3, 2018 at 10:08 AM Siddhesh Poyarekar <siddhesh@gotplt.org>
wrote:
> Patch is OK but please add a detailed description of the problem in your
> git commit message; it should ideally be part of the submission.
+ abi_note_malloced = abi_note = malloc (size);
+ if (abi_note == NULL)
+ goto read_error;
I noticed that this could leak memory for a DSO with multiple PT_NOTEs
(which LLD used to produce until that bug was fixed).
Changed this part to:
+ /* There could be multiple PT_NOTEs. */
+ abi_note_malloced = realloc (abi_note_malloced, size);
+ if (abi_note_malloced == NULL)
+ goto read_error;
+
+ abi_note = abi_note_malloced;
and committed.
Thanks,
--
Paul Pluzhnikov