#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "sandbox/linux/seccomp-bpf/syscall.h"
#include <asm/unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/mman.h>
#include <sys/syscall.h>
#include <sys/types.h>
#include <unistd.h>
#include <vector>
#include "base/memory/page_size.h"
#include "base/memory/raw_ptr.h"
#include "base/posix/eintr_wrapper.h"
#include "base/types/fixed_array.h"
#include "build/build_config.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl.h"
#include "sandbox/linux/bpf_dsl/policy.h"
#include "sandbox/linux/seccomp-bpf/bpf_tests.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
Allow;
ResultExpr;
Trap;
namespace sandbox {
namespace {
TEST(Syscall, InvalidCallReturnsENOSYS) { … }
template <typename T>
T LoadBehind(intptr_t ptr) { … }
TEST(Syscall, WellKnownEntryPoint) { … }
TEST(Syscall, TrivialSyscallNoArgs) { … }
TEST(Syscall, TrivialSyscallOneArg) { … }
TEST(Syscall, TrivialFailingSyscall) { … }
intptr_t CopySyscallArgsToAux(const struct arch_seccomp_data& args, void* aux) { … }
class CopyAllArgsOnUnamePolicy : public bpf_dsl::Policy { … };
BPF_TEST(Syscall,
SyntheticSixArgs,
CopyAllArgsOnUnamePolicy,
std::vector<uint64_t> ) { … }
TEST(Syscall, ComplexSyscallSixArgs) { … }
}
}