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

Issue 9295005: Calling clone(CLONE_NEWPID) results in the new pid namespace getting a new "init" process. (Closed)

Created:
8 years, 11 months ago by Markus (顧孟勤)
Modified:
8 years, 10 months ago
Reviewers:
agl
CC:
chromium-reviews, agl
Visibility:
Public.

Description

Calling clone(CLONE_NEWPID) results in the new pid namespace getting a new "init" process. This process is now resposible for reaping all child processes that no longer have a direct parent process. Often, failure to do this goes unnoticed, because our sandbox'd processes don't often fork other processes that then continue to turn into daemon processes. But there is no reason, why they couldn't occasionally do so. And in fact, the seccomp sandbox does do so for its trusted process. In the past, this would result in us having lots of uncollected zombie processes that only disappeared when the browser terminated. BUG=109944 TEST=Run Chrome with both the suid sandbox and the seccomp sandbox, open and close a few tabs, verify that we don't produce any zombie processes Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=119746

Patch Set 1 #

Total comments: 10

Patch Set 2 : Address AGL's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -47 lines) Patch
A sandbox/linux/suid/init_process.h View 1 chunk +11 lines, -0 lines 0 comments Download
A sandbox/linux/suid/init_process.c View 1 1 chunk +201 lines, -0 lines 0 comments Download
M sandbox/linux/suid/sandbox.c View 1 12 chunks +131 lines, -47 lines 0 comments Download
M sandbox/sandbox.gyp View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Markus (顧孟勤)
It looks as if we were using CLONE_NEWPID differently from how it was intended to ...
8 years, 11 months ago (2012-01-27 02:51:15 UTC) #1
agl
https://chromiumcodereview.appspot.com/9295005/diff/1/sandbox/linux/suid/init_process.c File sandbox/linux/suid/init_process.c (right): https://chromiumcodereview.appspot.com/9295005/diff/1/sandbox/linux/suid/init_process.c#newcode143 sandbox/linux/suid/init_process.c:143: sa.sa_flags = SA_RESTART | SA_SIGINFO; you setup a sigaction ...
8 years, 11 months ago (2012-01-27 15:14:32 UTC) #2
Markus (顧孟勤)
https://chromiumcodereview.appspot.com/9295005/diff/1/sandbox/linux/suid/init_process.c File sandbox/linux/suid/init_process.c (right): https://chromiumcodereview.appspot.com/9295005/diff/1/sandbox/linux/suid/init_process.c#newcode143 sandbox/linux/suid/init_process.c:143: sa.sa_flags = SA_RESTART | SA_SIGINFO; Good call. There was ...
8 years, 11 months ago (2012-01-27 17:44:09 UTC) #3
agl
8 years, 10 months ago (2012-01-30 22:10:57 UTC) #4
lgtm

Powered by Google App Engine
This is Rietveld 408576698