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

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

Issue 2484393004: Linux Sandbox: Whitelist prlimit64 when used as getrlimit (Closed)
Patch Set: Linux Sandbox: Whitelist prlimit64 when used as getrlimit Created 4 years, 1 month 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 | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h ('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/net.h> 10 #include <linux/net.h>
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 #if !defined(GRND_NONBLOCK) 354 #if !defined(GRND_NONBLOCK)
355 #define GRND_NONBLOCK 1 355 #define GRND_NONBLOCK 1
356 #endif 356 #endif
357 357
358 ResultExpr RestrictGetRandom() { 358 ResultExpr RestrictGetRandom() {
359 const Arg<unsigned int> flags(2); 359 const Arg<unsigned int> flags(2);
360 const unsigned int kGoodFlags = GRND_NONBLOCK; 360 const unsigned int kGoodFlags = GRND_NONBLOCK;
361 return If((flags & ~kGoodFlags) == 0, Allow()).Else(CrashSIGSYS()); 361 return If((flags & ~kGoodFlags) == 0, Allow()).Else(CrashSIGSYS());
362 } 362 }
363 363
364 ResultExpr RestrictPrlimit64ToGetrlimit() {
365 const Arg<uintptr_t> new_limit(0);
366 return If(new_limit == 0, Allow()).Else(Error(EPERM));
Jorge Lucangeli Obes 2016/11/21 14:18:43 Should this also restrict |pid| to the process' PI
367 }
368
364 } // namespace sandbox. 369 } // namespace sandbox.
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698