Commit 33d4ca3
Allow sched_getaffinity in syscall filters
Go 1.25's automatic GOMAXPROCS background updates will periodically call
sched_getaffinity (for total CPU count) and pread64 (for cgroup quota limit).
The latter is already allowed by the filters, but the former is not.
In the sentry, the explicit runtime.GOMAXPROCS call at startup disables the
runtime's automatic updates. In theory this makes the filter unnecessary,
however the runtime only actually guarantees it won't change the value of
GOMAXPROCS after runtime.GOMAXPROCS. It does not guarantee that a concurrent
update run won't call the syscalls after runtime.GOMAXPROCS returns (when this
happens, the runtime by definition must later discard any change it finds).
That means it is theoretically possible for a background sched_getaffinity call
to occur after filters are installed.
This lack of guarantee makes the feature difficult to work with, so I intend to
change the runtime to provide a stronger guarantee, but until then I don't
think it hurts to allow this system call.
I haven't actually seen a failure due to a concurrent update yet, this is
precautionary.
Note that the gofer does not explicitly set GOMAXPROCS, so it will continue to
need the filter unless that changes.
PiperOrigin-RevId: 7643813641 parent 96ca35d commit 33d4ca3
File tree
2 files changed
+21
-2
lines changed- runsc
- boot/filter/config
- fsgofer/filter
2 files changed
+21
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
257 | 272 | | |
258 | 273 | | |
259 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
166 | 170 | | |
167 | 171 | | |
168 | 172 | | |
| |||
0 commit comments