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

Issue 840893003: Move ForkWithFlags from sandbox/ to base/ and plug it into LaunchProcess. (Closed)

Created:
5 years, 11 months ago by rickyz (no longer on Chrome)
Modified:
5 years, 11 months ago
CC:
chromium-reviews, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, 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

Move ForkWithFlags from sandbox/ to base/ and plug it into LaunchProcess. ForkWithFlags is a wrapper around the clone syscall that uses the libc clone wrapper, and thus updates the libc's pid cache if it has one (using sys_clone directly does not update the pid cache, so getpid may return an incorrect result in the child). This exposes the ability to set clone flags, which is needed to use Linux namespaces. BUG=312380 Committed: https://crrev.com/f1eb9ccb53367a38340b05caa74769c7b492ad73 Cr-Commit-Position: refs/heads/master@{#311356}

Patch Set 1 #

Patch Set 2 : Correct namespaces support check, move over ForkWithFlags test. #

Total comments: 2

Patch Set 3 : Use RAW_CHECK in the child. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+204 lines, -130 lines) Patch
M base/process/launch.h View 1 chunk +3 lines, -0 lines 0 comments Download
M base/process/launch_posix.cc View 1 chunk +11 lines, -1 line 0 comments Download
M base/process/process.h View 1 chunk +19 lines, -0 lines 1 comment Download
M base/process/process_linux.cc View 3 chunks +92 lines, -0 lines 0 comments Download
M base/process/process_unittest.cc View 1 2 2 chunks +70 lines, -0 lines 0 comments Download
M base/process/process_util_unittest.cc View 1 chunk +2 lines, -4 lines 0 comments Download
M content/zygote/zygote_linux.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sandbox/linux/services/syscall_wrappers.h View 1 chunk +0 lines, -12 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers.cc View 3 chunks +6 lines, -83 lines 0 comments Download
M sandbox/linux/services/syscall_wrappers_unittest.cc View 1 chunk +0 lines, -29 lines 0 comments Download

Messages

Total messages: 17 (4 generated)
rickyz (no longer on Chrome)
As discussed, added detection for namespaces support, and moved over the ForkWithFlags test as well.
5 years, 11 months ago (2015-01-07 22:39:05 UTC) #2
rickyz (no longer on Chrome)
On 2015/01/07 22:39:05, rickyz wrote: > As discussed, added detection for namespaces support, and moved ...
5 years, 11 months ago (2015-01-12 20:13:53 UTC) #3
jln (very slow on Chromium)
https://codereview.chromium.org/840893003/diff/20001/base/process/process_unittest.cc File base/process/process_unittest.cc (right): https://codereview.chromium.org/840893003/diff/20001/base/process/process_unittest.cc#newcode260 base/process/process_unittest.cc:260: CHECK(syscall(__NR_getpid) == ctid); I think it'd be more robust ...
5 years, 11 months ago (2015-01-12 20:26:51 UTC) #4
rickyz (no longer on Chrome)
https://codereview.chromium.org/840893003/diff/20001/base/process/process_unittest.cc File base/process/process_unittest.cc (right): https://codereview.chromium.org/840893003/diff/20001/base/process/process_unittest.cc#newcode260 base/process/process_unittest.cc:260: CHECK(syscall(__NR_getpid) == ctid); On 2015/01/12 20:26:50, jln wrote: > ...
5 years, 11 months ago (2015-01-12 21:37:51 UTC) #5
jln (very slow on Chromium)
lgtm
5 years, 11 months ago (2015-01-12 22:58:21 UTC) #6
rickyz (no longer on Chrome)
Readding Mark for base/ OWNERS. Some background on why the previous attempt's test failed: I ...
5 years, 11 months ago (2015-01-12 23:40:38 UTC) #8
Mark Mentovai
LGTM
5 years, 11 months ago (2015-01-13 21:51:03 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/840893003/40001
5 years, 11 months ago (2015-01-13 21:55:04 UTC) #11
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 11 months ago (2015-01-13 23:00:22 UTC) #12
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/f1eb9ccb53367a38340b05caa74769c7b492ad73 Cr-Commit-Position: refs/heads/master@{#311356}
5 years, 11 months ago (2015-01-13 23:01:30 UTC) #13
rvargas (doing something else)
https://codereview.chromium.org/840893003/diff/40001/base/process/process.h File base/process/process.h (right): https://codereview.chromium.org/840893003/diff/40001/base/process/process.h#newcode131 base/process/process.h:131: BASE_EXPORT pid_t ForkWithFlags(unsigned long flags, pid_t* ptid, pid_t* ctid); ...
5 years, 11 months ago (2015-01-15 23:27:32 UTC) #15
jln (very slow on Chromium)
On 2015/01/15 23:27:32, rvargas wrote: > https://codereview.chromium.org/840893003/diff/40001/base/process/process.h > File base/process/process.h (right): > > https://codereview.chromium.org/840893003/diff/40001/base/process/process.h#newcode131 > ...
5 years, 11 months ago (2015-01-16 00:57:07 UTC) #16
rickyz (no longer on Chrome)
5 years, 11 months ago (2015-01-16 01:00:44 UTC) #17
Message was sent while issue was closed.
On 2015/01/16 00:57:07, jln wrote:
> On 2015/01/15 23:27:32, rvargas wrote:
> > https://codereview.chromium.org/840893003/diff/40001/base/process/process.h
> > File base/process/process.h (right):
> > 
> >
>
https://codereview.chromium.org/840893003/diff/40001/base/process/process.h#n...
> > base/process/process.h:131: BASE_EXPORT pid_t ForkWithFlags(unsigned long
> flags,
> > pid_t* ptid, pid_t* ctid);
> > I don't think this function belongs to this file. Either it is rewritten so
> that
> > it returns a Process, or it is moved to launch.h (which looks like a more
> > natural place for it anyway)
> 
> Yeah, that seems reasonable to me. Ricky?

Sure thing, will send a CL to move it in a bit (might be slightly slow due to
traveling).

Powered by Google App Engine
This is Rietveld 408576698