aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2014-06-02 22:59:19 -0700
committerPaul Pluzhnikov <ppluzhnikov@google.com>2014-06-02 22:59:19 -0700
commit7241b75ecc6b89a5689d0d9f5d8e917b6b908c3b (patch)
tree8afa9ee8636765253e04d62b5602331694c9b5af
parentfa5cf22b8406dda76b95d09299bfc0cbe972aa3b (diff)
downloadglibc-7241b75ecc6b89a5689d0d9f5d8e917b6b908c3b.zip
glibc-7241b75ecc6b89a5689d0d9f5d8e917b6b908c3b.tar.gz
glibc-7241b75ecc6b89a5689d0d9f5d8e917b6b908c3b.tar.bz2
For b/13901604, forward-port http://cr/68404571 via
-rw-r--r--README.google6
-rw-r--r--elf/rtld.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/README.google b/README.google
index 661d414..19344ea 100644
--- a/README.google
+++ b/README.google
@@ -329,3 +329,9 @@ sysdeps/powerpc/powerpc64/fpu/s_copysign.S
stack temp bugfix on PPC ELFv2):
https://sourceware.org/ml/libc-alpha/2014-04/msg00000.html
(bmoses, already upstream)
+
+elf/rtld.c
+ For b/13901604, set correct __google_auxv before unsetting insecure
+ environment variables.
+ (ppluzhnikov, google-local)
+
diff --git a/elf/rtld.c b/elf/rtld.c
index 5fd7ba7..8c225cd 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2717,6 +2717,19 @@ process_envvars (enum mode *modep)
UNSECURE_ENVVARS;
const char *nextp;
+ /* We may destory the connection between __environ and the auxv[]
+ by unsetting one or more of the insecure variables in the
+ original environment. Here is our last chance to record correct
+ __google_auxv. See b/13901604. */
+ extern ElfW(auxv_t) *__google_auxv;
+ if (__builtin_expect (__google_auxv == NULL, 1))
+ {
+ char **e;
+
+ for (e = __environ; *e; ++e) /* Skip. */;
+ __google_auxv = (ElfW(auxv_t) *) ++e;
+ }
+
nextp = unsecure_envvars;
do
{