From: Guinevere Larsen <guinevere@redhat.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: Fix use-after-free when an objfile has no symbols to load
Date: Fri, 6 Dec 2024 14:37:37 -0300 [thread overview]
Message-ID: <ae6206be-bc13-4031-9ce7-22041aef4130@redhat.com> (raw)
In-Reply-To: <aacb550f-0427-454b-bec5-35a0fa2428e3@simark.ca>
On 12/6/24 2:35 PM, Simon Marchi wrote:
>
> On 2024-12-05 08:19, Guinevere Larsen wrote:
>> The recent commit <HASH> moved an initialization of an objfile_holder in
>> syms_from_objfile_1 much earlier in the function, to better deal with
>> when GDB is unable to read the objfile format.
>>
>> However, there is an early exit from syms_from_objfile_1 when the
>> objfile can be understood, but has no symbols. That was not releasing
>> the objfile_holder, so the objfile was being unlinked from the program
>> space, but the process of reading the objfile was being continued,
>> leading to use-after-frees flagged by the Address Sanitizer.
>>
>> This commit fixes that UAF by making the objfile_holder release the
>> objfile right before the early exit.
>>
>> This commit also changes the test gdb.base/dump.exp since that was the
>> original test that flagged the UAF, but at the end of the test the
>> generated files were being deleted, meaning we couldn't redo the test
>> manually after teh fact. That final deletion was removed
> teh -> the
>
> Approved-By: Simon Marchi <simon.marchi@efficios.com>
>
> Thanks,
>
> Simon
>
Thanks for the review, pushed!
--
Cheers,
Guinevere Larsen
She/Her/Hers
prev parent reply other threads:[~2024-12-06 17:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-05 13:19 Guinevere Larsen
2024-12-05 13:54 ` Guinevere Larsen
2024-12-06 17:35 ` Simon Marchi
2024-12-06 17:37 ` Guinevere Larsen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae6206be-bc13-4031-9ce7-22041aef4130@redhat.com \
--to=guinevere@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox