]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge r10150 from trunk to fix #194429.
authorTom Hughes <tom@compton.nu>
Fri, 29 May 2009 08:19:22 +0000 (08:19 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 29 May 2009 08:19:22 +0000 (08:19 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_3_4_BRANCH@10168

coregrind/m_initimg/initimg-linux.c

index 56a5aa00a23fd1ca107355ba02672f657a06f254..57f72f1b473a4ad83a2f79c5e5cb1f4ef97bce72 100644 (file)
@@ -339,6 +339,10 @@ static HChar** setup_client_env ( HChar** origenv, const HChar* toolname)
 #define AT_UCACHEBSIZE         21
 #endif /* AT_UCACHEBSIZE */
 
+#ifndef AT_RANDOM
+#define AT_RANDOM              25
+#endif /* AT_RANDOM */
+
 #ifndef AT_SYSINFO
 #define AT_SYSINFO             32
 #endif /* AT_SYSINFO */
@@ -485,6 +489,8 @@ Addr setup_client_stack( void*  init_sp,
    for (cauxv = orig_auxv; cauxv->a_type != AT_NULL; cauxv++) {
       if (cauxv->a_type == AT_PLATFORM)
         stringsize += VG_(strlen)(cauxv->u.a_ptr) + 1;
+      else if (cauxv->a_type == AT_RANDOM)
+        stringsize += 16;
       auxsize += sizeof(*cauxv);
    }
 
@@ -745,6 +751,15 @@ Addr setup_client_stack( void*  init_sp,
             auxv->a_type = AT_IGNORE;
             break;
 
+         case AT_RANDOM:
+            /* points to 16 random bytes - we need to ensure this is
+               propagated to the client as glibc will assume it is
+               present if it is built for kernel 2.6.29 or later */
+            auxv->u.a_ptr = strtab;
+            VG_(memcpy)(strtab, orig_auxv->u.a_ptr, 16);
+            strtab += 16;
+            break;
+
          default:
             /* stomp out anything we don't know about */
             VG_(debugLog)(2, "initimg",