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

Issue 276443003: NaCl: Add sanity check for number of open FDs at startup (Closed)

Created:
6 years, 7 months ago by Mark Seaborn
Modified:
6 years, 7 months ago
CC:
chromium-reviews, agl, jln+watch_chromium.org, elijahtaylor1, hidehiko, hamaji
Visibility:
Public.

Description

NaCl: Add sanity check for number of open FDs at startup This is primarily for Non-SFI NaCl, where leaking FDs would be a security hole. For SFI NaCl, this is just for defence in depth. I've put the check just before enabling the seccomp-bpf sandbox. This guards against creation of unusual FDs, e.g. via epoll_create(), which might happen even after enabling the SUID sandbox (which mostly disables open()). BUG=358719 TEST=browser_tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271583

Patch Set 1 #

Total comments: 13

Patch Set 2 : Review #

Total comments: 4

Patch Set 3 : Review #

Patch Set 4 : Simplify as suggested in review #

Total comments: 4

Patch Set 5 : Review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -7 lines) Patch
M components/nacl/loader/sandbox_linux/nacl_sandbox_linux.h View 1 3 chunks +8 lines, -0 lines 0 comments Download
M components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc View 1 2 2 chunks +26 lines, -7 lines 0 comments Download
M sandbox/linux/services/credentials.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M sandbox/linux/services/credentials.cc View 1 1 chunk +29 lines, -0 lines 0 comments Download
M sandbox/linux/services/credentials_unittest.cc View 1 2 3 4 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
Mark Seaborn
6 years, 7 months ago (2014-05-07 22:13:07 UTC) #1
jln (very slow on Chromium)
Looks good! The only requirement is to add a unittest for the new Credentials method. ...
6 years, 7 months ago (2014-05-07 23:08:24 UTC) #2
jln (very slow on Chromium)
https://codereview.chromium.org/276443003/diff/1/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc (right): https://codereview.chromium.org/276443003/diff/1/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc#newcode106 components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc:106: // browser process, kPrimaryIPCChannel. Sorry, was confused with kSandboxIPCChannel. ...
6 years, 7 months ago (2014-05-07 23:17:02 UTC) #3
Mark Seaborn
https://codereview.chromium.org/276443003/diff/1/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc (right): https://codereview.chromium.org/276443003/diff/1/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc#newcode97 components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc:97: if (setuid_sandbox_client_->IsSuidSandboxChild()) { On 2014/05/07 23:08:24, jln wrote: > ...
6 years, 7 months ago (2014-05-09 22:02:31 UTC) #4
jln (very slow on Chromium)
> Or feel free to mimic the API offered by HasOpenDirectory() and allow -1 for ...
6 years, 7 months ago (2014-05-09 23:55:23 UTC) #5
jln (very slow on Chromium)
lgtm, but please fix the ScopedFD.
6 years, 7 months ago (2014-05-09 23:55:59 UTC) #6
jln (very slow on Chromium)
Mark, ping? It would be nice to land this soon :)
6 years, 7 months ago (2014-05-19 21:35:37 UTC) #7
Mark Seaborn
https://codereview.chromium.org/276443003/diff/20001/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc File components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc (right): https://codereview.chromium.org/276443003/diff/20001/components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc#newcode106 components/nacl/loader/sandbox_linux/nacl_sandbox_linux.cc:106: CHECK_EQ(credentials.CountOpenFds(proc_fd_.get()), 7); On 2014/05/09 23:55:24, jln wrote: > Nit: ...
6 years, 7 months ago (2014-05-19 21:38:21 UTC) #8
jln (very slow on Chromium)
lgtm with a small nit. https://codereview.chromium.org/276443003/diff/60001/sandbox/linux/services/credentials_unittest.cc File sandbox/linux/services/credentials_unittest.cc (right): https://codereview.chromium.org/276443003/diff/60001/sandbox/linux/services/credentials_unittest.cc#newcode61 sandbox/linux/services/credentials_unittest.cc:61: base::ScopedFD proc_fd(open("/proc", O_RDONLY | ...
6 years, 7 months ago (2014-05-19 21:47:24 UTC) #9
Mark Seaborn
https://codereview.chromium.org/276443003/diff/60001/sandbox/linux/services/credentials_unittest.cc File sandbox/linux/services/credentials_unittest.cc (right): https://codereview.chromium.org/276443003/diff/60001/sandbox/linux/services/credentials_unittest.cc#newcode61 sandbox/linux/services/credentials_unittest.cc:61: base::ScopedFD proc_fd(open("/proc", O_RDONLY | O_DIRECTORY)); On 2014/05/19 21:47:24, jln ...
6 years, 7 months ago (2014-05-19 22:06:11 UTC) #10
Mark Seaborn
The CQ bit was checked by mseaborn@chromium.org
6 years, 7 months ago (2014-05-20 00:09:49 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mseaborn@chromium.org/276443003/70001
6 years, 7 months ago (2014-05-20 00:10:38 UTC) #12
commit-bot: I haz the power
6 years, 7 months ago (2014-05-20 06:23:56 UTC) #13
Message was sent while issue was closed.
Change committed as 271583

Powered by Google App Engine
This is Rietveld 408576698