rtld: Completely ignore LD_LIBRARY_PATH for AT_SECURE=1 programs
authorFlorian Weimer <fweimer@redhat.com>
Sun, 28 May 2017 18:37:40 +0000 (20:37 +0200)
committerAurelien Jarno <aurel32@debian.org>
Sun, 18 Jun 2017 18:04:53 +0000 (19:04 +0100)
LD_LIBRARY_PATH can only be used to reorder system search paths, which
is not useful functionality.

Gbp-Pq: Topic any
Gbp-Pq: Name local-CVE-2017-1000366-rtld-LD_LIBRARY_PATH.diff

elf/rtld.c

index 52ec1a8f170ad894a8f84f15ac22c863525215a3..3103ab303a8cb0eadf07014bbb61d158dad011a2 100644 (file)
@@ -2439,7 +2439,8 @@ process_envvars (enum mode *modep)
 
        case 12:
          /* The library search path.  */
-         if (memcmp (envline, "LIBRARY_PATH", 12) == 0)
+         if (!__libc_enable_secure
+             && memcmp (envline, "LIBRARY_PATH", 12) == 0)
            {
              library_path = &envline[13];
              break;