-
Notifications
You must be signed in to change notification settings - Fork 0
/
system_call_table.h
46 lines (35 loc) · 1.35 KB
/
system_call_table.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SYSCALL_TABLE_H__
#define SYSCALL_TABLE_H__
#include <sys/types.h>
#include "securemem.h"
#ifndef INTERNAL
#define INTERNAL __attribute__((visibility("internal")))
#endif
namespace playground {
typedef SecureMem::Args SecureMemArgs;
typedef SecureMem::SyscallRequestInfo SyscallRequestInfo;
#define UNRESTRICTED_SYSCALL ((void (*)())1)
struct SyscallTable {
void (*handler)();
bool (*trustedProcess)(const SyscallRequestInfo* info);
// Initializes the system call table with the default policy
static void initializeSyscallTable();
static size_t getSyscallTableSize();
static void protectSyscallTable();
static void unprotectSyscallTable();
// The pointers to the system call table are r/w. This is OK, as we create
// a r/o copy in the secure memory page(s) just prior to launching the
// sandbox. The trusted thread then only ever access the table through
// its secure memory.
// The table itself (as opposed to the pointer to it) always is marked
// as r/o.
static unsigned maxSyscall
asm("playground$maxSyscall") INTERNAL;
static struct SyscallTable *syscallTable
asm("playground$syscallTable") INTERNAL;
};
} // namespace
#endif // SYSCALL_TABLE_H__