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

Issue 10051022: Add an initial Linux GPU sandbox using the seccomp filter framework. (Closed)

Created:
8 years, 8 months ago by Chris Evans
Modified:
8 years, 8 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, apatrick_chromium
Visibility:
Public.

Description

Add an initial Linux GPU sandbox using the seccomp filter framework. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=132266

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 19

Patch Set 7 : #

Patch Set 8 : #

Total comments: 11

Patch Set 9 : #

Total comments: 1

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+283 lines, -4 lines) Patch
A content/common/sandbox_init_linux.cc View 1 2 3 4 5 6 7 8 9 1 chunk +263 lines, -0 lines 0 comments Download
M content/content_common.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M content/gpu/gpu_info_collector.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M content/gpu/gpu_main.cc View 1 2 3 4 5 6 7 8 9 3 chunks +13 lines, -4 lines 0 comments Download
M content/public/common/sandbox_init.h View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (0 generated)
Chris Evans
Julien, if you can concentrate on the large new file and get it to lgtm, ...
8 years, 8 months ago (2012-04-12 00:30:50 UTC) #1
Chris Evans
Ken / Al, can you have a look for the (pretty small!) change to gpu_main.cc ...
8 years, 8 months ago (2012-04-12 00:53:35 UTC) #2
Will Drewry
Awesome! https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc File content/common/sandbox_init_linux.cc (right): https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc#newcode54 content/common/sandbox_init_linux.cc:54: unsigned int syscall = context->uc_mcontext.gregs[REG_RAX]; I guess this ...
8 years, 8 months ago (2012-04-12 01:08:56 UTC) #3
Markus (顧孟勤)
I am working on a more generic sandbox that will allow us to protect the ...
8 years, 8 months ago (2012-04-12 17:51:24 UTC) #4
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc File content/common/sandbox_init_linux.cc (right): https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc#newcode37 content/common/sandbox_init_linux.cc:37: static void CheckSingleThreaded() { This is racy if potentially ...
8 years, 8 months ago (2012-04-12 17:54:14 UTC) #5
apatrick_chromium
LGTM for gpu_main.cc with one suggestion. https://chromiumcodereview.appspot.com/10051022/diff/3009/content/gpu/gpu_main.cc File content/gpu/gpu_main.cc (right): https://chromiumcodereview.appspot.com/10051022/diff/3009/content/gpu/gpu_main.cc#newcode113 content/gpu/gpu_main.cc:113: (void) base::RandInt(0, 1337); ...
8 years, 8 months ago (2012-04-12 18:36:46 UTC) #6
Chris Evans
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc File content/common/sandbox_init_linux.cc (right): https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc#newcode54 content/common/sandbox_init_linux.cc:54: unsigned int syscall = context->uc_mcontext.gregs[REG_RAX]; On 2012/04/12 01:08:56, Will ...
8 years, 8 months ago (2012-04-12 18:42:48 UTC) #7
Kees Cook
Very exciting! :) https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc File content/common/sandbox_init_linux.cc (right): https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc#newcode54 content/common/sandbox_init_linux.cc:54: unsigned int syscall = context->uc_mcontext.gregs[REG_RAX]; On ...
8 years, 8 months ago (2012-04-12 18:56:39 UTC) #8
Chris Evans
On 2012/04/12 17:51:24, Markus (顧孟勤) wrote: > I am working on a more generic sandbox ...
8 years, 8 months ago (2012-04-12 19:01:15 UTC) #9
Markus (顧孟勤)
On Thu, Apr 12, 2012 at 12:01, <cevans@chromium.org> wrote: > Awesome! It'll be a drop-in ...
8 years, 8 months ago (2012-04-12 19:42:44 UTC) #10
Chris Evans
On 2012/04/12 18:56:39, Kees Cook wrote: > Very exciting! :) > > https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc > File ...
8 years, 8 months ago (2012-04-12 19:45:18 UTC) #11
Jorge Lucangeli Obes
On 2012/04/12 19:42:44, Markus (顧孟勤) wrote: > On Thu, Apr 12, 2012 at 12:01, <mailto:cevans@chromium.org> ...
8 years, 8 months ago (2012-04-12 19:52:10 UTC) #12
Chris Evans
On 2012/04/12 18:36:46, apatrick_chromium wrote: > LGTM for gpu_main.cc with one suggestion. > > https://chromiumcodereview.appspot.com/10051022/diff/3009/content/gpu/gpu_main.cc ...
8 years, 8 months ago (2012-04-12 20:31:15 UTC) #13
Chris Evans
On 2012/04/12 17:54:14, jln wrote: > https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc > File content/common/sandbox_init_linux.cc (right): > > https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sandbox_init_linux.cc#newcode37 > ...
8 years, 8 months ago (2012-04-12 20:33:40 UTC) #14
Markus (顧孟勤)
On Thu, Apr 12, 2012 at 12:52, <jorgelo@chromium.org> wrote: > Yeah, that's the "Sandbox IPC", ...
8 years, 8 months ago (2012-04-12 20:54:28 UTC) #15
Jorge Lucangeli Obes
On 2012/04/12 20:54:28, Markus (顧孟勤) wrote: > On Thu, Apr 12, 2012 at 12:52, <mailto:jorgelo@chromium.org> ...
8 years, 8 months ago (2012-04-12 21:52:57 UTC) #16
cevans
On Thu, Apr 12, 2012 at 2:52 PM, <jorgelo@chromium.org> wrote: > On 2012/04/12 20:54:28, Markus ...
8 years, 8 months ago (2012-04-12 22:00:29 UTC) #17
jln (very slow on Chromium)
lgtm
8 years, 8 months ago (2012-04-12 22:05:05 UTC) #18
Jorge Lucangeli Obes
lgtm
8 years, 8 months ago (2012-04-12 22:07:56 UTC) #19
Kees Cook
lgtm
8 years, 8 months ago (2012-04-12 22:09:09 UTC) #20
Markus (顧孟勤)
Hold on for a minute or two. I am about to give you a little ...
8 years, 8 months ago (2012-04-12 22:12:58 UTC) #21
Markus (顧孟勤)
lgtm Overall, this looks good. There are still a couple of noticeable gaps. But we ...
8 years, 8 months ago (2012-04-12 22:22:33 UTC) #22
jln (very slow on Chromium)
https://chromiumcodereview.appspot.com/10051022/diff/12003/content/common/sandbox_init_linux.cc File content/common/sandbox_init_linux.cc (right): https://chromiumcodereview.appspot.com/10051022/diff/12003/content/common/sandbox_init_linux.cc#newcode189 content/common/sandbox_init_linux.cc:189: EmitAllowSyscall(__NR_restart_syscall, program); On 2012/04/12 22:22:33, Markus (顧孟勤) wrote: > ...
8 years, 8 months ago (2012-04-12 22:36:46 UTC) #23
Markus (顧孟勤)
I wrote a simple little test program. And no matter what I throw at it, ...
8 years, 8 months ago (2012-04-12 23:25:27 UTC) #24
cevans
On Thu, Apr 12, 2012 at 4:25 PM, Markus Gutschke <markus@chromium.org>wrote: > I wrote a ...
8 years, 8 months ago (2012-04-12 23:28:19 UTC) #25
Markus (顧孟勤)
strace() output is not necessarily to be trusted in this situation. For instance, strace can ...
8 years, 8 months ago (2012-04-12 23:35:24 UTC) #26
cevans
On Thu, Apr 12, 2012 at 4:34 PM, Markus Gutschke <markus@chromium.org>wrote: > strace() output is ...
8 years, 8 months ago (2012-04-12 23:36:05 UTC) #27
Chris Evans
On 2012/04/12 22:22:33, Markus (顧孟勤) wrote: > lgtm > > Overall, this looks good. There ...
8 years, 8 months ago (2012-04-12 23:52:42 UTC) #28
Markus (顧孟勤)
On Thu, Apr 12, 2012 at 16:52, <cevans@chromium.org> wrote: > Do you mind if we ...
8 years, 8 months ago (2012-04-13 00:06:16 UTC) #29
Markus (顧孟勤)
On Thu, Apr 12, 2012 at 16:36, Chris Evans <cevans@google.com> wrote: > On Thu, Apr ...
8 years, 8 months ago (2012-04-13 00:09:07 UTC) #30
cevans
On Thu, Apr 12, 2012 at 5:08 PM, Markus Gutschke <markus@chromium.org>wrote: > On Thu, Apr ...
8 years, 8 months ago (2012-04-13 00:11:46 UTC) #31
Markus (顧孟勤)
That would help. I am trying to reproduce, but I don't have any luck yet. ...
8 years, 8 months ago (2012-04-13 00:12:52 UTC) #32
cevans
On Thu, Apr 12, 2012 at 5:12 PM, Markus Gutschke <markus@chromium.org>wrote: > That would help. ...
8 years, 8 months ago (2012-04-13 00:24:53 UTC) #33
cevans
On Thu, Apr 12, 2012 at 5:24 PM, Chris Evans <cevans@google.com> wrote: > On Thu, ...
8 years, 8 months ago (2012-04-13 00:25:54 UTC) #34
jln (very slow on Chromium)
On Thu, Apr 12, 2012 at 5:25 PM, Chris Evans <cevans@google.com> wrote: > On Thu, ...
8 years, 8 months ago (2012-04-13 00:28:41 UTC) #35
Markus (顧孟勤)
Yes, Julien figured it out. If you are stuck in a call to nanosleep() and ...
8 years, 8 months ago (2012-04-13 00:35:33 UTC) #36
Will Drewry
On 2012/04/13 00:35:33, Markus (顧孟勤) wrote: > Yes, Julien figured it out. If you are ...
8 years, 8 months ago (2012-04-13 02:53:15 UTC) #37
jam
http://codereview.chromium.org/10051022/diff/14004/content/public/common/sandbox_init.h File content/public/common/sandbox_init.h (right): http://codereview.chromium.org/10051022/diff/14004/content/public/common/sandbox_init.h#newcode50 content/public/common/sandbox_init.h:50: CONTENT_EXPORT void InitializeSandbox(); since this isn't called by outside ...
8 years, 8 months ago (2012-04-13 05:57:58 UTC) #38
cevans
On Thu, Apr 12, 2012 at 10:57 PM, <jam@chromium.org> wrote: > > http://codereview.chromium.**org/10051022/diff/14004/** > content/public/common/sandbox_**init.h<http://codereview.chromium.org/10051022/diff/14004/content/public/common/sandbox_init.h> ...
8 years, 8 months ago (2012-04-13 06:34:18 UTC) #39
jam
On 2012/04/13 06:34:18, cevans wrote: > On Thu, Apr 12, 2012 at 10:57 PM, <mailto:jam@chromium.org> ...
8 years, 8 months ago (2012-04-13 06:37:56 UTC) #40
cevans
On Thu, Apr 12, 2012 at 11:37 PM, <jam@chromium.org> wrote: > On 2012/04/13 06:34:18, cevans ...
8 years, 8 months ago (2012-04-13 06:47:12 UTC) #41
jam
On 2012/04/13 06:47:12, cevans wrote: > On Thu, Apr 12, 2012 at 11:37 PM, <mailto:jam@chromium.org> ...
8 years, 8 months ago (2012-04-13 18:06:50 UTC) #42
Chris Evans
8 years, 8 months ago (2012-04-13 20:37:00 UTC) #43
On 2012/04/12 01:08:56, Will Drewry wrote:
> Awesome!
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sand...
> File content/common/sandbox_init_linux.cc (right):
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sand...
> content/common/sandbox_init_linux.cc:54: unsigned int syscall =
> context->uc_mcontext.gregs[REG_RAX];
> I guess this is easier than wrangling asm/siginfo?
> What other info will end up in the dump? Do you want to prime the crash dump
> with other data or are you hoping unwinding will cover all that?
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sand...
> content/common/sandbox_init_linux.cc:133: static void
> EmitKill(std::vector<struct sock_filter>* program) {
> nit: Any reason not to call it EmitLoggedKill?  Then if you add a
> SECCOMP_RET_KILL call, it'll just be EmitKill :)
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sand...
> content/common/sandbox_init_linux.cc:143: static void
> ApplyGPUPolicy(std::vector<struct sock_filter>* program) {
> Is the plan to tighten this up further later?
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/common/sand...
> content/common/sandbox_init_linux.cc:199: }
> An authoritative check would be:
>   ret = prctl(PR_SET_SECCOMP, 2, NULL);
>   if (ret != 0 && errno == EFAULT)
>     return true;
>   return false;
> 
> but no_new_privs is a good guard too since it is required.  The only ugly bit
is
> that now your CanUse function has side effects :)
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/gpu/gpu_mai...
> File content/gpu/gpu_main.cc (right):
> 
>
https://chromiumcodereview.appspot.com/10051022/diff/3009/content/gpu/gpu_mai...
> content/gpu/gpu_main.cc:111: if (gpu_info.vendor_id == 0x1002) {  // ATI
> Any chance we can get intel in here?

Just an update for completeness: I'm going to land for all graphics cards. I got
my hand on an nvidia card and all was fine. Intel is blacklisted for desktop
Linux anyway, so we're all set for ChromeOS once the ChromeOS kernel patch lands
:D

Powered by Google App Engine
This is Rietveld 408576698