Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(654)

Issue 801033002: Use the libc clone wrapper in sys_clone. (Closed)

Created:
6 years ago by rickyz (no longer on Chrome)
Modified:
6 years ago
CC:
chromium-reviews, jln+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use the libc clone wrapper in sys_clone. Previously, we directly invoked the syscall, which would not update libc's PID cache in the child. Although the libc wrapper function updates the PID cache, it unfortunately requires that the child run on a different stack, even if CLONE_VM is not specified. We work around this by briefly switching stacks in the child, then using longjmp to switch back. This gives us a version of clone with fork-like behavior, which is what we need for starting processes in new namespaces. BUG=312380 Committed: https://crrev.com/d8a593bceaf0a4b38d06a8c13b948202d205f1b6 Cr-Commit-Position: refs/heads/master@{#308510}

Patch Set 1 #

Patch Set 2 : Rebase #

Total comments: 19

Patch Set 3 : Respond to comments. #

Patch Set 4 : Hardcode supported architectures. #

Patch Set 5 : Fix typo. #

Total comments: 1

Patch Set 6 : Use macros from build_config.h #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -18 lines) Patch
M sandbox/linux/services/syscall_wrappers.h View 1 2 2 chunks +9 lines, -3 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.cc View 1 2 3 4 5 3 chunks +43 lines, -13 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers_unittest.cc View 1 2 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
rickyz (no longer on Chrome)
Here's the change for the clone setjmp/longjmp thing. It also changes the interface to disallow ...
6 years ago (2014-12-15 20:02:00 UTC) #2
mdempsky
lgtm https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc#newcode67 sandbox/linux/services/syscall_wrappers.cc:67: return clone(&clone_helper, stack + sizeof(stack), flags, &env, ptid, ...
6 years ago (2014-12-15 20:30:08 UTC) #3
mdempsky
On 2014/12/15 20:30:08, mdempsky wrote: > "stack + sizeof(stack)" is technically wrong on stack-grows-down architectures ...
6 years ago (2014-12-15 20:30:26 UTC) #4
jln (very slow on Chromium)
https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc#newcode32 sandbox/linux/services/syscall_wrappers.cc:32: int clone_helper(void* arg) { Style: CloneHelper Also add a ...
6 years ago (2014-12-15 23:31:36 UTC) #5
mdempsky
https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc#newcode67 sandbox/linux/services/syscall_wrappers.cc:67: return clone(&clone_helper, stack + sizeof(stack), flags, &env, ptid, tls, ...
6 years ago (2014-12-15 23:55:01 UTC) #6
rickyz (no longer on Chrome)
https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc#newcode32 sandbox/linux/services/syscall_wrappers.cc:32: int clone_helper(void* arg) { On 2014/12/15 23:31:35, jln wrote: ...
6 years ago (2014-12-16 00:35:09 UTC) #7
jln (very slow on Chromium)
https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc#newcode67 sandbox/linux/services/syscall_wrappers.cc:67: return clone(&clone_helper, stack + sizeof(stack), flags, &env, ptid, tls, ...
6 years ago (2014-12-16 01:11:22 UTC) #8
rickyz (no longer on Chrome)
https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/20001/sandbox/linux/services/syscall_wrappers.cc#newcode67 sandbox/linux/services/syscall_wrappers.cc:67: return clone(&clone_helper, stack + sizeof(stack), flags, &env, ptid, tls, ...
6 years ago (2014-12-16 01:30:08 UTC) #9
jln (very slow on Chromium)
lgtm https://codereview.chromium.org/801033002/diff/80001/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/801033002/diff/80001/sandbox/linux/services/syscall_wrappers.cc#newcode71 sandbox/linux/services/syscall_wrappers.cc:71: #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ ...
6 years ago (2014-12-16 01:37:51 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/801033002/100001
6 years ago (2014-12-16 01:44:28 UTC) #12
commit-bot: I haz the power
Committed patchset #6 (id:100001)
6 years ago (2014-12-16 02:40:25 UTC) #13
commit-bot: I haz the power
6 years ago (2014-12-16 02:41:30 UTC) #14
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/d8a593bceaf0a4b38d06a8c13b948202d205f1b6
Cr-Commit-Position: refs/heads/master@{#308510}

Powered by Google App Engine
This is Rietveld 408576698