public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [RFC][PATCH v1 0/5] Proof-of-Concept implementation of RTLD_SHARED for dlmopen
@ 2018-05-16 17:11 Vivek Das Mohapatra
  2018-05-16 17:11 ` [RFC][PATCH v1 5/5] elf/dl-fini.c: Handle cloned link_map entries in the shutdown path Vivek Das Mohapatra
                   ` (6 more replies)
  0 siblings, 7 replies; 30+ messages in thread
From: Vivek Das Mohapatra @ 2018-05-16 17:11 UTC (permalink / raw)
  To: libc-alpha

As discussed in https://sourceware.org/bugzilla/show_bug.cgi?id=22745
dlmopen requires a mechanism for [optionally] sharing some objects
between more than one namespace.

The following patchset attempts an implementation for this: If an object
is loaded with the new RTLD_SHARED flag we instead ensure that a "master"
copy exists (and is flagged as no-delete) in the main namespace and a
thin wrapper or clone is placed in the target namespace.

I have attached the test program(s) I am using to the bug above.

It is not intended as a final implementation but I wanted to check
that the basic approach is acceptable/workable.

If it is, then I plan to extend the patchset as follows:

 - dlmopen will implicitly apply RTLD_SHARED to the libc/libpthread group
 - The user will be able to request that this sharing _not_ occur
   by passing a different flag to dlmopen (name TBD)
 - LD_AUDIT paths will not apply this implict sharing rule, so audit libraries
   will continue to be completely isolated.

If it isn't, then I guess it's back to the drawing board (but reasons why
it isn't acceptable/workable would be appreciated so I can figure out how
to do it right).

Vivek Das Mohapatra (5):
  bits/dlfcn.h: Declare and describe the dlmopen RTLD_SHARED flag
  include/link.h: Update the link_map struct to allow clones
  elf/dl-object.c: Implement a helper function to clone link_map entries
  elf/dl-load.c, elf-dl-open.c: Implement RTLD_SHARED dlmopen cloning
  elf/dl-fini.c: Handle cloned link_map entries in the shutdown path

 bits/dlfcn.h               |  7 +++++
 elf/dl-fini.c              | 50 ++++++++++++++++++++++++++++++
 elf/dl-load.c              | 34 ++++++++++++++++++++
 elf/dl-object.c            | 77 ++++++++++++++++++++++++++++++++++++++++++++++
 elf/dl-open.c              | 31 +++++++++++++++++--
 include/link.h             |  6 ++--
 sysdeps/generic/ldsodefs.h |  6 ++++
 7 files changed, 207 insertions(+), 4 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-05-20  2:48 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-16 17:11 [RFC][PATCH v1 0/5] Proof-of-Concept implementation of RTLD_SHARED for dlmopen Vivek Das Mohapatra
2018-05-16 17:11 ` [RFC][PATCH v1 5/5] elf/dl-fini.c: Handle cloned link_map entries in the shutdown path Vivek Das Mohapatra
2018-05-18 19:09   ` Carlos O'Donell
2018-05-18 19:25     ` Vivek Das Mohapatra
2018-05-16 17:11 ` [RFC][PATCH v1 3/5] elf/dl-object.c: Implement a helper function to clone link_map entries Vivek Das Mohapatra
2018-05-20  2:48   ` Carlos O'Donell
2018-05-16 17:11 ` [RFC][PATCH v1 1/5] bits/dlfcn.h: Declare and describe the dlmopen RTLD_SHARED flag Vivek Das Mohapatra
2018-05-18 18:37   ` Carlos O'Donell
2018-05-18 19:31     ` Vivek Das Mohapatra
2018-05-16 17:11 ` [RFC][PATCH v1 2/5] include/link.h: Update the link_map struct to allow clones Vivek Das Mohapatra
2018-05-18 18:47   ` Carlos O'Donell
2018-05-18 19:32     ` Vivek Das Mohapatra
2018-05-16 17:19 ` [RFC][PATCH v1 4/5] elf/dl-load.c, elf-dl-open.c: Implement RTLD_SHARED dlmopen cloning Vivek Das Mohapatra
2018-05-18 19:02   ` Carlos O'Donell
2018-05-18 19:20     ` Vivek Das Mohapatra
2018-05-16 19:30 ` [RFC][PATCH v1 0/5] Proof-of-Concept implementation of RTLD_SHARED for dlmopen Joseph Myers
2018-05-16 19:39   ` Vivek Das Mohapatra
2018-05-16 19:44     ` Joseph Myers
2018-05-16 19:46       ` Vivek Das Mohapatra
2018-05-16 20:03         ` Vivek Das Mohapatra
2018-05-16 19:44     ` Carlos O'Donell
2018-05-16 19:46       ` Vivek Das Mohapatra
2018-05-16 20:39         ` Carlos O'Donell
2018-05-18 11:46           ` Vivek Das Mohapatra
2018-05-18 18:16             ` Carlos O'Donell
2018-05-18 18:30 ` Carlos O'Donell
2018-05-18 19:06   ` Vivek Das Mohapatra
2018-05-18 19:26     ` Carlos O'Donell
2018-05-18 19:53       ` Vivek Das Mohapatra
2018-05-18 20:03         ` Carlos O'Donell

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).