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

Unified Diff: sandbox/linux/bpf_dsl/bpf_dsl.h

Issue 600583002: sandbox: Avoid ~(flag1 | flag2 | ...) expressions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use uint64_t everywhere 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 side-by-side diff with in-line comments
Download patch
Index: sandbox/linux/bpf_dsl/bpf_dsl.h
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl.h b/sandbox/linux/bpf_dsl/bpf_dsl.h
index cfa4add013178321721a125b6eb6e52de7caf43b..7bb691305ebcaba0885f3a0da3d5b361069fcacd 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl.h
+++ b/sandbox/linux/bpf_dsl/bpf_dsl.h
@@ -43,8 +43,8 @@ class SandboxBPF;
// if (sysno == __NR_fcntl) {
// Arg<int> fd(0), cmd(1);
// Arg<unsigned long> flags(2);
-// const unsigned long kBadFlags = ~(O_ACCMODE | O_NONBLOCK);
-// return If(fd == 0 && cmd == F_SETFL && (flags & kBadFlags) == 0,
+// const uint64_t kGoodFlags = O_ACCMODE | O_NONBLOCK;
+// return If(fd == 0 && cmd == F_SETFL && (flags & ~kGoodFlags) == 0,
// Allow())
// .ElseIf(cmd == F_DUPFD || cmd == F_DUPFD_CLOEXEC,
// Error(EMFILE))
« no previous file with comments | « components/nacl/loader/nonsfi/nonsfi_sandbox.cc ('k') | sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698