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

Issue 800183004: Add a ForkWithFlags wrapper using the libc clone wrapper. (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

Add a ForkWithFlags wrapper using the libc clone wrapper. sys_clone directly invokes the syscall, which does 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. This is a 2nd attempt at crrev.com/801033002, which caused failures under valgrind and FORTIFY_SOURCE. BUG=312380, 442817, 442912 Committed: https://crrev.com/9eb564175dbd452196f782da2b28e3e8e79c49a5 Cr-Commit-Position: refs/heads/master@{#308744}

Patch Set 1 #

Total comments: 11

Patch Set 2 : Respond to comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -14 lines) Patch
M sandbox/linux/services/syscall_wrappers.h View 1 2 chunks +17 lines, -3 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.cc View 1 3 chunks +87 lines, -11 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers_unittest.cc View 2 chunks +31 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
rickyz (no longer on Chrome)
All right, here's a 2nd attempt of ForkWithFlags with Valgrind and FORTIFY_SOURCE workarounds.
6 years ago (2014-12-17 02:13:24 UTC) #2
jln (very slow on Chromium)
lgtm with a few nits. https://codereview.chromium.org/800183004/diff/1/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/800183004/diff/1/sandbox/linux/services/syscall_wrappers.cc#newcode73 sandbox/linux/services/syscall_wrappers.cc:73: namespace { It's not ...
6 years ago (2014-12-17 02:23:42 UTC) #3
rickyz (no longer on Chrome)
https://codereview.chromium.org/800183004/diff/1/sandbox/linux/services/syscall_wrappers.cc File sandbox/linux/services/syscall_wrappers.cc (right): https://codereview.chromium.org/800183004/diff/1/sandbox/linux/services/syscall_wrappers.cc#newcode73 sandbox/linux/services/syscall_wrappers.cc:73: namespace { On 2014/12/17 02:23:42, jln wrote: > It's ...
6 years ago (2014-12-17 02:31:34 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/800183004/20001
6 years ago (2014-12-17 03:44:18 UTC) #6
commit-bot: I haz the power
Committed patchset #2 (id:20001)
6 years ago (2014-12-17 04:33:30 UTC) #7
commit-bot: I haz the power
6 years ago (2014-12-17 04:34:18 UTC) #8
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/9eb564175dbd452196f782da2b28e3e8e79c49a5
Cr-Commit-Position: refs/heads/master@{#308744}

Powered by Google App Engine
This is Rietveld 408576698