1 --- malloc/malloc.c 2004-08-03 18:06:35 -0400
2 +++ malloc/malloc.c 2004-08-03 18:08:53 -0400
4 #define assert(x) ((void)0)
7 +#include <abort-instr.h>
8 +#ifndef ABORT_INSTRUCTION
9 +#define ABORT_INSTRUCTION
13 INTERNAL_SIZE_T is the word-size used for internal bookkeeping
14 @@ -1951,6 +1955,13 @@
15 #define unlink(P, BK, FD) { \
18 + if (FD->bk != P || BK->fd != P) \
20 + ABORT_INSTRUCTION; \
23 + ABORT_INSTRUCTION; \
28 --- sysdeps/generic/unsecvars.h 2004-08-03 18:13:13 -0400
29 +++ sysdeps/generic/unsecvars.h 2004-08-03 18:11:41 -0400
31 with a '\0' explicitly. */
32 #define UNSECURE_ENVVARS \
35 + "LD_TRACE_PRELINKING\0" \
39 --- elf/rtld.c 2003-01-07 13:47:35 -0500
40 +++ elf/rtld.c 2004-08-03 22:15:51 -0400
41 @@ -1762,6 +1762,30 @@
43 = &"/var/tmp\0/var/profile"[INTUSE(__libc_enable_secure) ? 9 : 0];
45 + /* Extra security for SUID binaries. Remove all dangerous environment
47 + if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
49 + static const char unsecure_envvars[] =
50 +#ifdef EXTRA_UNSECURE_ENVVARS
51 + EXTRA_UNSECURE_ENVVARS
56 + nextp = unsecure_envvars;
60 + /* We could use rawmemchr but this need not be fast. */
61 + nextp = (char *) (strchr) (nextp, '\0') + 1;
63 + while (*nextp != '\0');
65 + if (__access ("/etc/suid-debug", F_OK) != 0)
66 + unsetenv ("MALLOC_CHECK_");
69 while ((envline = _dl_next_ld_env_entry (&runp)) != NULL)
72 @@ -1897,33 +1921,10 @@
73 /* The caller wants this information. */
76 - /* Extra security for SUID binaries. Remove all dangerous environment
78 - if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
80 - static const char unsecure_envvars[] =
81 -#ifdef EXTRA_UNSECURE_ENVVARS
82 - EXTRA_UNSECURE_ENVVARS
87 - nextp = unsecure_envvars;
91 - /* We could use rawmemchr but this need not be fast. */
92 - nextp = (char *) (strchr) (nextp, '\0') + 1;
94 - while (*nextp != '\0');
96 - if (__access ("/etc/suid-debug", F_OK) != 0)
97 - unsetenv ("MALLOC_CHECK_");
99 /* If we have to run the dynamic linker in debugging mode and the
100 LD_DEBUG_OUTPUT environment variable is given, we write the debug
101 messages to this file. */
102 - else if (any_debug && debug_output != NULL)
103 + if (any_debug && debug_output != NULL)
106 const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW;