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

Unified Diff: components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc

Issue 1158133003: Fix duplicate symbol in ARM build of nacl_helper_nonsfi_unittests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc
diff --git a/components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc b/components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc
index 53ea1ab94afce7a24bf3ee1f0bf23e8378065cd6..acfc1270149ddfed5852ff2c3d4119da12f83c27 100644
--- a/components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc
+++ b/components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc
@@ -202,7 +202,7 @@ BPF_DEATH_TEST_C(NaClNonSfiSandboxTest,
#if defined(OS_NACL_NONSFI)
BPF_DEATH_TEST_C(NaClNonsfiSandboxTest,
- socketpair,
+ socketpair_af_unix_disallowed,
DEATH_SEGV_MESSAGE(sandbox::GetErrorMessageContentForTests()),
nacl::nonsfi::NaClNonSfiBPFSandboxPolicy) {
int tmp_fds[2];
@@ -229,6 +229,19 @@ BPF_TEST_C(NaClNonSfiSandboxTest,
}
#endif
+// On arm and x86_64 the arguments to socketpair are passed in registers,
+// so they can be filtered by seccomp-bpf. This filter cannot be applied
+// on x86_32 as the arguments are passed in memory.
+#if defined(__x86_64__) || defined(__arm__)
+BPF_DEATH_TEST_C(NaClNonSfiSandboxTest,
+ socketpair_af_inet_disallowed,
+ DEATH_SEGV_MESSAGE(sandbox::GetErrorMessageContentForTests()),
+ nacl::nonsfi::NaClNonSfiBPFSandboxPolicy) {
+ int fds[2];
+ socketpair(AF_INET, SOCK_STREAM, 0, fds);
+}
+#endif
+
BPF_DEATH_TEST_C(NaClNonSfiSandboxTest,
accept,
DEATH_SEGV_MESSAGE(sandbox::GetErrorMessageContentForTests()),
@@ -393,16 +406,6 @@ BPF_DEATH_TEST_C(NaClNonSfiSandboxTest,
#endif
}
-#if defined(__x86_64__) || defined(__arm__)
-BPF_DEATH_TEST_C(NaClNonSfiSandboxTest,
- socketpair,
- DEATH_SEGV_MESSAGE(sandbox::GetErrorMessageContentForTests()),
- nacl::nonsfi::NaClNonSfiBPFSandboxPolicy) {
- int fds[2];
- socketpair(AF_INET, SOCK_STREAM, 0, fds);
-}
-#endif
-
BPF_TEST_C(NaClNonSfiSandboxTest,
fcntl_SETFD_allowed,
nacl::nonsfi::NaClNonSfiBPFSandboxPolicy) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698