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

Unified Diff: content/common/sandbox_seccomp_bpf_linux.cc

Issue 13529027: Switch Linux Auru ports over to POSIX SHM instead of legacy SYSV SHM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 8 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
Index: content/common/sandbox_seccomp_bpf_linux.cc
===================================================================
--- content/common/sandbox_seccomp_bpf_linux.cc (revision 192603)
+++ content/common/sandbox_seccomp_bpf_linux.cc (working copy)
@@ -88,6 +88,14 @@
#endif
}
+inline bool IsUsingToolKitGtk() {
+#if defined(TOOLKIT_GTK)
+ return true;
+#else
+ return false;
+#endif
+}
+
intptr_t CrashSIGSYS_Handler(const struct arch_seccomp_data& args, void* aux) {
int syscall = args.nr;
if (syscall >= 1024)
@@ -1386,15 +1394,16 @@
case __NR_prlimit64:
return ErrorCode(EPERM); // See crbug.com/160157.
default:
- // These need further tightening.
+ if (IsUsingToolKitGtk()) {
#if defined(__x86_64__) || defined(__arm__)
- if (IsSystemVSharedMemory(sysno))
- return ErrorCode(ErrorCode::ERR_ALLOWED);
+ if (IsSystemVSharedMemory(sysno))
+ return ErrorCode(ErrorCode::ERR_ALLOWED);
#endif
#if defined(__i386__)
- if (IsSystemVIpc(sysno))
- return ErrorCode(ErrorCode::ERR_ALLOWED);
+ if (IsSystemVIpc(sysno))
+ return ErrorCode(ErrorCode::ERR_ALLOWED);
#endif
+ }
// Default on the baseline policy.
return BaselinePolicy(sandbox, sysno);
@@ -1414,15 +1423,16 @@
case __NR_ioctl:
return ErrorCode(ENOTTY); // Flash Access.
default:
- // These need further tightening.
+ if (IsUsingToolKitGtk()) {
#if defined(__x86_64__) || defined(__arm__)
- if (IsSystemVSharedMemory(sysno))
- return ErrorCode(ErrorCode::ERR_ALLOWED);
+ if (IsSystemVSharedMemory(sysno))
+ return ErrorCode(ErrorCode::ERR_ALLOWED);
#endif
#if defined(__i386__)
- if (IsSystemVIpc(sysno))
- return ErrorCode(ErrorCode::ERR_ALLOWED);
+ if (IsSystemVIpc(sysno))
+ return ErrorCode(ErrorCode::ERR_ALLOWED);
#endif
+ }
// Default on the baseline policy.
return BaselinePolicy(sandbox, sysno);

Powered by Google App Engine
This is Rietveld 408576698