[libvirt] [PATCH 01/14] build: prevent unloading of all public libraries

Daniel P. Berrangé posted 14 patches 7 years ago
[libvirt] [PATCH 01/14] build: prevent unloading of all public libraries
Posted by Daniel P. Berrangé 7 years ago
We previously added "-z nodelete" to the build of libvirt.so to prevent
crashes when thread local destructors run which point to a code that
has been dlclose()d:

  commit 384b9a76a5e387f64cfe8f83f4a518bb302e80f7
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Thu Apr 19 11:42:22 2018 +0100

    driver: prevent unloading of dlopen'd modules

We forgot to copy this protection into the libvirt-qemu.so, libvirt-lxc.so
and libvirt-admin.so libraries when we introduced them.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/Makefile.am | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index a6667228b6..2f8e5f6908 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -529,7 +529,9 @@ libvirt_admin_la_SOURCES = \
 libvirt_admin_la_LDFLAGS = \
 		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_ADMIN_SYMBOL_FILE) \
 		-version-info $(LIBVIRT_VERSION_INFO) \
-		$(AM_LDFLAGS)
+		$(LIBVIRT_NODELETE) \
+		$(AM_LDFLAGS) \
+		$(NULL)
 
 libvirt_admin_la_LIBADD = \
 		libvirt.la \
@@ -644,6 +646,7 @@ libvirt_qemu_la_SOURCES = libvirt-qemu.c
 libvirt_qemu_la_LDFLAGS = \
 		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_QEMU_SYMBOL_FILE) \
 		-version-info $(LIBVIRT_VERSION_INFO) \
+		$(LIBVIRT_NODELETE) \
 		$(AM_LDFLAGS) \
 		$(NULL)
 libvirt_qemu_la_CFLAGS = $(AM_CFLAGS)
@@ -653,6 +656,7 @@ libvirt_lxc_la_SOURCES = libvirt-lxc.c
 libvirt_lxc_la_LDFLAGS = \
 		$(VERSION_SCRIPT_FLAGS)$(LIBVIRT_LXC_SYMBOL_FILE) \
 		-version-info $(LIBVIRT_VERSION_INFO) \
+		$(LIBVIRT_NODELETE) \
 		$(AM_LDFLAGS) \
 		$(NULL)
 libvirt_lxc_la_CFLAGS = $(AM_CFLAGS)
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 01/14] build: prevent unloading of all public libraries
Posted by Michal Privoznik 7 years ago
On 04/19/2018 07:09 PM, Daniel P. Berrangé wrote:
> We previously added "-z nodelete" to the build of libvirt.so to prevent
> crashes when thread local destructors run which point to a code that
> has been dlclose()d:
> 
>   commit 384b9a76a5e387f64cfe8f83f4a518bb302e80f7
>   Author: Daniel P. Berrangé <berrange@redhat.com>
>   Date:   Thu Apr 19 11:42:22 2018 +0100
> 
>     driver: prevent unloading of dlopen'd modules

This commit does not exist. However 8e44e5593eb does.

> 
> We forgot to copy this protection into the libvirt-qemu.so, libvirt-lxc.so
> and libvirt-admin.so libraries when we introduced them.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/Makefile.am | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

ACK

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 01/14] build: prevent unloading of all public libraries
Posted by Daniel P. Berrangé 7 years ago
On Tue, Apr 24, 2018 at 02:17:00PM +0200, Michal Privoznik wrote:
> On 04/19/2018 07:09 PM, Daniel P. Berrangé wrote:
> > We previously added "-z nodelete" to the build of libvirt.so to prevent
> > crashes when thread local destructors run which point to a code that
> > has been dlclose()d:
> > 
> >   commit 384b9a76a5e387f64cfe8f83f4a518bb302e80f7
> >   Author: Daniel P. Berrangé <berrange@redhat.com>
> >   Date:   Thu Apr 19 11:42:22 2018 +0100
> > 
> >     driver: prevent unloading of dlopen'd modules
> 
> This commit does not exist. However 8e44e5593eb does.

Yes, yes, copied in a local commit by mistake - the hash you mention
is indeed the right one.

> 
> > 
> > We forgot to copy this protection into the libvirt-qemu.so, libvirt-lxc.so
> > and libvirt-admin.so libraries when we introduced them.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  src/Makefile.am | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> ACK
> 
> Michal

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list