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

Issue 669055: Add support for running the NaCl plugin in the Linux SUID sandbox (Closed)

Created:
10 years, 9 months ago by Mark Seaborn
Modified:
9 years, 5 months ago
CC:
chromium-reviews_googlegroups.com, jam+cc_chromium.org, brettw+cc_chromium.org, ben+cc_chromium.org, John Grabowski, darin-cc_chromium.org, Paweł Hajdan Jr., pam+watch_chromium.org, native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Add support for running the NaCl plugin in the Linux SUID sandbox * Add a function for getting the pre-opened FD for /dev/urandom. This needs to be a C function because it will be used by nacl_secure_random.c. * Add an IPC message for creating shared memory segments, since /dev/shm is not available inside the sandbox. BUG=36676 TEST=nacl_ui_tests in conjunction with NaCl changes

Patch Set 1 #

Total comments: 12

Patch Set 2 : Move function into namespace; use uint32 #

Patch Set 3 : Removed tab char; removed change to test (which assumed the NaCl-side change) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -6 lines) Patch
A base/rand_util_c.h View 1 chunk +20 lines, -0 lines 0 comments Download
M base/rand_util_posix.cc View 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_sandbox_host_linux.cc View 1 2 3 chunks +16 lines, -0 lines 0 comments Download
M chrome/common/sandbox_methods_linux.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/renderer_sandbox_support_linux.h View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/renderer/renderer_sandbox_support_linux.cc View 1 4 chunks +20 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
Mark Seaborn
The corresponding NaCl change is http://codereview.chromium.org/669056
10 years, 9 months ago (2010-03-04 10:55:53 UTC) #1
agl
LGTM http://codereview.chromium.org/669055/diff/1/2 File base/rand_util_c.h (right): http://codereview.chromium.org/669055/diff/1/2#newcode14 base/rand_util_c.h:14: int GetUrandomFD(void); There's C and then there's 20 ...
10 years, 9 months ago (2010-03-04 15:05:32 UTC) #2
Mark Seaborn
http://codereview.chromium.org/669055/diff/1/2 File base/rand_util_c.h (right): http://codereview.chromium.org/669055/diff/1/2#newcode14 base/rand_util_c.h:14: int GetUrandomFD(void); On 2010/03/04 15:05:33, agl wrote: > There's ...
10 years, 9 months ago (2010-03-04 16:37:35 UTC) #3
agl
LGTM http://codereview.chromium.org/669055/diff/1/4 File chrome/browser/renderer_host/render_sandbox_host_linux.cc (right): http://codereview.chromium.org/669055/diff/1/4#newcode341 chrome/browser/renderer_host/render_sandbox_host_linux.cc:341: base::SharedMemory shm; On 2010/03/04 16:37:35, mseaborn1 wrote: > ...
10 years, 9 months ago (2010-03-04 16:42:29 UTC) #4
Mark Schneckloth
LGTM
10 years, 9 months ago (2010-03-04 17:35:25 UTC) #5
gregoryd
LGTM
10 years, 9 months ago (2010-03-04 17:44:12 UTC) #6
Mark Seaborn
Adam, can you commit this on my behalf? I'm not a Chromium committer yet. (Jeremy ...
10 years, 9 months ago (2010-03-04 18:40:44 UTC) #7
agl
On Thu, Mar 4, 2010 at 1:40 PM, <mseaborn@chromium.org> wrote: > Adam, can you commit ...
10 years, 9 months ago (2010-03-04 18:42:45 UTC) #8
agl
On Thu, Mar 4, 2010 at 1:42 PM, Adam Langley <agl@chromium.org> wrote: > On Thu, ...
10 years, 9 months ago (2010-03-04 20:24:14 UTC) #9
Mark Seaborn
On 2010/03/04 16:42:29, agl wrote: > On 2010/03/04 16:37:35, mseaborn1 wrote: > > Do you ...
10 years, 9 months ago (2010-03-05 14:12:19 UTC) #10
agl
10 years, 9 months ago (2010-03-05 15:39:47 UTC) #11
On Fri, Mar 5, 2010 at 9:12 AM,  <mseaborn@chromium.org> wrote:
> We wouldn't be limiting the authority of the renderer with a check in the
> browser's make_shm() method because the renderer can still do ftruncate() to
> enlarge the segment.

With the SUID sandbox we can't stop that of course. However, with the
seccomp sandbox (or some other ones) we could stop the renderer from
calling ftruncate, so it's worth thinking about.

> Maybe in
> the
> future, with the seccomp sandbox, we can disable ftruncate() inside the
> sandbox.

Exactly, with the SUID sandbox we can't stop it. With the seccomp
sandbox (or SELinux etc) we could, so it's worth thinking about.

> BTW it won't just be compromised renderers that can call this.  Native
> Client
> processes can create shared memory segments.

Good to know.

> Maybe we should attempt to do resource accountability and have an overall
> limit
> on the space that a renderer or its associated NaCl processes can consume,
> but
> AFAIK we don't have any story for how to decide what such limits should be.

Indeed. I'm not saying that we need it right now, but at some point
it's probably a good idea.


AGL

Powered by Google App Engine
This is Rietveld 408576698