| Index: sandbox/linux/services/credentials.cc
|
| diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
|
| index 014ae134404326324ca047468535c86ab11e784f..dc62f1b21392b05012a6dda3a24b50be97bacf91 100644
|
| --- a/sandbox/linux/services/credentials.cc
|
| +++ b/sandbox/linux/services/credentials.cc
|
| @@ -54,9 +54,6 @@
|
| const int kExitSuccess = 0;
|
|
|
| int ChrootToSelfFdinfo(void*) {
|
| - // This function can be run from a vforked child, so it should not write to
|
| - // any memory other than the stack or errno. Reads from TLS may be different
|
| - // from in the parent process.
|
| RAW_CHECK(sys_chroot("/proc/self/fdinfo/") == 0);
|
|
|
| // CWD is essentially an implicit file descriptor, so be careful to not
|
| @@ -94,22 +91,9 @@
|
| #error "Unsupported architecture"
|
| #endif
|
|
|
| - int clone_flags = CLONE_FS | LINUX_SIGCHLD;
|
| - void* tls = nullptr;
|
| -#if defined(ARCH_CPU_X86_64) || defined(ARCH_CPU_ARM_FAMILY)
|
| - // Use CLONE_VM | CLONE_VFORK as an optimization to avoid copying page tables.
|
| - // Since clone writes to the new child's TLS before returning, we must set a
|
| - // new TLS to avoid corrupting the current process's TLS. On ARCH_CPU_X86,
|
| - // glibc performs syscalls by calling a function pointer in TLS, so we do not
|
| - // attempt this optimization.
|
| - clone_flags |= CLONE_VM | CLONE_VFORK | CLONE_SETTLS;
|
| -
|
| - char tls_buf[PTHREAD_STACK_MIN] = {0};
|
| - tls = tls_buf;
|
| -#endif
|
| -
|
| - pid = clone(ChrootToSelfFdinfo, stack, clone_flags, nullptr, nullptr, tls,
|
| - nullptr);
|
| + pid = clone(ChrootToSelfFdinfo, stack,
|
| + CLONE_VM | CLONE_VFORK | CLONE_FS | LINUX_SIGCHLD, nullptr,
|
| + nullptr, nullptr, nullptr);
|
| PCHECK(pid != -1);
|
|
|
| int status = -1;
|
|
|