am 5f28fde8: Merge "linker: only re-open std* for setuid programs."

* commit '5f28fde8aeee047a70e344c9da937695dc51a3ba':
  linker: only re-open std* for setuid programs.
This commit is contained in:
Nick Kralevich 2013-04-25 17:01:41 -07:00 committed by Android Git Automerger
commit ed572aaa0d

View File

@ -1595,11 +1595,6 @@ static bool soinfo_link_image(soinfo* si) {
return false;
}
// If this is a setuid/setgid program, close the security hole described in
// ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc
if (get_AT_SECURE()) {
nullify_closed_stdio();
}
notify_gdb_of_load(si);
return true;
}
@ -1628,6 +1623,12 @@ static Elf32_Addr __linker_init_post_relocation(KernelArgumentBlock& args, Elf32
// Initialize environment functions, and get to the ELF aux vectors table.
linker_env_init(args);
// If this is a setuid/setgid program, close the security hole described in
// ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc
if (get_AT_SECURE()) {
nullify_closed_stdio();
}
debuggerd_init();
// Get a few environment variables.