public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: Eric Blake <eblake@redhat.com>,
	libc-help@sourceware.org,
	"libguestfs@redhat.com" <libguestfs@redhat.com>
Subject: Re: [Libguestfs] alternatives for hooking dlopen() without LD_LIBRARY_PATH or LD_AUDIT?
Date: Fri, 21 Feb 2020 17:42:00 -0000	[thread overview]
Message-ID: <20200221174202.GQ3888@redhat.com> (raw)
In-Reply-To: <87mu9cc4jf.fsf@oldenburg2.str.redhat.com>

On Fri, Feb 21, 2020 at 05:02:12PM +0100, Florian Weimer wrote:
> * Richard W. M. Jones:
> 
> > On Fri, Feb 21, 2020 at 04:00:30PM +0100, Florian Weimer wrote:
> >> * Richard W. M. Jones:
> >> 
> >> > On Fri, Feb 21, 2020 at 01:19:34PM +0100, Florian Weimer wrote:
> >> >> I think what confuses me is that keep talking about a single binary, but
> >> >> clearly there is this separate vddk DSO, and there is talk of plugins.
> >> >> So it seems to me that multiple files are involved already?
> >> >
> >> > nbdkit is a standalone binary that happens to be able to load plugins
> >> > from a well-known path, eg nbdkit-vddk-plugin.so.  nbdkit knows the
> >> > path for plugins, and there's a wrapper allowing it to get local
> >> > plugins even when it's still in the build directory.  Adding another
> >> > file would mean another path (or overloading the meaning of the plugin
> >> > path) and just makes the whole thing more fragile and complex.
> >> >
> >> > Having said all that, what would also solve this is either an API for
> >> > updating LD_LIBRARY_PATH after the program has started; or making
> >> > setenv ("LD_LIBRARY_PATH",...) DTRT*; or some kind of dlopen() variant
> >> > which takes a library path as an extra parameter.
> >> 
> >> Have you tried adding DT_RUNPATH or DT_RPATH to nbdkit-vddk-plugin.so?
> >> Or does the path have to be chosen dynamically?
> >
> > To be clear, the situation is:
> >
> >   nbdkit (free)
> >    -> dlopens nbdkit-vddk-plugin.so (free)
> >      -> dlopens libvixDiskLib.so (proprietary)
> >        -> dlopens other proprietary plugins
> >        -> both libvixDiskLib.so and its plugins have DT_NEEDED
> >           "libstdc++.so.X" and other objects that have odd/old
> >           compiled versions in its own directory
> >
> > It's the proprietary library libvixDiskLib.so (colloquially known as "VDDK")
> > which has trouble opening its own plugins.  I guess you mean adding
> > DT_* to the proprietary library?
> 
> No, to nbdkit-vddk-plugin.so.
> 
> But it looks like have misunderstood the request.
> 
> Do you want to inhibit loading the libstdc++.so.X from vddk, or the
> opposite—ensure that it is loaded?  The latter obviously taints the
> process.  But maybe that's what you want?

Ideally load it but only make it available to VDDK.  I think Eric was
working on something along these lines, using dlmopen.

We're sort of lucky that none of the libraries that VDDK tries to load
overlaps with libraries that nbdkit uses (currently).

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW

  reply	other threads:[~2020-02-21 17:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 19:02 Eric Blake
2020-02-14 21:29 ` [Libguestfs] " Eric Blake
2020-02-14 22:20   ` Carlos O'Donell
2020-02-17 15:04   ` Eric Blake
2020-02-17 15:12     ` Florian Weimer
2020-02-18 21:32       ` Eric Blake
2020-02-21 12:19         ` Florian Weimer
2020-02-21 13:26           ` Eric Blake
2020-02-21 14:51           ` Richard W.M. Jones
2020-02-21 15:00             ` Florian Weimer
2020-02-21 15:40               ` Richard W.M. Jones
2020-02-21 16:02                 ` Florian Weimer
2020-02-21 17:42                   ` Richard W.M. Jones [this message]
2020-02-21 20:28                     ` Eric Blake
2020-02-21 20:21               ` Eric Blake

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=20200221174202.GQ3888@redhat.com \
    --to=rjones@redhat.com \
    --cc=eblake@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    --cc=libguestfs@redhat.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).