segfault in lookup_ldap and elsewhere when building with -Wl,-Bsymbolic-functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I was pulling the latest autofs from Debian into Ubuntu and, due to a
mistake of mine, I dropped a line in d/rules that was _removing_ the
-Wl,-Bsymbolic-functions flag from LDFLAGS set by Ubuntu.

The build proceeded as normal, packages installed, and I started
getting segfaults all over the place.

This has happened before:
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1470687: Not
working properly with compile options "-symbolic-functions"
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1472115: autofs
start fails: segfault at 0 ip ....
https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1503034: Autofs
5.1.1-1ubuntu2 crashes with segfault on startup

For the lookup_ldap specific case, just dropping the linker flag from
Ubuntu's LDFLAGS wasn't enough, because it leaks back in via
$(krb5-config --libs), so a patch (attached) was contributed by
Malcolm Scott (https://bugs.launchpad.net/ubuntu/+source/autofs/+bug/1503034/comments/7).
The patch still applies to current master, but with some offset.

Would there be interest from upstream in adopting this patch, even
though there is no crash on a default upstream build? If this makes
sense, other modules could follow the same path.

I also asked ubuntu-devel for the reasoning for
-Wl,-Bsymbolic-functions and why Debian isn't using it:
https://lists.ubuntu.com/archives/ubuntu-devel/2018-June/040369.html.
It looks like it's one of those things that just never converged
between the two distros.

Thanks!
Description: Fix segfault in lookup_ldap initialisation
 lib/defaults.c doesn't initialise the config cache before lookup_ldap
 attempts to read from it.
 .
 <andreas> lookup_ldap is the only module that is still built and linked
 using -Bsymbolic-functions. d/rules tries to strip that option out of
 LDFLAGS, but it leaks back in via $(krb5-config --libs) when lookup_ldap
 is built.
Author: Malcolm Scott <debianpkg@xxxxxxxxxxx>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1503034

Index: autofs-5.1.1/modules/lookup_ldap.c
===================================================================
--- autofs-5.1.1.orig/modules/lookup_ldap.c
+++ autofs-5.1.1/modules/lookup_ldap.c
@@ -1665,6 +1665,11 @@ int lookup_init(const char *mapfmt, int
 		ctxt->check_defaults = 1;
 	}
 
+	if (!defaults_read_config(0)) {
+		free_context(ctxt);
+		return 1;
+	}
+
 	ctxt->timeout = defaults_get_ldap_timeout();
 	ctxt->network_timeout = defaults_get_ldap_network_timeout();
 

[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux