[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#630695: LD_PRELOAD not working when running kfreebsd-9 (9.0~svn223109)



2011/7/14 Petr Salinger <Petr.Salinger@seznam.cz>:
>
> It looks like a collision, namely between
>
> AT_STACKPROT x AT_SECURE

Good guess Petr, it is indeed AT_SECURE.

Here's a possible patch to fix this.  I haven't tested it yet.  Does
this look like the right approach?

I also wonder if we should hunt down the other Linux-specific ELF
notes in that file.

-- 
Robert Millan
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -237,11 +237,13 @@
 	gid ^= av->a_un.a_val;
 	seen |= 8;
 	break;
+#ifdef AT_SECURE
       case AT_SECURE:
 	seen = -1;
 	__libc_enable_secure = av->a_un.a_val;
 	__libc_enable_secure_decided = 1;
 	break;
+#endif
       case AT_RANDOM:
 	_dl_random = (void *) av->a_un.a_val;
 	break;
--- a/elf/dl-sysdep.c
+++ b/elf/dl-sysdep.c
@@ -147,12 +147,14 @@
 	gid ^= av->a_un.a_val;
 	break;
 #endif
+#ifdef AT_SECURE
       case AT_SECURE:
 #ifndef HAVE_AUX_SECURE
 	seen = -1;
 #endif
 	INTUSE(__libc_enable_secure) = av->a_un.a_val;
 	break;
+#endif
       case AT_PLATFORM:
 	GLRO(dl_platform) = (void *) av->a_un.a_val;
 	break;
@@ -296,7 +298,9 @@
 	  [AT_ICACHEBSIZE - 2] =	{ "ICACHEBSIZE:  0x", hex },
 	  [AT_UCACHEBSIZE - 2] =	{ "UCACHEBSIZE:  0x", hex },
 	  [AT_IGNOREPPC - 2] =		{ "IGNOREPPC", ignore },
+#ifdef AT_SECURE
 	  [AT_SECURE - 2] =		{ "SECURE:       ", dec },
+#endif
 	  [AT_BASE_PLATFORM - 2] =	{ "BASE_PLATFORM:", str },
 	  [AT_SYSINFO - 2] =		{ "SYSINFO:      0x", hex },
 	  [AT_SYSINFO_EHDR - 2] =	{ "SYSINFO_EHDR: 0x", hex },
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -981,7 +981,9 @@
    interpretation of the AUXV. Must be > 16.  */
 #define AT_IGNOREPPC	22		/* Entry should be ignored.  */
 
+#ifdef __linux__
 #define	AT_SECURE	23		/* Boolean, was exec setuid-like?  */
+#endif
 
 #define AT_BASE_PLATFORM 24		/* String identifying real platforms.*/
 

Reply to: