summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/BUILD
blob: a7b847e942cbd4829ed997b63355b6d56b0bcbe8 (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
package(licenses = ["notice"])  # Apache 2.0

load("//tools/go_generics:defs.bzl", "go_template_instance")
load("//tools/go_stateify:defs.bzl", "go_library", "go_test")

go_template_instance(
    name = "pending_signals_list",
    out = "pending_signals_list.go",
    package = "kernel",
    prefix = "pendingSignal",
    template = "//pkg/ilist:generic_list",
    types = {
        "Linker": "*pendingSignal",
    },
)

go_template_instance(
    name = "process_group_list",
    out = "process_group_list.go",
    package = "kernel",
    prefix = "processGroup",
    template = "//pkg/ilist:generic_list",
    types = {
        "Linker": "*ProcessGroup",
    },
)

go_template_instance(
    name = "seqatomic_taskgoroutineschedinfo",
    out = "seqatomic_taskgoroutineschedinfo.go",
    package = "kernel",
    suffix = "TaskGoroutineSchedInfo",
    template = "//pkg/sync:generic_seqatomic",
    types = {
        "Value": "TaskGoroutineSchedInfo",
    },
)

go_template_instance(
    name = "session_list",
    out = "session_list.go",
    package = "kernel",
    prefix = "session",
    template = "//pkg/ilist:generic_list",
    types = {
        "Linker": "*Session",
    },
)

go_template_instance(
    name = "task_list",
    out = "task_list.go",
    package = "kernel",
    prefix = "task",
    template = "//pkg/ilist:generic_list",
    types = {
        "Linker": "*Task",
    },
)

go_library(
    name = "kernel",
    srcs = [
        "abstract_socket_namespace.go",
        "context.go",
        "fd_map.go",
        "fs_context.go",
        "ipc_namespace.go",
        "kernel.go",
        "kernel_state.go",
        "pending_signals.go",
        "pending_signals_list.go",
        "pending_signals_state.go",
        "posixtimer.go",
        "process_group_list.go",
        "ptrace.go",
        "rseq.go",
        "seccomp.go",
        "seqatomic_taskgoroutineschedinfo.go",
        "session_list.go",
        "sessions.go",
        "signal.go",
        "signal_handlers.go",
        "syscalls.go",
        "syscalls_state.go",
        "syslog.go",
        "task.go",
        "task_acct.go",
        "task_block.go",
        "task_clone.go",
        "task_context.go",
        "task_exec.go",
        "task_exit.go",
        "task_identity.go",
        "task_list.go",
        "task_log.go",
        "task_net.go",
        "task_resources.go",
        "task_run.go",
        "task_sched.go",
        "task_signals.go",
        "task_start.go",
        "task_stop.go",
        "task_syscall.go",
        "task_usermem.go",
        "thread_group.go",
        "threads.go",
        "timekeeper.go",
        "timekeeper_state.go",
        "timer.go",
        "uts_namespace.go",
        "vdso.go",
        "version.go",
    ],
    importpath = "gvisor.googlesource.com/gvisor/pkg/sentry/kernel",
    imports = [
        "gvisor.googlesource.com/gvisor/pkg/bpf",
        "gvisor.googlesource.com/gvisor/pkg/tcpip",
    ],
    visibility = ["//:sandbox"],
    deps = [
        "//pkg/abi",
        "//pkg/abi/linux",
        "//pkg/amutex",
        "//pkg/binary",
        "//pkg/bits",
        "//pkg/bpf",
        "//pkg/cpuid",
        "//pkg/eventchannel",
        "//pkg/log",
        "//pkg/refs",
        "//pkg/secio",
        "//pkg/sentry/arch",
        "//pkg/sentry/context",
        "//pkg/sentry/fs",
        "//pkg/sentry/fs/lock",
        "//pkg/sentry/fs/timerfd",
        "//pkg/sentry/hostcpu",
        "//pkg/sentry/inet",
        "//pkg/sentry/kernel/auth",
        "//pkg/sentry/kernel/epoll",
        "//pkg/sentry/kernel/futex",
        "//pkg/sentry/kernel/kdefs",
        "//pkg/sentry/kernel/sched",
        "//pkg/sentry/kernel/semaphore",
        "//pkg/sentry/kernel/shm",
        "//pkg/sentry/kernel/time",
        "//pkg/sentry/limits",
        "//pkg/sentry/loader",
        "//pkg/sentry/memmap",
        "//pkg/sentry/mm",
        "//pkg/sentry/platform",
        "//pkg/sentry/safemem",
        "//pkg/sentry/socket/netlink/port",
        "//pkg/sentry/time",
        "//pkg/sentry/uniqueid",
        "//pkg/sentry/usage",
        "//pkg/sentry/usermem",
        "//pkg/state",
        "//pkg/state/statefile",
        "//pkg/sync",
        "//pkg/syserror",
        "//pkg/tcpip",
        "//pkg/tcpip/stack",
        "//pkg/tcpip/transport/unix",
        "//pkg/waiter",
    ],
)

go_test(
    name = "kernel_test",
    size = "small",
    srcs = [
        "fd_map_test.go",
        "table_test.go",
        "task_test.go",
        "timekeeper_test.go",
    ],
    embed = [":kernel"],
    deps = [
        "//pkg/abi",
        "//pkg/sentry/arch",
        "//pkg/sentry/context/contexttest",
        "//pkg/sentry/fs/filetest",
        "//pkg/sentry/kernel/kdefs",
        "//pkg/sentry/kernel/sched",
        "//pkg/sentry/limits",
        "//pkg/sentry/platform",
        "//pkg/sentry/time",
        "//pkg/sentry/usage",
        "//pkg/sentry/usermem",
        "//pkg/syserror",
    ],
)