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

* commit 'ed572aaa0d275eed753afd4b92e05991310e76ac':
  linker: only re-open std* for setuid programs.
This commit is contained in:
Nick Kralevich 2013-04-25 21:19:48 -07:00 committed by Android Git Automerger
commit 95a46909c7

View File

@ -1595,11 +1595,6 @@ static bool soinfo_link_image(soinfo* si) {
return false; 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); notify_gdb_of_load(si);
return true; 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. // Initialize environment functions, and get to the ELF aux vectors table.
linker_env_init(args); 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(); debuggerd_init();
// Get a few environment variables. // Get a few environment variables.