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

Side by Side Diff: sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc

Issue 549653002: NonSFI sandbox: restrict futex(2) operations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h" 5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <linux/futex.h> 10 #include <linux/futex.h>
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 return CrashSIGSYSKill(); 222 return CrashSIGSYSKill();
223 default: 223 default:
224 NOTREACHED(); 224 NOTREACHED();
225 return CrashSIGSYS(); 225 return CrashSIGSYS();
226 } 226 }
227 } 227 }
228 228
229 ResultExpr RestrictFutex() { 229 ResultExpr RestrictFutex() {
230 const int kAllowedFutexFlags = FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME; 230 const int kAllowedFutexFlags = FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME;
231 const int kOperationMask = ~kAllowedFutexFlags; 231 const int kOperationMask = ~kAllowedFutexFlags;
232
233 const Arg<int> op(1); 232 const Arg<int> op(1);
234 return Switch(op & kOperationMask) 233 return Switch(op & kOperationMask)
235 .CASES((FUTEX_WAIT, 234 .CASES((FUTEX_WAIT,
236 FUTEX_WAKE, 235 FUTEX_WAKE,
237 FUTEX_FD,
238 FUTEX_REQUEUE, 236 FUTEX_REQUEUE,
239 FUTEX_CMP_REQUEUE, 237 FUTEX_CMP_REQUEUE,
240 FUTEX_WAKE_OP, 238 FUTEX_WAKE_OP,
241 FUTEX_WAIT_BITSET, 239 FUTEX_WAIT_BITSET,
242 FUTEX_WAKE_BITSET), 240 FUTEX_WAKE_BITSET),
243 Allow()) 241 Allow())
244 .Default(CrashSIGSYSFutex()); 242 .Default(CrashSIGSYSFutex());
245 } 243 }
246 244
247 } // namespace sandbox. 245 } // namespace sandbox.
OLDNEW
« no previous file with comments | « components/nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698