[libvirt] [PATCH 03/14] build: prevent unloading of dlopen'd modules

Michal Privoznik mprivozn at redhat.com
Tue Apr 24 12:16:58 UTC 2018


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 at redhat.com>
>   Date:   Thu Apr 19 11:42:22 2018 +0100
> 
>     driver: prevent unloading of dlopen'd modules

As I've pointed earlier no such commit exists.

> 
> The libvirtd loadable modules can suffer from the same problem if they
> were ever unloaded. Fortunately we don't ever call dlclose() on them,
> but lets add a second layer of protection by linking them with the
> "-z nodelete" flag. While we're doing this, lets add a third layer of
> protection by passing RTLD_NODELETE to dlopen().
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  src/Makefile.am | 6 +++++-
>  src/driver.c    | 7 ++++++-
>  2 files changed, 11 insertions(+), 2 deletions(-)

ACK

Michal




More information about the libvir-list mailing list