public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "Vivek Das Mohapatra" <vivek@collabora.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [RFC][PATCH v10 5/7] Implement dlmopen RTLD_SHARED flag (bug 22745)
Date: Wed, 2 Jun 2021 16:42:53 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2106021638560.6900@noise.cbg.collabora.co.uk> (raw)
In-Reply-To: <982a4b32-30b0-5112-53dd-2bdc8319ee63@linaro.org>

> The 'loader' GL(dl_ns)[nsid].libc_map points to a read-only memory segment,
> I haven't debug it further.

Stared at the code for a while and did some code tweaking and figured it out:
If the library is loaded _without_ RTLD_ISOLATE then some error paths will
not result in a new namespace being initialised at all (since libc will be 
shared with the main namespace), which in turn means that nsid will never be
upgraded from LM_ID_NEWLM (-1).

So in the error path you'll try a negative offset from GL(dl_ns) and Very
Bad Things will happen.

Easy enough to add a guard for. I'll address the comments so far and send a
new patch series.

  reply	other threads:[~2021-06-02 15:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 15:41 [RFC][PATCH v10 0/7] Implementation of RTLD_SHARED for dlmopen Vivek Das Mohapatra
2021-03-22 15:41 ` [RFC][PATCH v10 1/7] Define a new dynamic section tag - DT_GNU_FLAGS_1 (bug 22745) Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-03-22 15:41 ` [RFC][PATCH v10 2/7] Abstract loaded-DSO search code into a helper function Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-03-22 15:41 ` [RFC][PATCH v10 3/7] Use the new DSO finder " Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-03-22 15:41 ` [RFC][PATCH v10 4/7] Add DT_GNU_FLAGS_1/DF_GNU_1_UNIQUE to glibc DSOs (bug 22745) Vivek Das Mohapatra
2021-05-28 14:53   ` Adhemerval Zanella
2021-05-28 16:59     ` Adhemerval Zanella
2021-05-28 17:18     ` Andreas Schwab
2021-03-22 15:41 ` [RFC][PATCH v10 5/7] Implement dlmopen RTLD_SHARED flag " Vivek Das Mohapatra
2021-05-28 17:32   ` Adhemerval Zanella
2021-05-28 18:02     ` Adhemerval Zanella
2021-06-02 15:42       ` Vivek Das Mohapatra [this message]
2021-05-28 23:22     ` Vivek Das Mohapatra
2021-03-22 15:41 ` [RFC][PATCH v10 6/7] Add dlmopen / RTLD_SHARED tests Vivek Das Mohapatra
2021-03-22 15:41 ` [RFC][PATCH v10 7/7] Restore separate libc loading for the TLS/namespace storage test Vivek Das Mohapatra
2021-03-25 15:15 ` [RFC][PATCH v10 0/7] Implementation of RTLD_SHARED for dlmopen Vivek Das Mohapatra
2021-04-13 17:02 ` Vivek Das Mohapatra
2021-04-29 15:25   ` Vivek Das Mohapatra
2021-05-11 17:42     ` Vivek Das Mohapatra
2021-05-17 19:08       ` [PING][PATCH " Vivek Das Mohapatra

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=alpine.DEB.2.21.2106021638560.6900@noise.cbg.collabora.co.uk \
    --to=vivek@collabora.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    /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).