unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Mark Krentel via Libc-alpha <libc-alpha@sourceware.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org, Xiaozhu Meng <xm13@rice.edu>,
	John Mellor-Crummey <johnmc@rice.edu>
Subject: Re: A collection of LD_AUDIT bugs that are important for tools (with better formatting for this list)
Date: Wed, 23 Jun 2021 15:06:44 -0500	[thread overview]
Message-ID: <17D7D064-DE92-4559-91E3-518E97CB272D@rice.edu> (raw)
In-Reply-To: <8735t96qgx.fsf@oldenburg.str.redhat.com>

Sorry, I was out one day (Tuesday) and I've missed an entire email
thread.  :-)

I agree, we don't want to intercept threads at level of clone().
clone is less portable (args vary by arch type), has variable args,
also mixed in with fork, etc.  That would be much harder and much more
buggy.

thrd_create() is simply a new C11 function that we haven't added yet.
Keep in mind that HPCToolkit goes back well before 2011.

I don't think thrd_create() per se would be a problem.  But I'm not
quite clear on the term "non-iterposable".  Does that mean LD_PRELOAD
is not going to work?  THAT would be a big problem for us.

Let me say in general that for these kinds of things, there is always
a great temptation to go behind the system's back and say, just give
me the "real" thing.  That is simply wrong, wrong, wrong.  There's a
saying in CS that "all problems can be solved by adding an extra layer
of indirection."  That's a bit extreme, but there's a lot of truth to
it.

Imagine a app that wanted to bypass virtual memory because it's doing
low-level gpu programming or whatever and it knows the physical
addresses and wants to use them directly.  Imagine the chaos that
would cause.  That's what MS Windows used to do.

Anyway, there needs to be a clean API line for these things.  If you
bypass the line, then you don't work and play well with others.  And
at some point, all we can do is say, we can't work with your app. :-(

--Mark




> On Jun 23, 2021, at 1:32 AM, Florian Weimer <fweimer@redhat.com> wrote:
> 
> * Adhemerval Zanella:
> 
>> Currently, you need to interpose both pthread_create and thrd_create.  Florian
>> has suggested we allow pthread_create to be interposable (meaning glibc will
>> issue a plt call on each usage). 
>> 
>> We can do it for clone instead, it would have the advantage to hide
>> the multiple architecture different kernel ABIs.
> 
> But the clone call is very low-level.  The start routine is not called
> with a fully configured thread, so wrapping the startup routine would be
> rather awkward.
> 
> The guts of posix_spawn are equally tricky because code is running
> without a properly configured TCB and stack.  I'm not sure if it
> possible to call an interceptable execve from posix_spawn, for instance.
> We would need to know more about interceptor requirements to see if
> there is a solution.
> 
> Thanks,
> Florian
> 


  reply	other threads:[~2021-06-23 20:07 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 17:55 A collection of LD_AUDIT bugs that are important for tools (with better formatting for this list) John Mellor-Crummey via Libc-alpha
2021-06-17 19:42 ` Adhemerval Zanella via Libc-alpha
2021-06-17 20:09   ` Florian Weimer via Libc-alpha
2021-06-17 23:06     ` Adhemerval Zanella via Libc-alpha
2021-06-23 17:42       ` Ben Woodard via Libc-alpha
2021-07-30 14:58         ` Adhemerval Zanella via Libc-alpha
2021-07-30 18:59           ` Ben Woodard via Libc-alpha
2021-07-30 21:09             ` Adhemerval Zanella via Libc-alpha
2021-07-31  0:59               ` Ben Woodard via Libc-alpha
2021-08-04 18:11                 ` Adhemerval Zanella via Libc-alpha
2021-08-05 10:32                   ` Szabolcs Nagy via Libc-alpha
2021-08-05 19:36                     ` Ben Woodard via Libc-alpha
2021-08-06  9:04                       ` Szabolcs Nagy via Libc-alpha
2021-06-21 19:42     ` John Mellor-Crummey via Libc-alpha
2021-06-22  8:15       ` Florian Weimer via Libc-alpha
2021-06-22 15:04         ` John Mellor-Crummey via Libc-alpha
2021-06-22 15:36           ` Florian Weimer via Libc-alpha
2021-06-22 16:17             ` John Mellor-Crummey via Libc-alpha
2021-06-22 16:33               ` Adhemerval Zanella via Libc-alpha
2021-06-23  6:32                 ` Florian Weimer via Libc-alpha
2021-06-23 20:06                   ` Mark Krentel via Libc-alpha [this message]
2021-06-18 17:48   ` John Mellor-Crummey via Libc-alpha
2021-06-18 18:27     ` Adhemerval Zanella via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17D7D064-DE92-4559-91E3-518E97CB272D@rice.edu \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=johnmc@rice.edu \
    --cc=krentel@rice.edu \
    --cc=xm13@rice.edu \
    /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).