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

Side by Side Diff: chrome/test/security_tests/sandbox_browsertest_linux.cc

Issue 101773003: Linux sandbox: cleanup sandbox-bpf naming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address namespace sandbox nits. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | components/nacl/loader/nacl_helper_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/base/in_process_browser_test.h" 5 #include "chrome/test/base/in_process_browser_test.h"
6 #include "content/public/browser/zygote_host_linux.h" 6 #include "content/public/browser/zygote_host_linux.h"
7 #include "content/public/common/sandbox_linux.h" 7 #include "content/public/common/sandbox_linux.h"
8 8
9 typedef InProcessBrowserTest SandboxLinuxTest; 9 typedef InProcessBrowserTest SandboxLinuxTest;
10 10
11 // Both the SUID sandbox (http://crbug.com/137653) and the Seccomp-BPF sandbox 11 // Both the SUID sandbox (http://crbug.com/137653) and the Seccomp-BPF sandbox
12 // are currently incompatible with ASan. 12 // are currently incompatible with ASan.
13 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) 13 #if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER)
14 #define MAYBE_SandboxStatus \ 14 #define MAYBE_SandboxStatus \
15 SandboxStatus 15 SandboxStatus
16 #else 16 #else
17 #define MAYBE_SandboxStatus \ 17 #define MAYBE_SandboxStatus \
18 DISABLED_SandboxStatus 18 DISABLED_SandboxStatus
19 #endif 19 #endif
20 20
21 IN_PROC_BROWSER_TEST_F(SandboxLinuxTest, MAYBE_SandboxStatus) { 21 IN_PROC_BROWSER_TEST_F(SandboxLinuxTest, MAYBE_SandboxStatus) {
22 // Get expected sandboxing status of renderers. 22 // Get expected sandboxing status of renderers.
23 const int status = content::ZygoteHost::GetInstance()->GetSandboxStatus(); 23 const int status = content::ZygoteHost::GetInstance()->GetSandboxStatus();
24 24
25 // The setuid sandbox is required as our first-layer sandbox. 25 // The setuid sandbox is required as our first-layer sandbox.
26 bool good_layer1 = status & content::kSandboxLinuxSUID && 26 bool good_layer1 = status & content::kSandboxLinuxSUID &&
27 status & content::kSandboxLinuxPIDNS && 27 status & content::kSandboxLinuxPIDNS &&
28 status & content::kSandboxLinuxNetNS; 28 status & content::kSandboxLinuxNetNS;
29 // A second-layer sandbox is also required to be adequately sandboxed. 29 // A second-layer sandbox is also required to be adequately sandboxed.
30 bool good_layer2 = status & content::kSandboxLinuxSeccompBpf; 30 bool good_layer2 = status & content::kSandboxLinuxSeccompBPF;
31 31
32 EXPECT_TRUE(good_layer1); 32 EXPECT_TRUE(good_layer1);
33 EXPECT_TRUE(good_layer2); 33 EXPECT_TRUE(good_layer2);
34 } 34 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/about_ui.cc ('k') | components/nacl/loader/nacl_helper_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698