From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org,
Stephen Roettger <sroettger@google.com>,
jeffxu@chromium.org, Carlos O'Donell <carlos@redhat.com>
Subject: Re: [RFC 4/5] elf: Enable RTLD_NODELETE on __libc_unwind_link_get
Date: Wed, 12 Jun 2024 19:50:03 +0200 [thread overview]
Message-ID: <87wmmuf3uc.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <fc1cf10a-5e3f-413b-bdce-5c5f7acb0e5e@linaro.org> (Adhemerval Zanella Netto's message of "Wed, 12 Jun 2024 14:16:42 -0300")
* Adhemerval Zanella Netto:
> On 12/06/24 06:54, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> The libgcc_s.so can also be sealed. The library is loaded once
>>> and not unloaded during process execution (only for memory debug
>>> with __libc_unwind_link_freeres).
>>
>> The unwind-link change to use RTLD_NODELETE could go in separately.
>
> Ok, I will send a separate patch.
>
>>
>>> diff --git a/misc/unwind-link.c b/misc/unwind-link.c
>>> index 213a0162a4..7267ecbec3 100644
>>> --- a/misc/unwind-link.c
>>> +++ b/misc/unwind-link.c
>>
>>> @@ -100,7 +100,8 @@ __libc_unwind_link_get (void)
>>>
>>> __libc_lock_lock (lock);
>>> if (atomic_load_relaxed (&global_libgcc_handle) != NULL)
>>> - /* This thread lost the race. Clean up. */
>>> + /* This thread lost the race. Drop the l_direct_opencount and issue
>>> + the debug log. */
>>> __libc_dlclose (local_libgcc_handle);
>>> else
>>> {
>>
>> I don't understand what “debug log” means in this context.
>
> Sorry, I meant the __libc_unwind_link_freeres usually triggered by
> memory profilers. With sealing the dlclose won't unmap the memory.
I still don't understand the comment.
We can still deallocate the helper data structures. With the switch to
read-only link maps, most of the allocations will be hidden from malloc
tracing anyway and no longer appear as leaks.
Thanks,
Florian
next prev parent reply other threads:[~2024-06-12 17:50 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-11 15:27 [RFC 0/5] Add support for memory sealing Adhemerval Zanella
2024-06-11 15:27 ` [RFC 1/5] linux: Remove __stack_prot Adhemerval Zanella
2024-06-11 19:15 ` Florian Weimer
2024-06-11 15:27 ` [RFC 2/5] linux: Add mseal syscall support Adhemerval Zanella
2024-06-11 15:27 ` [RFC 3/5] elf: Add support to memory sealing Adhemerval Zanella
2024-06-11 20:47 ` Jonathan Corbet
2024-06-11 21:03 ` Adhemerval Zanella
2024-06-21 5:09 ` Mike Hommey
2024-06-25 21:07 ` Adhemerval Zanella Netto
2024-06-25 23:18 ` Mike Hommey
2024-06-26 11:58 ` Adhemerval Zanella Netto
2024-06-26 19:58 ` Mike Hommey
2024-06-26 21:20 ` Adhemerval Zanella Netto
2024-06-26 21:39 ` Mike Hommey
2024-06-26 21:56 ` Adhemerval Zanella Netto
2024-06-27 23:00 ` Mike Hommey
2024-06-28 5:51 ` Florian Weimer
2024-06-28 5:58 ` Mike Hommey
2024-06-28 6:06 ` Florian Weimer
2024-06-28 7:39 ` Mike Hommey
2024-07-01 21:08 ` Adhemerval Zanella Netto
2024-06-11 15:27 ` [RFC 4/5] elf: Enable RTLD_NODELETE on __libc_unwind_link_get Adhemerval Zanella
2024-06-12 9:54 ` Florian Weimer
2024-06-12 17:16 ` Adhemerval Zanella Netto
2024-06-12 17:50 ` Florian Weimer [this message]
2024-06-12 17:55 ` Adhemerval Zanella Netto
2024-06-11 15:27 ` [RFC 5/5] elf: Add support to memory sealing for audit modules Adhemerval Zanella
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=87wmmuf3uc.fsf@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=adhemerval.zanella@linaro.org \
--cc=carlos@redhat.com \
--cc=jeffxu@chromium.org \
--cc=libc-alpha@sourceware.org \
--cc=sroettger@google.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).