summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
authorDiego Elio 'Flameeyes' Pettenò <flameeyes@gmail.com>2009-07-07 20:51:53 +0200
committerColin Guthrie <cguthrie@mandriva.org>2009-07-16 17:56:00 +0100
commitabf6dfbc625006f08fb30fef5814d0c7eb57e2ee (patch)
tree327aaa084568c7bc7f913947c077caa487824bae /src/daemon
parentdce6af5fefbcd68d52f6ff42509213406f62c57f (diff)
Remove exploitable LD_BIND_NOW hack (CVE-2009-1894).
Instead of trying to re-execute pulseaudio itself with LD_BIND_NOW set, just find the correct flag for the linker to request immediate bindings (all ELF files support that option), and use that when linking the daemon. Reduce the amount of compiled and executed code as well.
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/main.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/daemon/main.c b/src/daemon/main.c
index c456e6d1..4499ea34 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -399,28 +399,6 @@ int main(int argc, char *argv[]) {
pa_log_set_level(PA_LOG_NOTICE);
pa_log_set_flags(PA_LOG_COLORS|PA_LOG_PRINT_FILE|PA_LOG_PRINT_LEVEL, PA_LOG_RESET);
-#if defined(__linux__) && defined(__OPTIMIZE__)
- /*
- Disable lazy relocations to make usage of external libraries
- more deterministic for our RT threads. We abuse __OPTIMIZE__ as
- a check whether we are a debug build or not.
- */
-
- if (!getenv("LD_BIND_NOW")) {
- char *rp;
-
- /* We have to execute ourselves, because the libc caches the
- * value of $LD_BIND_NOW on initialization. */
-
- pa_set_env("LD_BIND_NOW", "1");
-
- if ((rp = pa_readlink("/proc/self/exe")))
- pa_assert_se(execv(rp, argv) == 0);
- else
- pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?");
- }
-#endif
-
#ifdef HAVE_GETUID
real_root = getuid() == 0;
suid_root = !real_root && geteuid() == 0;