summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_sync_channel_unittest.cc
diff options
context:
space:
mode:
authorhidehiko <hidehiko@chromium.org>2014-12-10 19:51:21 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-11 03:51:53 +0000
commit20a9a3ad484caea1f97b9c8824a79a5c8bf8a958 (patch)
treeee76cbf4896ba04a36c559962f6b8d51dc11f86c /ipc/ipc_sync_channel_unittest.cc
parent2ff1341a5b3dc65806b7c6b294240a3f05fe8a81 (diff)
downloadchromium_src-20a9a3ad484caea1f97b9c8824a79a5c8bf8a958.zip
chromium_src-20a9a3ad484caea1f97b9c8824a79a5c8bf8a958.tar.gz
chromium_src-20a9a3ad484caea1f97b9c8824a79a5c8bf8a958.tar.bz2
Non-SFI mode: Use dummy PID for NaCl's IPC channel and IPC channel on Linux platform.
We do not want to expose PID from process on Linux, because it does not play any security role. Specifically, in NaCl processes, now although getpid() syscall is prohibited by seccomp sandbox, it looks working, probably because of the cache in libc layer. By this CL, Linux IPC, including nacl_helper_nonsfi, uses dummy PID (-1). Note; as for nacl_helper process, currently, the process is under PID namespace, so "dummy-like-" PID is already used. BUG=358465 TEST=Ran trybot. Review URL: https://codereview.chromium.org/695353005 Cr-Commit-Position: refs/heads/master@{#307853}
Diffstat (limited to 'ipc/ipc_sync_channel_unittest.cc')
-rw-r--r--ipc/ipc_sync_channel_unittest.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc
index f834ec3..43512ab 100644
--- a/ipc/ipc_sync_channel_unittest.cc
+++ b/ipc/ipc_sync_channel_unittest.cc
@@ -1722,7 +1722,11 @@ class VerifiedServer : public Worker {
VLOG(1) << __FUNCTION__ << " Sending reply: " << reply_text_;
SyncChannelNestedTestMsg_String::WriteReplyParams(reply_msg, reply_text_);
Send(reply_msg);
- ASSERT_EQ(channel()->GetPeerPID(), base::GetCurrentProcId());
+#if defined(OS_LINUX) || defined(OS_NACL_NONSFI)
+ ASSERT_EQ(-1, channel()->GetPeerPID());
+#else
+ ASSERT_EQ(base::GetCurrentProcId(), channel()->GetPeerPID());
+#endif
Done();
}
@@ -1751,7 +1755,11 @@ class VerifiedClient : public Worker {
(void)expected_text_;
VLOG(1) << __FUNCTION__ << " Received reply: " << response;
- ASSERT_EQ(channel()->GetPeerPID(), base::GetCurrentProcId());
+#if defined(OS_LINUX) || defined(OS_NACL_NONSFI)
+ ASSERT_EQ(-1, channel()->GetPeerPID());
+#else
+ ASSERT_EQ(base::GetCurrentProcId(), channel()->GetPeerPID());
+#endif
Done();
}