about summary refs log tree commit diff stats
path: root/src/utils
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-04-20 12:40:57 +0200
committerbptato <nincsnevem662@gmail.com>2024-04-20 12:47:49 +0200
commit2df3a394d96c116301bb4df2fd1f67b8311fddee (patch)
tree57ffe7a8b659ab4c864bb67917f1e115f44b8534 /src/utils
parent503925d2c91e967d51354e322daec4feb62e7ff7 (diff)
downloadchawan-2df3a394d96c116301bb4df2fd1f67b8311fddee.tar.gz
sandbox: allow syscalls for epoll Nim selectors
This fixes setTimeout/setInterval causing crashes.

Note: timerfd_gettime is not actually used by Nim right now.
However, it seems like a good idea to add it to the set in case a
future Nim version needs it, as it does no harm.

We still do not allow signalfd, because it would let rogue buffers
override our SIGSYS handler.  (Not sure if this really matters, but
we don't need it for now anyway.)
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/sandbox.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/sandbox.nim b/src/utils/sandbox.nim
index ad37c2d2..0a31fc41 100644
--- a/src/utils/sandbox.nim
+++ b/src/utils/sandbox.nim
@@ -85,6 +85,7 @@ elif defined(linux) and not disableSandbox:
       "close", # duh
       "connect", # for outgoing requests to loader
       "epoll_create", "epoll_create1", "epoll_ctl", "epoll_wait", # epoll stuff
+      "eventfd", # used by Nim selectors
       "exit_group", # for quit
       "fcntl", "fcntl64", # for changing blocking status
       "fork", # for when fork is really fork
@@ -103,6 +104,9 @@ elif defined(linux) and not disableSandbox:
       "send", "sendmsg", "sendto", # for writing to sockets
       "set_robust_list", # glibc seems to need it for whatever reason
       "setrlimit", # glibc seems to use it for whatever reason
+      "timerfd_create", # used by Nim selectors
+      "timerfd_gettime", # not actually used by Nim but may be in the future
+      "timerfd_settime", # used by Nim selectors
       "write" # for writing to sockets
     ]
     for it in allowList:
-0400 reorganization' href='/gbmor/clinte/commit/src/posts.rs?h=v2.1.0&id=8b3c06f839f14eca6d76da89ffde9fb270fc7b10'>8b3c06f ^
fd2f770 ^
8b3c06f ^

fd2f770 ^
8b3c06f ^



fd2f770 ^
8b3c06f ^







23a7db0 ^


8b3c06f ^
23a7db0 ^
8b3c06f ^

23a7db0 ^


8b3c06f ^

fd2f770 ^
8b3c06f ^


fd2f770 ^











39894be ^
fd2f770 ^
39894be ^



23a7db0 ^







39894be ^







fd2f770 ^

39894be ^

8b3c06f ^
fd2f770 ^
8b3c06f ^



fd2f770 ^

8b3c06f ^



fd2f770 ^







8b3c06f ^
e2c857a ^
8b3c06f ^

fd2f770 ^
8b3c06f ^









fd2f770 ^
8b3c06f ^

fd2f770 ^
8b3c06f ^

fd2f770 ^

8b3c06f ^


fd2f770 ^
d098a93 ^













8b3c06f ^
fd2f770 ^
d098a93 ^




8b3c06f ^
fd2f770 ^
8b3c06f ^



fd2f770 ^

8b3c06f ^






fd2f770 ^

8b3c06f ^
fd2f770 ^
8b3c06f ^
e2c857a ^
8b3c06f ^


fd2f770 ^
8b3c06f ^

fd2f770 ^

8b3c06f ^

d098a93 ^



cf6e351 ^
d098a93 ^
53f2d63 ^
cf0ad9b ^
d098a93 ^






8b3c06f ^
cf0ad9b ^
d098a93 ^





cf0ad9b ^
d098a93 ^



cf0ad9b ^
d098a93 ^
d098a93 ^
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234