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

Unified Diff: chrome/utility/chrome_content_utility_client.cc

Issue 1018953004: Add SeccompSupportDetector for Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More GN Created 5 years, 9 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 | « chrome/utility/chrome_content_utility_client.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/chrome_content_utility_client.cc
diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc
index d82c23bf5479e1b7cf85f27b64a0953c7d635c47..1d78ccc131650825f390805fc8043a5ada89e490 100644
--- a/chrome/utility/chrome_content_utility_client.cc
+++ b/chrome/utility/chrome_content_utility_client.cc
@@ -31,6 +31,10 @@
#include "net/proxy/mojo_proxy_resolver_factory_impl.h"
#endif
+#if defined(OS_ANDROID) && defined(USE_SECCOMP_BPF)
+#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
+#endif
+
#if defined(OS_WIN)
#include "chrome/utility/font_cache_handler_win.h"
#include "chrome/utility/shell_handler_win.h"
@@ -162,6 +166,10 @@ bool ChromeContentUtilityClient::OnMessageReceived(
#if defined(OS_CHROMEOS)
IPC_MESSAGE_HANDLER(ChromeUtilityMsg_CreateZipFile, OnCreateZipFile)
#endif
+#if defined(OS_ANDROID) && defined(USE_SECCOMP_BPF)
+ IPC_MESSAGE_HANDLER(ChromeUtilityMsg_DetectSeccompSupport,
+ OnDetectSeccompSupport)
+#endif
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -277,6 +285,22 @@ void ChromeContentUtilityClient::OnCreateZipFile(
}
#endif // defined(OS_CHROMEOS)
+#if defined(OS_ANDROID) && defined(USE_SECCOMP_BPF)
+void ChromeContentUtilityClient::OnDetectSeccompSupport() {
+ bool supports_prctl = sandbox::SandboxBPF::SupportsSeccompSandbox(
+ sandbox::SandboxBPF::SeccompLevel::SINGLE_THREADED);
+ Send(new ChromeUtilityHostMsg_DetectSeccompSupport_ResultPrctl(
+ supports_prctl));
+
+ bool supports_syscall = sandbox::SandboxBPF::SupportsSeccompSandbox(
+ sandbox::SandboxBPF::SeccompLevel::MULTI_THREADED);
+ Send(new ChromeUtilityHostMsg_DetectSeccompSupport_ResultSyscall(
+ supports_syscall));
+
+ ReleaseProcessIfNeeded();
+}
+#endif // defined(OS_ANDROID) && defined(USE_SECCOMP_BPF)
+
void ChromeContentUtilityClient::OnRobustJPEGDecodeImage(
const std::vector<unsigned char>& encoded_data) {
// Our robust jpeg decoding is using IJG libjpeg.
« no previous file with comments | « chrome/utility/chrome_content_utility_client.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698