mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Don't use INTVARDEF/INTUSE with __libc_enable_secure (bug 14132).
Continuing the removal of the obsolete INTDEF / INTVARDEF / INTUSE mechanism, this patch replaces its use for __libc_enable_secure with the use of rtld_hidden_data_def and rtld_hidden_proto. Tested for x86_64 that installed stripped shared libraries are unchanged by the patch. [BZ #14132] * elf/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def instead of INTVARDEF. (_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure. * sysdeps/mach/hurd/dl-sysdep.c (__libc_enable_secure): Use rtld_hidden_data_def instead of INTVARDEF. (_dl_sysdep_start): Do not use INTUSE with __libc_enable_secure. * elf/dl-deps.c (expand_dst): Likewise. * elf/dl-load.c (_dl_dst_count): Likewise. (_dl_dst_substitute): Likewise. (decompose_rpath): Likewise. (_dl_init_paths): Likewise. (open_path): Likewise. (_dl_map_object): Likewise. * elf/rtld.c (dl_main): Likewise. (process_dl_audit): Likewise. (process_envvars): Likewise. * include/unistd.h [IS_IN_rtld] (__libc_enable_secure_internal): Remove declaration. (__libc_enable_secure): Use rtld_hidden_proto.
This commit is contained in:
@ -54,7 +54,7 @@ extern void __libc_check_standard_fds (void);
|
||||
ElfW(Addr) _dl_base_addr;
|
||||
#endif
|
||||
int __libc_enable_secure attribute_relro = 0;
|
||||
INTVARDEF(__libc_enable_secure)
|
||||
rtld_hidden_data_def (__libc_enable_secure)
|
||||
int __libc_multiple_libcs = 0; /* Defining this here avoids the inclusion
|
||||
of init-first. */
|
||||
/* This variable contains the lowest stack address ever used. */
|
||||
@ -148,7 +148,7 @@ _dl_sysdep_start (void **start_argptr,
|
||||
#ifndef HAVE_AUX_SECURE
|
||||
seen = -1;
|
||||
#endif
|
||||
INTUSE(__libc_enable_secure) = av->a_un.a_val;
|
||||
__libc_enable_secure = av->a_un.a_val;
|
||||
break;
|
||||
case AT_PLATFORM:
|
||||
GLRO(dl_platform) = (void *) av->a_un.a_val;
|
||||
@ -199,7 +199,7 @@ _dl_sysdep_start (void **start_argptr,
|
||||
|
||||
/* If one of the two pairs of IDs does not match this is a setuid
|
||||
or setgid run. */
|
||||
INTUSE(__libc_enable_secure) = uid | gid;
|
||||
__libc_enable_secure = uid | gid;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -243,7 +243,7 @@ _dl_sysdep_start (void **start_argptr,
|
||||
/* If this is a SUID program we make sure that FDs 0, 1, and 2 are
|
||||
allocated. If necessary we are doing it ourself. If it is not
|
||||
possible we stop the program. */
|
||||
if (__builtin_expect (INTUSE(__libc_enable_secure), 0))
|
||||
if (__builtin_expect (__libc_enable_secure, 0))
|
||||
__libc_check_standard_fds ();
|
||||
|
||||
(*dl_main) (phdr, phnum, &user_entry, GLRO(dl_auxv));
|
||||
|
Reference in New Issue
Block a user