kobako 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +335 -0
- data/Cargo.lock +469 -11
- data/README.md +43 -3
- data/ROADMAP.md +1 -1
- data/crates/kobako-runtime/CHANGELOG.md +219 -0
- data/crates/kobako-runtime/Cargo.toml +51 -3
- data/crates/kobako-runtime/README.md +7 -4
- data/crates/kobako-runtime/src/cred.rs +124 -0
- data/crates/kobako-runtime/src/dispatch.rs +4 -5
- data/crates/kobako-runtime/src/endpoint/buffer.rs +153 -44
- data/crates/kobako-runtime/src/endpoint/dispatch.rs +80 -41
- data/crates/kobako-runtime/src/endpoint/invoke.rs +23 -36
- data/crates/kobako-runtime/src/endpoint.rs +137 -36
- data/crates/kobako-runtime/src/errno.rs +391 -0
- data/crates/kobako-runtime/src/error.rs +31 -10
- data/crates/kobako-runtime/src/filesystem/anon_inodes.rs +52 -0
- data/crates/kobako-runtime/src/filesystem/bind/lookup.rs +52 -14
- data/crates/kobako-runtime/src/filesystem/bind/walk.rs +19 -20
- data/crates/kobako-runtime/src/filesystem/bind.rs +437 -245
- data/crates/kobako-runtime/src/filesystem/overlay/file.rs +6 -6
- data/crates/kobako-runtime/src/filesystem/overlay/path.rs +43 -65
- data/crates/kobako-runtime/src/filesystem/overlay/stack/copy_up.rs +9 -16
- data/crates/kobako-runtime/src/filesystem/overlay/stack/dir.rs +47 -72
- data/crates/kobako-runtime/src/filesystem/overlay/stack/namei.rs +12 -12
- data/crates/kobako-runtime/src/filesystem/overlay/stack/readdir.rs +4 -7
- data/crates/kobako-runtime/src/filesystem/overlay/stack.rs +121 -37
- data/crates/kobako-runtime/src/filesystem/overlay.rs +302 -343
- data/crates/kobako-runtime/src/filesystem/pipe.rs +12 -9
- data/crates/kobako-runtime/src/filesystem/rdir.rs +15 -32
- data/crates/kobako-runtime/src/filesystem/tmpfs/seed.rs +32 -0
- data/crates/kobako-runtime/src/filesystem/tmpfs/tmpfile.rs +3 -3
- data/crates/kobako-runtime/src/filesystem/tmpfs/whiteout.rs +57 -35
- data/crates/kobako-runtime/src/filesystem/tmpfs/xattr.rs +2 -2
- data/crates/kobako-runtime/src/filesystem/tmpfs.rs +172 -160
- data/crates/kobako-runtime/src/filesystem/wrap.rs +36 -52
- data/crates/kobako-runtime/src/filesystem.rs +6 -3
- data/crates/kobako-runtime/src/fork.rs +96 -0
- data/crates/kobako-runtime/src/grant.rs +3 -0
- data/crates/kobako-runtime/src/hashtable.rs +4 -2
- data/crates/kobako-runtime/src/lib.rs +18 -7
- data/crates/kobako-runtime/src/limits.rs +195 -0
- data/crates/kobako-runtime/src/locking.rs +10 -0
- data/crates/kobako-runtime/src/memcg.rs +383 -0
- data/crates/kobako-runtime/src/mount.rs +67 -9
- data/crates/kobako-runtime/src/net/backends.rs +43 -0
- data/crates/kobako-runtime/src/net/connections.rs +179 -0
- data/crates/kobako-runtime/src/net/credential.rs +125 -0
- data/crates/kobako-runtime/src/net/egress.rs +160 -0
- data/crates/kobako-runtime/src/net/family.rs +181 -0
- data/crates/kobako-runtime/src/net/http.rs +2733 -0
- data/crates/kobako-runtime/src/net/lookup.rs +285 -0
- data/crates/kobako-runtime/src/net/mock.rs +251 -0
- data/crates/kobako-runtime/src/net/namespace.rs +1366 -0
- data/crates/kobako-runtime/src/net/reactor.rs +531 -0
- data/crates/kobako-runtime/src/net/resolv/darwin.rs +275 -0
- data/crates/kobako-runtime/src/net/resolv/stub/tests.rs +469 -0
- data/crates/kobako-runtime/src/net/resolv/stub.rs +536 -0
- data/crates/kobako-runtime/src/net/resolv/windows.rs +248 -0
- data/crates/kobako-runtime/src/net/resolv.rs +227 -0
- data/crates/kobako-runtime/src/net/socket.rs +870 -0
- data/crates/kobako-runtime/src/net/tcp.rs +1588 -0
- data/crates/kobako-runtime/src/net/tls.rs +58 -0
- data/crates/kobako-runtime/src/net/transport.rs +279 -0
- data/crates/kobako-runtime/src/net/udp.rs +1003 -0
- data/crates/kobako-runtime/src/net.rs +42 -0
- data/crates/kobako-runtime/src/network/builder.rs +177 -0
- data/crates/kobako-runtime/src/network/ruleset.rs +777 -0
- data/crates/kobako-runtime/src/network.rs +551 -0
- data/crates/kobako-runtime/src/policy.rs +16 -0
- data/crates/kobako-runtime/src/profile.rs +29 -144
- data/crates/kobako-runtime/src/runtime.rs +3 -5
- data/crates/kobako-runtime/src/sched.rs +130 -29
- data/crates/kobako-runtime/src/security/entry_policy.rs +22 -0
- data/crates/kobako-runtime/src/{vfs/cred.rs → security/hooks.rs} +52 -144
- data/crates/kobako-runtime/src/security/mount_policy.rs +158 -0
- data/crates/kobako-runtime/src/security.rs +101 -196
- data/crates/kobako-runtime/src/snapshot.rs +121 -2
- data/crates/kobako-runtime/src/vfs/attr.rs +5 -5
- data/crates/kobako-runtime/src/vfs/dentry.rs +143 -89
- data/crates/kobako-runtime/src/vfs/file.rs +199 -203
- data/crates/kobako-runtime/src/vfs/inode.rs +41 -45
- data/crates/kobako-runtime/src/vfs/kern_path.rs +38 -42
- data/crates/kobako-runtime/src/vfs/mount.rs +10 -9
- data/crates/kobako-runtime/src/vfs/namei.rs +829 -700
- data/crates/kobako-runtime/src/vfs/namespace.rs +162 -0
- data/crates/kobako-runtime/src/vfs/open_files.rs +69 -0
- data/crates/kobako-runtime/src/vfs/openat2.rs +3 -3
- data/crates/kobako-runtime/src/vfs/path.rs +6 -6
- data/crates/kobako-runtime/src/vfs/readdir.rs +6 -6
- data/crates/kobako-runtime/src/vfs/stat.rs +159 -23
- data/crates/kobako-runtime/src/vfs/super_block.rs +18 -14
- data/crates/kobako-runtime/src/vfs/utimes.rs +37 -27
- data/crates/kobako-runtime/src/vfs.rs +9 -6
- data/crates/kobako-runtime/src/wait.rs +356 -0
- data/crates/kobako-transport/CHANGELOG.md +31 -0
- data/crates/kobako-transport/Cargo.toml +1 -1
- data/crates/kobako-transport/README.md +3 -4
- data/crates/kobako-transport/src/abi.rs +78 -72
- data/crates/kobako-transport/src/envelope/bytes.rs +17 -6
- data/crates/kobako-transport/src/envelope/call.rs +32 -4
- data/crates/kobako-transport/src/envelope/error_record.rs +21 -0
- data/crates/kobako-transport/src/envelope/name.rs +99 -0
- data/crates/kobako-transport/src/envelope/outcome.rs +9 -9
- data/crates/kobako-transport/src/envelope/preamble.rs +24 -21
- data/crates/kobako-transport/src/envelope/reply.rs +27 -27
- data/crates/kobako-transport/src/envelope/unsupported.rs +10 -10
- data/crates/kobako-transport/src/envelope.rs +13 -8
- data/crates/kobako-wasmtime/CHANGELOG.md +161 -0
- data/crates/kobako-wasmtime/Cargo.toml +26 -7
- data/crates/kobako-wasmtime/README.md +3 -2
- data/crates/kobako-wasmtime/build/preview2.rs +1339 -0
- data/crates/kobako-wasmtime/build.rs +16 -0
- data/crates/kobako-wasmtime/src/abi.rs +17 -37
- data/crates/kobako-wasmtime/src/ambient.rs +33 -18
- data/crates/kobako-wasmtime/src/cache.rs +23 -15
- data/crates/kobako-wasmtime/src/config.rs +52 -68
- data/crates/kobako-wasmtime/src/driver.rs +48 -63
- data/crates/kobako-wasmtime/src/exports.rs +143 -17
- data/crates/kobako-wasmtime/src/guest.rs +12 -6
- data/crates/kobako-wasmtime/src/guest_binary.rs +14 -0
- data/crates/kobako-wasmtime/src/imports.rs +42 -18
- data/crates/kobako-wasmtime/src/instance_pre.rs +4 -4
- data/crates/kobako-wasmtime/src/invocation.rs +74 -12
- data/crates/kobako-wasmtime/src/lib.rs +5 -3
- data/crates/kobako-wasmtime/src/limiter.rs +70 -5
- data/crates/kobako-wasmtime/src/preview1/descriptors.rs +309 -0
- data/crates/kobako-wasmtime/src/preview1/differential/mount.rs +5 -15
- data/crates/kobako-wasmtime/src/preview1/differential.rs +27 -31
- data/crates/kobako-wasmtime/src/preview1/errno.rs +55 -66
- data/crates/kobako-wasmtime/src/preview1/fd.rs +327 -296
- data/crates/kobako-wasmtime/src/preview1/memory.rs +21 -12
- data/crates/kobako-wasmtime/src/preview1/mount_view/wrap.rs +34 -53
- data/crates/kobako-wasmtime/src/preview1/mount_view.rs +231 -217
- data/crates/kobako-wasmtime/src/preview1/path.rs +56 -121
- data/crates/kobako-wasmtime/src/preview1/poll.rs +244 -120
- data/crates/kobako-wasmtime/src/preview1/sock.rs +10 -8
- data/crates/kobako-wasmtime/src/preview1/testsuite.rs +5 -15
- data/crates/kobako-wasmtime/src/preview1.rs +46 -42
- data/crates/kobako-wasmtime/src/preview2/abi.rs +227 -0
- data/crates/kobako-wasmtime/src/preview2/error.rs +118 -0
- data/crates/kobako-wasmtime/src/preview2/filesystem.rs +122 -0
- data/crates/kobako-wasmtime/src/preview2/host.rs +3959 -0
- data/crates/kobako-wasmtime/src/preview2/http.rs +1503 -0
- data/crates/kobako-wasmtime/src/preview2/io.rs +315 -0
- data/crates/kobako-wasmtime/src/preview2/sockets.rs +379 -0
- data/crates/kobako-wasmtime/src/preview2/table.rs +305 -0
- data/crates/kobako-wasmtime/src/preview2.rs +57 -0
- data/crates/kobako-wasmtime/src/trap.rs +24 -9
- data/crates/kobako-wasmtime/src/wasi.rs +210 -81
- data/crates/kobako-wasmtime/wit/deps/cli.wit +233 -0
- data/crates/kobako-wasmtime/wit/deps/clocks.wit +162 -0
- data/crates/kobako-wasmtime/wit/deps/filesystem.wit +589 -0
- data/crates/kobako-wasmtime/wit/deps/http.wit +733 -0
- data/crates/kobako-wasmtime/wit/deps/io.wit +299 -0
- data/crates/kobako-wasmtime/wit/deps/random.wit +92 -0
- data/crates/kobako-wasmtime/wit/deps/sockets.wit +949 -0
- data/data/kobako.wasm +0 -0
- data/ext/kobako/Cargo.toml +1 -1
- data/ext/kobako/src/{runtime/errors.rs → errors.rs} +34 -26
- data/ext/kobako/src/{runtime/escape.rs → escape.rs} +42 -11
- data/ext/kobako/src/{runtime/filesystem → filesystem}/grants.rs +30 -26
- data/ext/kobako/src/{runtime/filesystem → filesystem}/ruby.rs +149 -168
- data/ext/kobako/src/{runtime/filesystem.rs → filesystem.rs} +24 -15
- data/ext/kobako/src/gvl.rs +306 -0
- data/ext/kobako/src/lib.rs +64 -3
- data/ext/kobako/src/network/mock.rs +187 -0
- data/ext/kobako/src/network.rs +591 -0
- data/ext/kobako/src/runtime/bridge.rs +30 -29
- data/ext/kobako/src/runtime/snapshot.rs +4 -4
- data/ext/kobako/src/runtime.rs +221 -143
- data/ext/kobako/src/wire.rs +42 -0
- data/lib/kobako/catalog/extensions.rb +14 -2
- data/lib/kobako/catalog/flags.rb +3 -5
- data/lib/kobako/catalog/grants.rb +5 -4
- data/lib/kobako/catalog/handles.rb +5 -27
- data/lib/kobako/catalog/mount.rb +11 -3
- data/lib/kobako/catalog/network.rb +35 -0
- data/lib/kobako/catalog/replacements.rb +28 -0
- data/lib/kobako/catalog/services.rb +5 -19
- data/lib/kobako/catalog/snippets.rb +3 -18
- data/lib/kobako/catalog.rb +3 -0
- data/lib/kobako/codec/{utils.rb → boundary.rb} +4 -2
- data/lib/kobako/codec/decoder.rb +4 -4
- data/lib/kobako/codec/ext_types.rb +3 -3
- data/lib/kobako/codec/handle_walk.rb +3 -43
- data/lib/kobako/codec/value_budget.rb +132 -40
- data/lib/kobako/codec.rb +1 -1
- data/lib/kobako/context.rb +24 -11
- data/lib/kobako/errors.rb +15 -12
- data/lib/kobako/extension.rb +3 -2
- data/lib/kobako/filesystem.rb +9 -2
- data/lib/kobako/handle.rb +2 -2
- data/lib/kobako/names.rb +28 -0
- data/lib/kobako/network.rb +210 -0
- data/lib/kobako/outcome.rb +7 -7
- data/lib/kobako/pool.rb +45 -23
- data/lib/kobako/runtime.rb +3 -2
- data/lib/kobako/sandbox.rb +92 -35
- data/lib/kobako/sandbox_options.rb +41 -106
- data/lib/kobako/transport/argument_wrap.rb +64 -0
- data/lib/kobako/transport/block_failure.rb +1 -1
- data/lib/kobako/transport/dispatcher.rb +6 -6
- data/lib/kobako/transport/exposure.rb +26 -15
- data/lib/kobako/transport/reflection.rb +21 -4
- data/lib/kobako/transport/run.rb +8 -23
- data/lib/kobako/transport/yielder.rb +2 -9
- data/lib/kobako/transport.rb +1 -0
- data/lib/kobako/version.rb +1 -1
- data/lib/kobako.rb +6 -2
- data/release-please-config.json +15 -0
- data/sig/core/thread.rbs +6 -0
- data/sig/kobako/catalog/extensions.rbs +2 -0
- data/sig/kobako/catalog/grants.rbs +7 -4
- data/sig/kobako/catalog/handles.rbs +0 -2
- data/sig/kobako/catalog/mount.rbs +3 -1
- data/sig/kobako/catalog/network.rbs +20 -0
- data/sig/kobako/catalog/replacements.rbs +14 -0
- data/sig/kobako/catalog/services.rbs +0 -4
- data/sig/kobako/catalog/snippets.rbs +0 -2
- data/sig/kobako/codec/{utils.rbs → boundary.rbs} +2 -2
- data/sig/kobako/codec/handle_walk.rbs +0 -6
- data/sig/kobako/codec/value_budget.rbs +47 -4
- data/sig/kobako/context.rbs +3 -1
- data/sig/kobako/errors.rbs +4 -4
- data/sig/kobako/filesystem.rbs +21 -3
- data/sig/kobako/network.rbs +115 -0
- data/sig/kobako/outcome.rbs +1 -1
- data/sig/kobako/pool.rbs +7 -3
- data/sig/kobako/runtime.rbs +32 -3
- data/sig/kobako/sandbox.rbs +19 -2
- data/sig/kobako/sandbox_options.rbs +29 -38
- data/sig/kobako/transport/argument_wrap.rbs +15 -0
- data/sig/kobako/transport/error.rbs +1 -1
- data/sig/kobako/transport/exposure.rbs +2 -4
- data/sig/kobako/transport/reflection.rbs +10 -0
- data/sig/kobako/transport/run.rbs +0 -2
- data/sig/kobako/transport/yielder.rbs +0 -3
- data/sig/kobako/transport.rbs +1 -1
- data/sig/kobako.rbs +13 -0
- metadata +84 -35
- data/crates/kobako-runtime/src/endpoint/capture.rs +0 -115
- data/crates/kobako-runtime/src/endpoint/memory_cap.rs +0 -238
- data/crates/kobako-runtime/src/filesystem/path.rs +0 -21
- data/crates/kobako-runtime/src/vfs/errno.rs +0 -153
- data/crates/kobako-runtime/tests/linux_baseline/calls.rs +0 -171
- data/crates/kobako-runtime/tests/linux_baseline/concurrent.rs +0 -276
- data/crates/kobako-runtime/tests/linux_baseline/kobako.rs +0 -323
- data/crates/kobako-runtime/tests/linux_baseline/linux-baseline-expected.txt +0 -16
- data/crates/kobako-runtime/tests/linux_baseline/linux.rs +0 -449
- data/crates/kobako-runtime/tests/linux_baseline/main.rs +0 -611
- data/crates/kobako-runtime/tests/linux_baseline/permissions.rs +0 -236
- data/crates/kobako-wasmtime/src/descriptors.rs +0 -200
- data/crates/kobako-wasmtime/tests/integration/compile_posture.rs +0 -43
- data/crates/kobako-wasmtime/tests/integration/guest_file.rs +0 -1085
- data/crates/kobako-wasmtime/tests/integration/main.rs +0 -29
- data/crates/kobako-wasmtime/tests/integration/preamble_flags.rs +0 -70
- data/crates/kobako-wasmtime/tests/integration/snippet_compile.rs +0 -95
- data/crates/kobako-wasmtime/tests/integration/support/mod.rs +0 -30
- data/crates/kobako-wasmtime/tests/integration/unanswered_call.rs +0 -86
- data/crates/kobako-wasmtime/tests/integration/unsupported_call.rs +0 -51
- data/ext/kobako/src/runtime/gvl.rs +0 -147
- data/lib/kobako/constant_name.rb +0 -8
- data/sig/kobako/constant_name.rbs +0 -3
- /data/ext/kobako/src/{runtime/pinned_value.rs → pinned_value.rs} +0 -0
data/README.md
CHANGED
|
@@ -98,6 +98,43 @@ sandbox.eval('File.read("/config/app.yml")').value
|
|
|
98
98
|
| `Bind` | one host directory |
|
|
99
99
|
| `Overlay` | read-only Layers under a Tmpfs |
|
|
100
100
|
|
|
101
|
+
### Network
|
|
102
|
+
|
|
103
|
+
`network` gives the guest's `TCPSocket`, `UDPSocket`, and `Net::HTTP` only the
|
|
104
|
+
endpoints you name. A credential's secret never enters the guest: the host swaps
|
|
105
|
+
it in for its placeholder on the way out.
|
|
106
|
+
|
|
107
|
+
```ruby
|
|
108
|
+
sandbox.network(:api) do |net|
|
|
109
|
+
net.endpoint("api.example.com", port: 443) { |rules| rules.allow("GET", "/v1/**") }
|
|
110
|
+
net.credential(:bearer, placeholder: "API_TOKEN") { ENV.fetch("API_TOKEN") }
|
|
111
|
+
end
|
|
112
|
+
sandbox.eval(<<~RUBY).value
|
|
113
|
+
http = Net::HTTP.new("api.example.com", 443)
|
|
114
|
+
http.use_ssl = true
|
|
115
|
+
http.get("/v1/status", "Authorization" => "Bearer API_TOKEN").code
|
|
116
|
+
RUBY
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
| Endpoint part | Default |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `protocol:` | `:http`; `:tcp` or `:udp` only when written |
|
|
122
|
+
| `addresses:` | `[:public]`; `:private`, `:local`, or a CIDR only when written |
|
|
123
|
+
|
|
124
|
+
A test hands `Sandbox.new` a `Kobako::Network::Mock` as `network:`, so names
|
|
125
|
+
resolve from a table and dials reach a server the test runs. The rules judge
|
|
126
|
+
the Mock as they judge the host network.
|
|
127
|
+
|
|
128
|
+
```ruby
|
|
129
|
+
mock = Kobako::Network::Mock.new
|
|
130
|
+
mock.resolve("api.example.com", to: "93.184.216.34")
|
|
131
|
+
mock.route("93.184.216.34", 80, to: ["127.0.0.1", server.addr[1]])
|
|
132
|
+
sandbox = Kobako::Sandbox.new(network: mock)
|
|
133
|
+
sandbox.network(:api) { |net| net.endpoint("api.example.com", port: 80, protocol: :tcp) }
|
|
134
|
+
mock.hold("slow.example") { sandbox.eval(script) } # lookups of the name wait for the block
|
|
135
|
+
mock.lookups; mock.dialed_addresses # what the guest asked, in order
|
|
136
|
+
```
|
|
137
|
+
|
|
101
138
|
### Execution Records
|
|
102
139
|
|
|
103
140
|
An Execution carries the value, the output, and the usage. A failed run raises
|
|
@@ -128,15 +165,18 @@ Kobako::Sandbox.new(timeout: 5.0, memory_limit: 10 * 1024 * 1024)
|
|
|
128
165
|
| `memory_limit` | 4 MiB |
|
|
129
166
|
| `stdout_limit`, `stderr_limit` | 1 MiB |
|
|
130
167
|
| `open_file_limit` | 1024 |
|
|
168
|
+
| `open_connection_limit` | 6 |
|
|
169
|
+
| `connection_limit` | 50 |
|
|
131
170
|
|
|
132
171
|
### Concurrency
|
|
133
172
|
|
|
134
173
|
A Sandbox keeps nothing between runs, so Threads may share one. `gvl:
|
|
135
|
-
:release` runs guest code in parallel
|
|
174
|
+
:release` runs guest code in parallel. `Kobako::Pool` is deprecated, and the
|
|
175
|
+
next release removes it.
|
|
136
176
|
|
|
137
177
|
```ruby
|
|
138
|
-
|
|
139
|
-
|
|
178
|
+
sandbox = Kobako::Sandbox.new(gvl: :release).bind("KV::Lookup", lookup)
|
|
179
|
+
4.times.map { Thread.new { sandbox.eval(script).value } }.map(&:value)
|
|
140
180
|
```
|
|
141
181
|
|
|
142
182
|
### Snippets
|
data/ROADMAP.md
CHANGED
|
@@ -28,5 +28,5 @@ row below links a feature to its scenarios and to where its code starts.
|
|
|
28
28
|
| ✅ [Guest Dir](docs/spec/behavior/dir.md) | [wasm/kobako-io/src/dir.rs](wasm/kobako-io/src/dir.rs) |
|
|
29
29
|
| ✅ [Filesystem](docs/spec/behavior/filesystem.md) | [crates/kobako-runtime/src/filesystem.rs](crates/kobako-runtime/src/filesystem.rs) |
|
|
30
30
|
| ✅ [Mount](docs/spec/behavior/mount.md) | [lib/kobako/catalog/mount.rb](lib/kobako/catalog/mount.rb) |
|
|
31
|
-
| ✅ [Ruby Filesystem](docs/spec/behavior/ruby-filesystem.md) | [ext/kobako/src/
|
|
31
|
+
| ✅ [Ruby Filesystem](docs/spec/behavior/ruby-filesystem.md) | [ext/kobako/src/filesystem/ruby.rs](ext/kobako/src/filesystem/ruby.rs) |
|
|
32
32
|
| ✅ [Journeys](docs/spec/behavior/journeys.md) | [test/e2e/test_journeys.rb](test/e2e/test_journeys.rb) |
|
|
@@ -1,5 +1,224 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.21.0](https://github.com/elct9620/kobako/compare/kobako-runtime-v0.20.0...kobako-runtime-v0.21.0) (2026-11-18)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### ⚠ BREAKING CHANGES
|
|
7
|
+
|
|
8
|
+
* **transport:** kobako_transport::envelope::Reply is CallReply.
|
|
9
|
+
* **runtime:** kobako_runtime::network::{Ruleset, AddressSet, address_set_of} and kobako_runtime::net::{Transport, Connector, new_platform_tls} are no longer public.
|
|
10
|
+
* **security:** call kobako_runtime::security::prepare_creds in place of prepare_creds_within.
|
|
11
|
+
* **vfs:** call Rdir::iterate_shared and File::is_readable, is_writable, is_append, is_nonblock, is_dsync, and is_sync in place of the bare names.
|
|
12
|
+
* **vfs:** call Iattr::for_size, Iattr::for_times, Kiocb::new, and get_anon_bdev in place of Iattr::size, Iattr::times, Kiocb::at, and
|
|
13
|
+
* **vfs:** call Inode::file_type and File::file_type in place of kind.
|
|
14
|
+
* **runtime:** match SetupError::GuestBinaryNotFound in place of
|
|
15
|
+
* **network:** open_connection_limit bounds what one invocation holds open at once, not what all of a Sandbox's invocations hold together.
|
|
16
|
+
* **network:** an Entry's Policies are built with with_request_policy, with_resolve_policy, and with_connect_policy in place of with_request, with_resolve, and with_connect.
|
|
17
|
+
* **transport:** a Guest Binary built against ABI 5 is refused at construction. Rebuild it against kobako-core, whose export_guest! emits the new names. kobako-transport drops ABI_VERSION as a u32, FRAME_LEN_SIZE, MAX_FRAME_LEN, pack_ptr_len, and unpack_ptr_len, and names the ABI through ABI_VERSION ("0.6.0"), GUEST_INTERFACE, HOST_INTERFACE, DOWNCALL, UPCALL, and PREAMBLE. kobako-core drops alloc; answer returns the return area's address.
|
|
18
|
+
* **sdk:** `kobako::Options` and `kobako_wasmtime::Config` read and set every cap through `limits`: write `options.limits.timeout = …` where `options.timeout = …` was written, and likewise for `setup_timeout`, `memory_limit`, `stdout_limit`, `stderr_limit`, `open_file_limit`, `open_connection_limit`, and `connection_limit`.
|
|
19
|
+
* **transport:** kobako_transport::abi::MAX_DISPATCH_PAYLOAD is renamed to MAX_MESSAGE_LEN; its value is unchanged.
|
|
20
|
+
* **runtime:** `memory_limit` now bounds the guest's `memory.grow` and what the host holds for the run together, where a Filesystem written in Ruby had its directory listings counted against a limit of their own. A run that grew close to `memory_limit` and listed a large directory may now raise `Errno::ENOMEM` in the guest or `Kobako::MemoryLimitError`, and `Usage#memory_peak` includes the listings. Raise `memory_limit` by what those listings hold to keep the earlier headroom.
|
|
21
|
+
* **runtime:** `kobako_runtime::FilesystemError`, `kobako_runtime::vfs::FilesystemError`, and `kobako_runtime::filesystem::FilesystemError` are now `kobako_runtime::Errno`, also reachable as `kobako::Errno`. Rename the type in a Filesystem or security module; its variants are unchanged.
|
|
22
|
+
|
|
23
|
+
### Features
|
|
24
|
+
|
|
25
|
+
* bound a guest's connections per Sandbox, per run, and per process ([7a4f869](https://github.com/elct9620/kobako/commit/7a4f8692cbc788a23c582b90112cd0275739d496))
|
|
26
|
+
* **filesystem:** let a Host App mark a Filesystem only the guest changes ([b7e0c81](https://github.com/elct9620/kobako/commit/b7e0c81b7338bd16243a9157de5c8194227b95c8))
|
|
27
|
+
* **network:** route and refuse a Mock's dials by protocol, UDP included ([9e8b44d](https://github.com/elct9620/kobako/commit/9e8b44d425db205fe0bb2faccca0782acf1e1b4e))
|
|
28
|
+
* **runtime:** answer the guest's network from a table a test writes ([b3aba65](https://github.com/elct9620/kobako/commit/b3aba650760b8cff3113341500fa414b17f4dd76))
|
|
29
|
+
* **runtime:** end a guest's HTTPS on the host, trusting the OS's own store ([5809be2](https://github.com/elct9620/kobako/commit/5809be20fb1127f29811e97062e68cfb11972b82))
|
|
30
|
+
* **runtime:** hold a socket's hop limit, and a UDP socket's buffer sizes ([8cf7385](https://github.com/elct9620/kobako/commit/8cf7385474c9ef569a4fee7d025cc5887fe8bb8a))
|
|
31
|
+
* **runtime:** hold a TCP socket's keepalive probes and buffer sizes ([a435964](https://github.com/elct9620/kobako/commit/a435964d9d61fcfec7435061b230367008a25fc9))
|
|
32
|
+
* **runtime:** hold a TCP socket's keepalive setting for its host socket ([4562f51](https://github.com/elct9620/kobako/commit/4562f510685a92ae02050674968679e15171b637))
|
|
33
|
+
* **runtime:** judge a guest's HTTP request by its endpoint's rules and the request policies ([69de0da](https://github.com/elct9620/kobako/commit/69de0dac95d0dfd2ce8f76c8dc39fdd1f92235ef))
|
|
34
|
+
* **runtime:** make a Filesystem from its kind without wrapping it first ([e7eb8a0](https://github.com/elct9620/kobako/commit/e7eb8a00a37794226edce2aa7f1bdcab2ef6790b))
|
|
35
|
+
* **runtime:** stream datagrams with one peer through a UDP socket file ([f72fd2e](https://github.com/elct9620/kobako/commit/f72fd2e80c8a85acdd66a07b394b723124a5c6ed))
|
|
36
|
+
* **runtime:** swap an entry's credential into a request bound to its own endpoints ([4b64ccb](https://github.com/elct9620/kobako/commit/4b64ccb61bcae18907bf424d2539052e9588875e))
|
|
37
|
+
* **transport:** carry the Guest ABI in the Canonical ABI's core shape ([34b9560](https://github.com/elct9620/kobako/commit/34b956001a05e15fe29febd7098b2ceb054e1bab))
|
|
38
|
+
* **wasmtime:** take the network's Protocol Family and Resolver from Config ([56cc53f](https://github.com/elct9620/kobako/commit/56cc53fa56cd987666f6b18b16e5264e314d8ef8))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* answer an oversized datagram EMSGSIZE from the socket itself ([02317bc](https://github.com/elct9620/kobako/commit/02317bcc8e1ef86aa4b4a5e7a3b63b297cb6aeab))
|
|
44
|
+
* bound a guest's header list by size and charge it to its memory ([80c9ee2](https://github.com/elct9620/kobako/commit/80c9ee2523e0a3ad5de78e769a45136bcbcb6dc8))
|
|
45
|
+
* **filesystem:** answer a Bind's macOS stored name that is not UTF-8 as an illegal sequence ([6b68ede](https://github.com/elct9620/kobako/commit/6b68edee7f48797104fb9c14948ebd9a79548e63))
|
|
46
|
+
* **filesystem:** answer a Bind's stored name that is not UTF-8 as an illegal sequence ([ca755a6](https://github.com/elct9620/kobako/commit/ca755a65576698c17ade2da337956fb2ef187382))
|
|
47
|
+
* **filesystem:** open on Linux only the file a Bind judged ([8073129](https://github.com/elct9620/kobako/commit/8073129219ee49c6b6d4fe6a1199e316bf4bbfa5))
|
|
48
|
+
* **http:** answer a request whose name has no address with DNS-error ([295fe03](https://github.com/elct9620/kobako/commit/295fe036232e9256b2b3ce49f46168a51ce3f7e2))
|
|
49
|
+
* **http:** refuse an outgoing body finished with trailers ([c3c8f1b](https://github.com/elct9620/kobako/commit/c3c8f1b3b6277865f119c04065109a8cb4e1ab76))
|
|
50
|
+
* **http:** send the trailers an outgoing body finishes with ([7792bcc](https://github.com/elct9620/kobako/commit/7792bccbedff4758b2ec85bae344c45769997518))
|
|
51
|
+
* **io:** answer a script's socket addr at the guest's own virtual address ([6e8891a](https://github.com/elct9620/kobako/commit/6e8891a9b242849f1d1d9cea825ab47480b69b0e))
|
|
52
|
+
* judge a request's authority, path, and headers as wasmtime does ([903cc7b](https://github.com/elct9620/kobako/commit/903cc7b39217f3038de6bab5981ea37499f25e1c))
|
|
53
|
+
* make each guest socket and its file at creation, as socket() does ([fca4311](https://github.com/elct9620/kobako/commit/fca4311060be90df2ec79c1d21bb3a9a5b0b36ca))
|
|
54
|
+
* **net:** abort a socket still waited on when its Invocation ends ([a1e8fd1](https://github.com/elct9620/kobako/commit/a1e8fd1bf2368e386812db0d637064c4675792b1))
|
|
55
|
+
* **net:** answer a dial with no local address as a DNS error ([954c486](https://github.com/elct9620/kobako/commit/954c4868bfe548c459b718897c22a5d3c7a8b0c7))
|
|
56
|
+
* **net:** answer a host down by its own name until a WASI code groups it ([1ec6001](https://github.com/elct9620/kobako/commit/1ec60013934486bf54fe2fa2e6fb6785009d4af1))
|
|
57
|
+
* **net:** answer a host socket's errno as wasmtime-wasi does on every host ([293ea2c](https://github.com/elct9620/kobako/commit/293ea2cccabc6d63840e199e796af419e2687658))
|
|
58
|
+
* **net:** answer a lookup's failure by its kind, as getaddrinfo does ([c70ae48](https://github.com/elct9620/kobako/commit/c70ae48796eb85f8ef62f9648acd1cd605070a02))
|
|
59
|
+
* **net:** answer a TLS handshake the server ends as connection-terminated ([7fa36bf](https://github.com/elct9620/kobako/commit/7fa36bf0b6121a27471134c7688550af5a479905))
|
|
60
|
+
* **net:** answer an IPv4-mapped address's lookup with its IPv4 address ([99f67c5](https://github.com/elct9620/kobako/commit/99f67c5da05bcc5d08222c8e505353475b68a93d))
|
|
61
|
+
* **net:** answer an unreachable request and a TLS alert as wasmtime-wasi-http does ([06bb9f9](https://github.com/elct9620/kobako/commit/06bb9f91c98bdb897853fc9fe0571ee20a6ee60d))
|
|
62
|
+
* **net:** answer connection-terminated for a connection cut mid-request ([bc7550c](https://github.com/elct9620/kobako/commit/bc7550c62e6fc12cbea1acc0f53349fc54a3e190))
|
|
63
|
+
* **net:** answer EAGAIN on a shut UDP read, as non-blocking Linux does ([675376d](https://github.com/elct9620/kobako/commit/675376d971c721ca23a5bd581e7d83db59dc94aa))
|
|
64
|
+
* **net:** answer preview2 permits, options, and schemes as wasmtime-wasi ([3489166](https://github.com/elct9620/kobako/commit/3489166945852ca53626b82510f5c0a728cf0b26))
|
|
65
|
+
* **net:** answer what the name server answered and sort as RFC 6724 does ([54fe183](https://github.com/elct9620/kobako/commit/54fe1838aadbbd9099298362944bdede7311be7b))
|
|
66
|
+
* **net:** ask a lost question again before taking half an answer ([0d8725e](https://github.com/elct9620/kobako/commit/0d8725efc9f8654f90ea6e9fc58000ac82d3fb5c))
|
|
67
|
+
* **net:** bound an HTTP request by the timeouts request-options sets ([b0e35d8](https://github.com/elct9620/kobako/commit/b0e35d80a275ecb33679ff1967e05f476f155ce7))
|
|
68
|
+
* **net:** bound each wait a request leaves without a timeout at 600 seconds ([bd0fb84](https://github.com/elct9620/kobako/commit/bd0fb848904a57fff6dbd8eff413915dc2eecc8c))
|
|
69
|
+
* **net:** cancel a name lookup nobody waits for ([bf8c668](https://github.com/elct9620/kobako/commit/bf8c6682055f8993060de7c79c2d4af51a0bd111))
|
|
70
|
+
* **net:** cancel a Windows name lookup through GetAddrInfoExW ([db42e04](https://github.com/elct9620/kobako/commit/db42e042859bbafc32fd929cc9c8b9ddb4226513))
|
|
71
|
+
* **net:** close a guest's TCP socket the way Linux closes one ([c0f95e0](https://github.com/elct9620/kobako/commit/c0f95e0410edd7498bb4a0cea0039cacef1253a4))
|
|
72
|
+
* **net:** dial an HTTP request's upstream through a TCP socket of the Invocation's own ([c4cb150](https://github.com/elct9620/kobako/commit/c4cb150f7cfe65db6cfa2cfc584002623b7b12cc))
|
|
73
|
+
* **net:** disarm a lookup's timer when the lookup is cancelled ([743a806](https://github.com/elct9620/kobako/commit/743a8065dfc98ce19d65f3a894ef1aecdc537b91))
|
|
74
|
+
* **net:** end a lookup whose socket cannot open, as res_send does ([f1c0869](https://github.com/elct9620/kobako/commit/f1c086972882f7fc112f217bba1ba1f075e34b0d))
|
|
75
|
+
* **net:** give a repeated real address one virtual address on every resolver ([c0d4666](https://github.com/elct9620/kobako/commit/c0d46667beff26588fba72e6b872ef0ed73c06af))
|
|
76
|
+
* **net:** hold a request's parts against memory while it is sent ([d1b642b](https://github.com/elct9620/kobako/commit/d1b642b1171d54b4c0d4cbc1ae6e8ff313b3dc89))
|
|
77
|
+
* **net:** hold a request's parts and a response's head against memory ([fbc93c5](https://github.com/elct9620/kobako/commit/fbc93c5d763396cb5b928801380ef3989ec931af))
|
|
78
|
+
* **net:** hold an HTTP request's place until its connection closes ([d6b9a14](https://github.com/elct9620/kobako/commit/d6b9a1404954f768caea6708eed045803651feec))
|
|
79
|
+
* **net:** hold one reactor timer per waiting task ([051b355](https://github.com/elct9620/kobako/commit/051b3559b19624f7c7d4e2f531574db1f77c8c6f))
|
|
80
|
+
* **net:** hold the seam's read buffer against the Invocation's memory ([b589454](https://github.com/elct9620/kobako/commit/b5894545e572e34e17cce06d59bfa08ea1688555))
|
|
81
|
+
* **net:** judge a request's method in the case the guest sends it ([d74784a](https://github.com/elct9620/kobako/commit/d74784a464aa60493e3b1718eb9fd5dd47468c8a))
|
|
82
|
+
* **net:** judge an unaskable name before asking, and move past a server that fails ([646d022](https://github.com/elct9620/kobako/commit/646d0222596ac1bbb352e87d9a1227e2bb271669))
|
|
83
|
+
* **net:** judge and reach a connected peer the way the outbound path promises ([8a2797b](https://github.com/elct9620/kobako/commit/8a2797b867c886cf03cd123b1efc3011d7819bac))
|
|
84
|
+
* **net:** keep a released response's head against the Invocation's memory ([c808ec2](https://github.com/elct9620/kobako/commit/c808ec2c9f7d2507e8e1ae381fc3e2e00f8ea747))
|
|
85
|
+
* **net:** keep one virtual address per name, and judge a UDP send's peer by it ([8cc7afe](https://github.com/elct9620/kobako/commit/8cc7afe97956a25489bccfa82bf7d1ec7e750818))
|
|
86
|
+
* **net:** let a Protocol Family say whether a UDP socket repoints ([d96b0dc](https://github.com/elct9620/kobako/commit/d96b0dcfa32b7f636a360f471d7e0bcb7bc9d453))
|
|
87
|
+
* **net:** name a host socket's failure from its errno where std names none ([dddffa4](https://github.com/elct9620/kobako/commit/dddffa4bdc22575e3af4b27809662b04127aafc6))
|
|
88
|
+
* **net:** never cancel a Windows lookup through a handle it already ended ([6fc0bd4](https://github.com/elct9620/kobako/commit/6fc0bd4bfca32bc166d26b7ca6feb2d5c21a24c1))
|
|
89
|
+
* **net:** poll a TCP socket writable once its room is half what it queued ([a1873ee](https://github.com/elct9620/kobako/commit/a1873eead26a9a69f24bfe2d4d17ed9806d758cc))
|
|
90
|
+
* **net:** read a host the guest names as wasmtime-wasi's lookup does ([2defe86](https://github.com/elct9620/kobako/commit/2defe8666e9046179dab4ff8b74057e69c9ab10a))
|
|
91
|
+
* **net:** read back the very failure an upstream socket answered ([2c5a158](https://github.com/elct9620/kobako/commit/2c5a1588d73c1d858008c99fd7cda7f41bb9fac3))
|
|
92
|
+
* **net:** read DNS replies and resolver files as glibc's stub does ([ca6ed41](https://github.com/elct9620/kobako/commit/ca6ed41d4bc5384f1b0a78eda49045971c5748d4))
|
|
93
|
+
* **net:** read EDESTADDRREQ and ENOPROTOOPT from a host socket's errno ([84f310e](https://github.com/elct9620/kobako/commit/84f310ee0e4102d6899d8144bc4b202ebe8b65cc))
|
|
94
|
+
* **net:** refuse a request whose target is not in origin form ([4d02252](https://github.com/elct9620/kobako/commit/4d02252ec6a5c4a714f99cc67f4f79bbab95558a))
|
|
95
|
+
* **net:** repoint a UDP socket within the family its route sends in ([a1d1696](https://github.com/elct9620/kobako/commit/a1d1696bad555b4af162f997ae0e47a32a495e1c))
|
|
96
|
+
* **net:** repoll a socket once, after the round that follows its request ([df2a0e2](https://github.com/elct9620/kobako/commit/df2a0e201442e3ebef4743fcc88e67597e1ead89))
|
|
97
|
+
* **net:** resolve names on Linux with a stub resolver that can be cancelled ([cd3e4eb](https://github.com/elct9620/kobako/commit/cd3e4eb0b6041c47ce01c29c844299cf0e90c745))
|
|
98
|
+
* **net:** send a request's Host as the endpoint judged it ([30cb26d](https://github.com/elct9620/kobako/commit/30cb26d4c66e00e3fffeff7d4824658c1c10bb61))
|
|
99
|
+
* **net:** start a request's name lookup on the thread that sends it ([20c0d8c](https://github.com/elct9620/kobako/commit/20c0d8c1df7752e79df1fc98132be9dd4a6373d1))
|
|
100
|
+
* **net:** start a TCP socket's send buffer at Linux's default until it connects ([ea560c8](https://github.com/elct9620/kobako/commit/ea560c8ecdb0af143f94581ed10147bdc3e0359a))
|
|
101
|
+
* **net:** take a UDP peer's datagrams in before repointing, and refuse an empty label ([a67fa20](https://github.com/elct9620/kobako/commit/a67fa200521fe16379c0db5afb556268a0f606a7))
|
|
102
|
+
* **net:** take a UDP socket's datagrams in bounded turns, counting what each holds ([3362df2](https://github.com/elct9620/kobako/commit/3362df24070231ecaa8aec4f556309a02e5b3949))
|
|
103
|
+
* **net:** take a UDP socket's turn again once it spends its bound ([2711e0d](https://github.com/elct9620/kobako/commit/2711e0dd45290758bea28031c1cde5c5797ff593))
|
|
104
|
+
* **net:** try the next address when a request's first one is refused at once ([ac04578](https://github.com/elct9620/kobako/commit/ac04578bd77cb666433fda285587451fc66d5692))
|
|
105
|
+
* **net:** wait on a socket by its own flag, and reset a released one sent to ([9dbac06](https://github.com/elct9620/kobako/commit/9dbac065500e78c84a2ae000f06064f6f21b17f1))
|
|
106
|
+
* **net:** wait on a socket whose non-blocking flag was cleared ([ad36e6c](https://github.com/elct9620/kobako/commit/ad36e6c41011f3cebe4f3b653a2bef8c05dbbf21))
|
|
107
|
+
* **network:** answer an endpoint the ruleset refuses as the Host App's argument ([1c6d710](https://github.com/elct9620/kobako/commit/1c6d710855495f874761eef1933f51c93a7a62b0))
|
|
108
|
+
* **network:** bind a credential a Basic pair carries encoded ([7b40467](https://github.com/elct9620/kobako/commit/7b40467218d347ca588a55d573a4457231782a5a))
|
|
109
|
+
* **network:** close a TCP socket once both ends sent their FIN, as tcp_done does ([db99d3b](https://github.com/elct9620/kobako/commit/db99d3b7128343fb307ef8f95e9fa97f03c8c275))
|
|
110
|
+
* **network:** compile a DNS endpoint like any other ([f47524b](https://github.com/elct9620/kobako/commit/f47524b888444314cd8762e45e4ef5ba4db92b64))
|
|
111
|
+
* **network:** count each invocation's open connections apart ([dc426f6](https://github.com/elct9620/kobako/commit/dc426f60595b2df4ff508e7534ae37b7afed502c))
|
|
112
|
+
* **network:** hand a request policy each header name in lower case ([fd8efae](https://github.com/elct9620/kobako/commit/fd8efaeb74340dcc9ba224020ffd596b21a7f4af))
|
|
113
|
+
* **network:** judge a path rule in work bounded by the path ([20f37fc](https://github.com/elct9620/kobako/commit/20f37fcece42d3aea0018c987948a0814448b38e))
|
|
114
|
+
* **network:** leave a refused hop limit out of a UDP connect's outcome ([0879854](https://github.com/elct9620/kobako/commit/087985403063cb1be453854f13d20e0822ba8fc8))
|
|
115
|
+
* **network:** never let an HTTP exchange go from inside its own task ([84b0ad9](https://github.com/elct9620/kobako/commit/84b0ad9ee5fca6be009e35cf7178503005d1b7f0))
|
|
116
|
+
* **network:** read a Mock's names with the URL host parser ([a170e19](https://github.com/elct9620/kobako/commit/a170e197a85a1f7ca1dd6d00d62cb7dfa33b39b7))
|
|
117
|
+
* **network:** read a socket's own end at a virtual port, not the host's ([1ef8486](https://github.com/elct9620/kobako/commit/1ef84864b6f8106e25eaa5fd0abf7310d56835c6))
|
|
118
|
+
* **network:** refuse a denied path in another case or with a trailing slash ([ff727bc](https://github.com/elct9620/kobako/commit/ff727bc5307f9739a54878d45e2359868877e4e8))
|
|
119
|
+
* **network:** refuse a Mock's dial with an errno that reads alike on every host ([3a7b705](https://github.com/elct9620/kobako/commit/3a7b705d82b195b4de1c54bc56fd04464dadba11))
|
|
120
|
+
* **network:** refuse a request carrying a credential's placeholder more than once ([03caf31](https://github.com/elct9620/kobako/commit/03caf319a318bbdec14273822dfcd612256a6b84))
|
|
121
|
+
* **network:** refuse a request whose credential cannot answer ([5b1f0c2](https://github.com/elct9620/kobako/commit/5b1f0c2abe8e2738aa3263ff3027245e7b654fb7))
|
|
122
|
+
* **network:** refuse a request whose method is not a token before any policy ([23a8e75](https://github.com/elct9620/kobako/commit/23a8e75d573b14610bdb048a0a3600017be0d69a))
|
|
123
|
+
* **network:** refuse an endpoint whose port was set to zero after it was built ([cac4605](https://github.com/elct9620/kobako/commit/cac46052eeffe272a7e5453e27aa8d97ff7e8409))
|
|
124
|
+
* **runtime:** answer a host refusal by the errno it holds, as Linux does ([637e02b](https://github.com/elct9620/kobako/commit/637e02b9a2a037b7d85e8216128c02c702d6c50a))
|
|
125
|
+
* **runtime:** answer a TCP socket's error, close, and shutdown as Linux does ([dd4c684](https://github.com/elct9620/kobako/commit/dd4c68478c431833d79073eda8de83fde020ba81))
|
|
126
|
+
* **runtime:** answer a UDP port unreachable as refused on Windows too ([32a94c3](https://github.com/elct9620/kobako/commit/32a94c3991265a6e967253d7d624c27282acc9c4))
|
|
127
|
+
* **runtime:** charge empty datagrams and virtual addresses ([9a4d9ba](https://github.com/elct9620/kobako/commit/9a4d9ba92cbd3ba5f7570f1693282202db43b6d9))
|
|
128
|
+
* **runtime:** charge the guest's growth and host-held memory to one budget ([f19659e](https://github.com/elct9620/kobako/commit/f19659ed93d0f5b0c1472dbc3bdbbb6815efbb4f))
|
|
129
|
+
* **runtime:** check a socket's state before its connect is translated or judged ([044f471](https://github.com/elct9620/kobako/commit/044f471f82aa5ac9edae39fae6dfae31be4e3dbf))
|
|
130
|
+
* **runtime:** class IPv6 addresses by IANA's special-purpose registry ([205ae65](https://github.com/elct9620/kobako/commit/205ae65e1924d65087e33472ba0074c840109932))
|
|
131
|
+
* **runtime:** connect a TCP socket again as Linux does ([7679d71](https://github.com/elct9620/kobako/commit/7679d71bd2bd71268b7da10a210be9522b032347))
|
|
132
|
+
* **runtime:** finish an Overlay's cut-short workdir cleanup before its next change ([5f04225](https://github.com/elct9620/kobako/commit/5f04225a4f584bff876d7ad059f61a67b376da86))
|
|
133
|
+
* **runtime:** follow Linux's inet socket through a connect that fails ([596febd](https://github.com/elct9620/kobako/commit/596febdbce08a45f5fc49b713977af5acc664702))
|
|
134
|
+
* **runtime:** give a socket its virtual port as Linux's inet layer does ([2c80c02](https://github.com/elct9620/kobako/commit/2c80c027801b5a00501fb8141e8ebde53879a855))
|
|
135
|
+
* **runtime:** give a Tmpfs whiteout an inode and times of its own ([34d8c31](https://github.com/elct9620/kobako/commit/34d8c312ba9864dd463af78a31589c93f5589cd0))
|
|
136
|
+
* **runtime:** give back a TCP socket's unnamed port once a connect fails ([03a5d7f](https://github.com/elct9620/kobako/commit/03a5d7fda454ba42a6a6798c1698b282be1c0f4e))
|
|
137
|
+
* **runtime:** give each Invocation's outbound seam its own TLS sessions ([75119d8](https://github.com/elct9620/kobako/commit/75119d88a49f546a2d827a9476c5067d99bc02dd))
|
|
138
|
+
* **runtime:** give each real address its own virtual address and dial one destination ([71c1b8d](https://github.com/elct9620/kobako/commit/71c1b8d7c3ee5ee34f57e5f1a48b43619176d129))
|
|
139
|
+
* **runtime:** hold a socket's buffers against the Invocation's memory ([5d629a7](https://github.com/elct9620/kobako/commit/5d629a71f1940222dac36a57502030025575ef70))
|
|
140
|
+
* **runtime:** hold a TCP socket's virtual port before it dials ([dff5cfe](https://github.com/elct9620/kobako/commit/dff5cfe788339146fda4ef3cb9b88c2cb6bd0302))
|
|
141
|
+
* **runtime:** judge a connect in Linux's order inside the runtime ([f5ede3a](https://github.com/elct9620/kobako/commit/f5ede3af5e8329c21f7630066c1ec539863ef433))
|
|
142
|
+
* **runtime:** judge IDN endpoints, Basic credentials, and request order as promised ([a1d4a35](https://github.com/elct9620/kobako/commit/a1d4a353f439cfa2fc5a9b11119f0bda622122ef))
|
|
143
|
+
* **runtime:** judge the guest's HTTP headers, binds, and peerless streams in the runtime ([bc3e024](https://github.com/elct9620/kobako/commit/bc3e024483e43d8b121cb67e661e06e99997f604))
|
|
144
|
+
* **runtime:** judge the request target the server reads ([9bc185e](https://github.com/elct9620/kobako/commit/9bc185e6f00375498f4d9119a34357e32d52279b))
|
|
145
|
+
* **runtime:** keep a deadline in a forked child with a ticker of its own ([030a3fa](https://github.com/elct9620/kobako/commit/030a3fa9360b93c0fcee4ba77c2f110ddf8d4b13))
|
|
146
|
+
* **runtime:** keep a failed growth in the memory peak ([2e2b986](https://github.com/elct9620/kobako/commit/2e2b986dfa47aff61f0c20ad9b63178bfccbd441))
|
|
147
|
+
* **runtime:** keep a name a Mock holds twice held until both holds drop ([26b362c](https://github.com/elct9620/kobako/commit/26b362cc9e61509f025ac6c5700bf3e95ed2b137))
|
|
148
|
+
* **runtime:** keep a refused connect's error when its options cannot be set ([258b51e](https://github.com/elct9620/kobako/commit/258b51e1d8398619da5cd6a1dcbd8e0ba42cf7d6))
|
|
149
|
+
* **runtime:** keep a socket's names for a host down to sockets ([6895bf9](https://github.com/elct9620/kobako/commit/6895bf97e7e1e2fa95d00e6602b39c16f3cb2f60))
|
|
150
|
+
* **runtime:** keep a TCP socket's options when its host socket refuses one ([53284a4](https://github.com/elct9620/kobako/commit/53284a4ad02da8dd23dd9402b070462f58b765aa))
|
|
151
|
+
* **runtime:** keep a UDP socket's port as it connects again ([070cf8a](https://github.com/elct9620/kobako/commit/070cf8a50c6b8cc93816b5a34711c3910d13333e))
|
|
152
|
+
* **runtime:** keep an interrupt to the run of the call it reached ([fa61002](https://github.com/elct9620/kobako/commit/fa610027b2d19fd746a4197340a1aa768964bc42))
|
|
153
|
+
* **runtime:** keep Nagle's algorithm on a guest's own TCP socket ([7db0695](https://github.com/elct9620/kobako/commit/7db06959f615300783b606a3cb7416c8b909980c))
|
|
154
|
+
* **runtime:** leave a parent watching a socket its forked child lets go ([25161bf](https://github.com/elct9620/kobako/commit/25161bfb079a3cee169bafbe11a5fafe7471adf5))
|
|
155
|
+
* **runtime:** let an HTTP exchange go once nothing holds it ([2d78df9](https://github.com/elct9620/kobako/commit/2d78df98d11cdd8671629b1da2a5ac4b0b1862e7))
|
|
156
|
+
* **runtime:** name a host failure the same way through a Bind as through a socket ([8d30507](https://github.com/elct9620/kobako/commit/8d30507987771fb94892c2388e19dcfb52f30d04))
|
|
157
|
+
* **runtime:** name a host failure through one table for files and sockets ([1490a1f](https://github.com/elct9620/kobako/commit/1490a1f7c5fdfa5a383a12bfb0e0b8a4fef3fcdd))
|
|
158
|
+
* **runtime:** name a host out of quota, links, or a busy program as Linux does ([6f5f816](https://github.com/elct9620/kobako/commit/6f5f816a6192dec2ea21c219a3a2f2497a6b2aac))
|
|
159
|
+
* **runtime:** name a local address another socket holds as EADDRINUSE ([6b39011](https://github.com/elct9620/kobako/commit/6b3901117e18568bd1c47d3f1a913df67f09ea35))
|
|
160
|
+
* **runtime:** read a UDP socket's own queue alone, leaving the rest to the reactor's next turn ([b1a9208](https://github.com/elct9620/kobako/commit/b1a92088e56c2f9f934aa4e7f6963f497d30c456))
|
|
161
|
+
* **runtime:** refuse a cap of zero in one place both frontends ask ([aef531e](https://github.com/elct9620/kobako/commit/aef531eda4f2b32bc4748b0d09b98058331af3b6))
|
|
162
|
+
* **runtime:** refuse a connect to an unmapped virtual address ([6a65311](https://github.com/elct9620/kobako/commit/6a653119a14d428df421157accf76ecb2ec04efb))
|
|
163
|
+
* **runtime:** refuse a connect when the host's addresses are unread ([47b1cd0](https://github.com/elct9620/kobako/commit/47b1cd0d168a6baa8c94bc5da85513bd3dc7e878))
|
|
164
|
+
* **runtime:** refuse a path servers normalize differently ([ba45e4f](https://github.com/elct9620/kobako/commit/ba45e4f5a48bf8f28e4e812465ad122bcbd8f72d))
|
|
165
|
+
* **runtime:** refuse a return area before the guest gives room for the answer ([8fe210c](https://github.com/elct9620/kobako/commit/8fe210ce77e4168a51842b57b05a076a65320a9f))
|
|
166
|
+
* **runtime:** refuse a second connect on a connecting or connected socket ([2949d40](https://github.com/elct9620/kobako/commit/2949d402303e11af2b4346a866fee754e1e00dbd))
|
|
167
|
+
* **runtime:** refuse an https request with no trust roots before dialing ([ba0995c](https://github.com/elct9620/kobako/commit/ba0995cd6dc3f5f9f6b0e74e8b0801348f35ebb5))
|
|
168
|
+
* **runtime:** report socket failures as Linux does and keep the reactor and resolver honest ([b7e9a0d](https://github.com/elct9620/kobako/commit/b7e9a0dfc55f32bbe2a844ff89c0bc4162429438))
|
|
169
|
+
* **runtime:** resolve a request's authority as a lookup holding its place ([fd62ff6](https://github.com/elct9620/kobako/commit/fd62ff6ba9a53ab66eb8a68037ae85bb95f01387))
|
|
170
|
+
* **runtime:** send a UDP datagram at once and answer its failures as Linux does ([6abbab0](https://github.com/elct9620/kobako/commit/6abbab0e0da88f4b05797396aa7c96b8e061b3ed))
|
|
171
|
+
* **runtime:** stop an Overlay copy up between chunks once its run must end ([855dfcc](https://github.com/elct9620/kobako/commit/855dfcc0a91d02730527b3219bc209c0231738a4))
|
|
172
|
+
* **runtime:** take a datagram past the receive buffer into an empty queue ([8f2f670](https://github.com/elct9620/kobako/commit/8f2f670619c7997e0c75a7869e1d5592b4c0e50a))
|
|
173
|
+
* **runtime:** take the reactor before a TCP socket dials ([e056522](https://github.com/elct9620/kobako/commit/e0565227c357d05bca12610cd26d4aaac85b604a))
|
|
174
|
+
* **runtime:** tell a Bind's entries apart by identity on Windows too ([7f42b5c](https://github.com/elct9620/kobako/commit/7f42b5c264ab095866beed471a433ed28e5830ea))
|
|
175
|
+
* **security:** fail the run when a nested mount's last name is missing ([757b654](https://github.com/elct9620/kobako/commit/757b654aa56336f72496f6b4f23de3635429849c))
|
|
176
|
+
* **security:** hold every name a nested mount's path leads through ([ae77f10](https://github.com/elct9620/kobako/commit/ae77f10589678601a1cd18807eff9d077938c86c))
|
|
177
|
+
* **security:** hold every name the walk placing a mount stepped onto ([ef9970e](https://github.com/elct9620/kobako/commit/ef9970ec6fa3b0b291a1fbd8873c4267b3465218))
|
|
178
|
+
* **security:** make no Cred for a Mount that stands nowhere ([c2c6190](https://github.com/elct9620/kobako/commit/c2c619095eb452d19be1aab65941b7cb86b339dd))
|
|
179
|
+
* **security:** refuse to move a directory above a nested mount ([e81193e](https://github.com/elct9620/kobako/commit/e81193e5259a296f71842053258cd78bf62487bf))
|
|
180
|
+
* **vfs:** ask a mount moved onto its name again as later mounts land ([515e944](https://github.com/elct9620/kobako/commit/515e944addca4b173cdd60b00949764e9f44e91e))
|
|
181
|
+
* **vfs:** ask a walk again when a move lands before a `..` out of a mount ([06b5bd8](https://github.com/elct9620/kobako/commit/06b5bd8e839dccde5dc25f4bd67df5f7058898ab))
|
|
182
|
+
* **vfs:** fail the run when a nested mount stands nowhere ([b6e44fa](https://github.com/elct9620/kobako/commit/b6e44fa43723831b2c7d37c64bbfea95f2086b83))
|
|
183
|
+
* **vfs:** find a directory's inode in use by its identity ([d817440](https://github.com/elct9620/kobako/commit/d817440b61ca50a192f0f8f1b3d1fd03fe80595d))
|
|
184
|
+
* **vfs:** find a mount point busy only once a removal or move may go ahead ([468e539](https://github.com/elct9620/kobako/commit/468e539513238a3235140f23b2b9a4f7703e1118))
|
|
185
|
+
* **vfs:** find a rename's source busy only when nothing stands at its name ([8a6416a](https://github.com/elct9620/kobako/commit/8a6416a69a48f7e6779be1ab53eff07d9d00ac0e))
|
|
186
|
+
* **vfs:** keep a dentry a move carried while its revalidation was asked ([cb20bb6](https://github.com/elct9620/kobako/commit/cb20bb6658d59e000d07fe6e9e299a0a0c5d3f35))
|
|
187
|
+
* **vfs:** keep a mount on its name where its link leads nowhere it can stand ([5100c3d](https://github.com/elct9620/kobako/commit/5100c3de9bfff5e9a2a17f981f8ea90bc9037b93))
|
|
188
|
+
* **vfs:** keep every mount reached as later mounts are placed ([1e550e6](https://github.com/elct9620/kobako/commit/1e550e684e857d524a72ea56a3669cf94c310e5e))
|
|
189
|
+
* **vfs:** place each mount as Linux's mount does, and open its preopen there ([a750bc7](https://github.com/elct9620/kobako/commit/a750bc75b3f1e8bcaf62ecaca1227fc0c92914c4))
|
|
190
|
+
* **vfs:** preopen only the outermost mounts and place the rest as Linux does ([7d21f34](https://github.com/elct9620/kobako/commit/7d21f348ab237497f4a509e464563f6c472a8a17))
|
|
191
|
+
* **vfs:** reach a nested mount however the guest spells its path ([73fb96a](https://github.com/elct9620/kobako/commit/73fb96ab63eaf01c73aaef1c803424513b2b07fd))
|
|
192
|
+
* **vfs:** show the later of two mounts standing on one directory ([baa4f16](https://github.com/elct9620/kobako/commit/baa4f16fba855d5383376c30cd442c6953b6ca58))
|
|
193
|
+
* **vfs:** stand a mount on the directory a link at its path leads to ([6f7d8ef](https://github.com/elct9620/kobako/commit/6f7d8eff35269165014300ea36b1af9db4d24f21))
|
|
194
|
+
* **vfs:** stand a mount on the name its path spells again ([5ed6e51](https://github.com/elct9620/kobako/commit/5ed6e51ebc6b146d13c39fe1d7722a9c054b5712))
|
|
195
|
+
* **vfs:** stand a mount only where a walk of its own path reaches it ([f9138b0](https://github.com/elct9620/kobako/commit/f9138b0eee7eea5298b4dced99428ed0492a7319))
|
|
196
|
+
* **vfs:** stand a nested mount on its mount point's dentry ([9ae2dd8](https://github.com/elct9620/kobako/commit/9ae2dd8b2403bd62faa62208d05a704d00de709a))
|
|
197
|
+
* **wasmtime:** answer a connect, a short write, and a datagram's sender as wasmtime-wasi ([d1762d0](https://github.com/elct9620/kobako/commit/d1762d0a6f703c003cdb8bf00c81628f61ce2b6f))
|
|
198
|
+
* **wasmtime:** give back the charge of a growth wasmtime then fails ([070c463](https://github.com/elct9620/kobako/commit/070c463e11428eb27465d6d9a9e7ba38b738249f))
|
|
199
|
+
* **wasmtime:** judge a TCP socket's pollable by the connect under way as it is polled ([b89bccd](https://github.com/elct9620/kobako/commit/b89bccdba789d69dc7b69ad07a7176b0d310b963))
|
|
200
|
+
* **wasmtime:** refuse a short socket write whole, before any byte leaves ([5be1ec0](https://github.com/elct9620/kobako/commit/5be1ec027474376ecfcadce6d280891efe1a0afa))
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### Performance Improvements
|
|
204
|
+
|
|
205
|
+
* **vfs:** keep a walk's trail only where a mount is placed ([ab34a1a](https://github.com/elct9620/kobako/commit/ab34a1a373fceb54167545aeb0a9aea7ebd98af2))
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
### Code Refactoring
|
|
209
|
+
|
|
210
|
+
* **network:** name each Policies setter after the policy it sets ([299bfe1](https://github.com/elct9620/kobako/commit/299bfe114dae25fe82de8d10a27db6b7de14f018))
|
|
211
|
+
* **runtime:** keep the ruleset and the L7 transport inside the runtime ([18db50b](https://github.com/elct9620/kobako/commit/18db50b68c11fa0d8e7764fc40523453b1032852))
|
|
212
|
+
* **runtime:** name the errno type Errno at the crate root ([f608e31](https://github.com/elct9620/kobako/commit/f608e31e81d1be9ddc6bb2fc8f6a26e5acafced4))
|
|
213
|
+
* **runtime:** name the missing Guest Binary's setup failure after what is missing ([732b8be](https://github.com/elct9620/kobako/commit/732b8bece8e796bd36d5e350b623c5ab8db28349))
|
|
214
|
+
* **sdk:** hold a Sandbox's caps as the runtime's Limits ([9730d6a](https://github.com/elct9620/kobako/commit/9730d6a73fec595c2b75ac8981aeb655937045df))
|
|
215
|
+
* **security:** prepare an invocation's Cred as Linux's prepare_creds does ([e4f8f86](https://github.com/elct9620/kobako/commit/e4f8f86f3b25fd468f54dcc332e5767ac4ac9c32))
|
|
216
|
+
* **transport:** name a Call's reply CallReply beside YieldReply and CompileReply ([f34063e](https://github.com/elct9620/kobako/commit/f34063ee94edb723800b4a0670cf912aa1a445e0))
|
|
217
|
+
* **transport:** name the message cap by what it bounds ([133e1c1](https://github.com/elct9620/kobako/commit/133e1c151506a1f41d5f2d17ac2678648c6ed262))
|
|
218
|
+
* **vfs:** build a change, a call, and a device number by the names Rust and Linux use ([f5710f8](https://github.com/elct9620/kobako/commit/f5710f82f0452d8aeb7dd8ee7cc2b822ae7c14fe))
|
|
219
|
+
* **vfs:** read an inode's or a file's type as file_type ([48150f7](https://github.com/elct9620/kobako/commit/48150f75263e9c195a8751ba8a9654c029162aa6))
|
|
220
|
+
* **vfs:** spell a rename, a listing, and an open file's flags as Linux and Rust do ([5bc0175](https://github.com/elct9620/kobako/commit/5bc01757679c2b68c77e22dd86e3dac9f001f4b5))
|
|
221
|
+
|
|
3
222
|
## [0.20.0](https://github.com/elct9620/kobako/compare/kobako-runtime-v0.19.0...kobako-runtime-v0.20.0) (2026-11-07)
|
|
4
223
|
|
|
5
224
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
[package]
|
|
18
18
|
name = "kobako-runtime"
|
|
19
|
-
version = "0.
|
|
19
|
+
version = "0.21.0"
|
|
20
20
|
edition = "2021"
|
|
21
21
|
description = "Engine-neutral host runtime contract for embedding kobako Wasm guests."
|
|
22
22
|
license = "Apache-2.0"
|
|
@@ -24,13 +24,16 @@ repository = "https://github.com/elct9620/kobako"
|
|
|
24
24
|
readme = "README.md"
|
|
25
25
|
keywords = ["wasm", "mruby", "sandbox", "wasi"]
|
|
26
26
|
categories = ["wasm", "virtualization"]
|
|
27
|
+
# The tests reach files only this repository holds, so a copy of the crate
|
|
28
|
+
# taken to customize builds without them.
|
|
29
|
+
exclude = ["tests/"]
|
|
27
30
|
|
|
28
31
|
# The fixed tier: the Envelope this contract routes and attributes
|
|
29
32
|
# through. The version pin rides the linked release group; the path keeps
|
|
30
33
|
# in-tree builds (and the Ruby gem, which ships both crates) resolving
|
|
31
34
|
# locally.
|
|
32
35
|
[dependencies]
|
|
33
|
-
kobako-transport = { version = "0.
|
|
36
|
+
kobako-transport = { version = "0.21.0", path = "../kobako-transport" }
|
|
34
37
|
# cap-std resolves each name a Bind is asked beneath its host directory,
|
|
35
38
|
# on every host Windows included. The VFS already hands one name and
|
|
36
39
|
# follows links itself; cap-std still refuses a `..` or a symbolic link
|
|
@@ -42,14 +45,59 @@ cap-std = "4.0.3"
|
|
|
42
45
|
cap-fs-ext = "4.0.3"
|
|
43
46
|
# Bounds the host directories a Bind keeps open for walks.
|
|
44
47
|
lru = "0.19.0"
|
|
48
|
+
# Reads the host's own addresses, which the ruleset counts as local
|
|
49
|
+
# whatever registry classes them, on POSIX and Windows alike.
|
|
50
|
+
if-addrs = "0.15.0"
|
|
51
|
+
# Reads a host the guest names as wasmtime-wasi's lookup does, with the URL
|
|
52
|
+
# host parser: an address in any IPv4 spelling, or a name as its A-label, so
|
|
53
|
+
# the hooks and the endpoints judge one spelling of it.
|
|
54
|
+
url = "2.5.8"
|
|
55
|
+
# The outbound seam: hyper's HTTP/1 client, which binds to no async
|
|
56
|
+
# runtime, driven on kobako's reactor and dialing only through kobako's
|
|
57
|
+
# connector; no default feature, so it decompresses and redirects nothing.
|
|
58
|
+
hyper = { version = "1.12.0", features = ["client", "http1"] }
|
|
59
|
+
http-body = "1.0.1"
|
|
60
|
+
http-body-util = "0.1.3"
|
|
61
|
+
bytes = "1.11.1"
|
|
62
|
+
# The I/O traits tokio-rustls reads and writes through; no feature, so no
|
|
63
|
+
# runtime comes with them.
|
|
64
|
+
tokio = { version = "1.54.1", default-features = false }
|
|
65
|
+
tokio-rustls = { version = "0.26.4", default-features = false, features = ["ring", "tls12"] }
|
|
66
|
+
# TLS ends on the host, over ring, trusting the OS's own store, so a revoked or
|
|
67
|
+
# added root follows the host's patches rather than a kobako release.
|
|
68
|
+
rustls = { version = "0.23.46", default-features = false, features = ["std", "ring", "tls12"] }
|
|
69
|
+
rustls-platform-verifier = "0.7.1"
|
|
70
|
+
# The reactor: one thread waits on every host socket without blocking on
|
|
71
|
+
# any, on epoll, kqueue, or IOCP alike, and on the socket macOS answers a
|
|
72
|
+
# name lookup through.
|
|
73
|
+
mio = { version = "1.2.0", features = ["os-poll", "os-ext", "net"] }
|
|
74
|
+
# Sets the socket options a guest asks for, such as SO_KEEPALIVE, on the host
|
|
75
|
+
# socket it dials, on POSIX and Windows alike; std sets only a few.
|
|
76
|
+
socket2 = { version = "0.6.3", features = ["all"] }
|
|
77
|
+
# Zeroes a credential's value as it drops, so a freed page holds no secret.
|
|
78
|
+
zeroize = "1.9.1"
|
|
45
79
|
|
|
46
80
|
# rustix switches a Bind's file to append mode for one write, so the
|
|
47
81
|
# host places it at the file's end in one step; std cannot set file flags.
|
|
48
82
|
# It also opens a Bind's directory several names deep with Linux's
|
|
49
|
-
# openat2,
|
|
83
|
+
# openat2, holds a file by O_PATH before reopening it through /proc,
|
|
84
|
+
# and reads which macOS release confines such an open, and which errno a
|
|
85
|
+
# host call failed with, which std names no kind for.
|
|
50
86
|
[target.'cfg(unix)'.dependencies]
|
|
51
87
|
rustix = { version = "1.1.4", features = ["fs", "system"] }
|
|
52
88
|
|
|
89
|
+
# rustix reads which Winsock error a host call failed with, which std
|
|
90
|
+
# names no kind for, as on POSIX. windows-sys asks Windows for a name through
|
|
91
|
+
# GetAddrInfoExW, whose query a lookup can cancel, which std cannot.
|
|
92
|
+
[target.'cfg(windows)'.dependencies]
|
|
93
|
+
rustix = { version = "1.1.4", features = ["net"] }
|
|
94
|
+
windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_Networking_WinSock", "Win32_System_IO"] }
|
|
95
|
+
|
|
96
|
+
# simple-dns reads and writes the DNS messages the Linux stub resolver sends
|
|
97
|
+
# to a name server, its compression loops refused; it pulls in only bitflags.
|
|
98
|
+
[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
|
|
99
|
+
simple-dns = "0.13.1"
|
|
100
|
+
|
|
53
101
|
# libc asks macOS for the name a directory stores, which a Mount's Policy
|
|
54
102
|
# judges in place of a spelling the host folds, and opens a directory
|
|
55
103
|
# beneath another with O_NOFOLLOW_ANY; rustix has neither.
|
|
@@ -14,13 +14,16 @@ engine stays swappable.
|
|
|
14
14
|
| `snapshot` | each invocation's `Completion` (outcome or trap), both output `Capture`s, and `Usage` |
|
|
15
15
|
| `error` | the neutral failure types: `Trap`, `SetupError`, and `InvokeError` over both |
|
|
16
16
|
| `profile` | the isolation `Profile` a runtime declares |
|
|
17
|
-
| `grant` | the `Grant`
|
|
18
|
-
| `mount` | the `Mount` at a guest path, its `Access`, and the `
|
|
17
|
+
| `grant` | the `Grant` each invocation receives, the supported `GrantKind`s, and the `Policy` |
|
|
18
|
+
| `mount` | the `Mount` at a guest path, its `Access`, and the `MountRequest` its `Policy` judges |
|
|
19
|
+
| `network` | a named `Network` entry: its endpoints, credentials, and `Policies` |
|
|
20
|
+
| `net` | the `Namespace` behind the guest's sockets and HTTP, and its seams |
|
|
19
21
|
| `filesystem` | the `FileSystemType` and `InodeOperations` traits and the three kinds kobako ships |
|
|
20
22
|
| `endpoint` | the host side of the kobako ABI, over the `GuestInstance` an engine implements |
|
|
21
23
|
| `vfs` | the walk, open files, and pipes each engine's calls reach, whichever ABI it encodes |
|
|
22
24
|
| `security` | the security modules an invocation registers: kobako's own rules and each Mount's `Policy` |
|
|
23
|
-
| `sched` | the `Blocking` a frontend registers, how its threads wait
|
|
25
|
+
| `sched` | the `Blocking` a frontend registers, how its threads wait |
|
|
26
|
+
| `wait` | the wait queues and `do_poll` a host-side wait sleeps on |
|
|
24
27
|
| `dispatch` / `yielder` | the `DispatchHandler` and `Yielder` traits a frontend supplies for guest→host dispatch and block-yield re-entry |
|
|
25
28
|
|
|
26
29
|
Engine implementations such as `kobako-wasmtime` implement `Runtime`.
|
|
@@ -33,7 +36,7 @@ Add the crate to an engine or a frontend that speaks the contract.
|
|
|
33
36
|
|
|
34
37
|
```toml
|
|
35
38
|
[dependencies]
|
|
36
|
-
kobako-runtime = "0.
|
|
39
|
+
kobako-runtime = "0.21.0" # x-release-please-version
|
|
37
40
|
```
|
|
38
41
|
|
|
39
42
|
## License
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
//! Who a call is made for, as Linux's `struct cred`: the security modules
|
|
2
|
+
//! registered for the caller, the memory charged on its behalf, the profile it
|
|
3
|
+
//! sees entries through, and its mount namespace. The hooks that ask its
|
|
4
|
+
//! modules live with the security framework, as `security/security.c` holds
|
|
5
|
+
//! them apart from `kernel/cred.c`.
|
|
6
|
+
|
|
7
|
+
use std::sync::Arc;
|
|
8
|
+
|
|
9
|
+
use crate::memcg::MemoryBudget;
|
|
10
|
+
use crate::profile::Profile;
|
|
11
|
+
use crate::security::SecurityOperations;
|
|
12
|
+
use crate::vfs::{MntNamespace, VfsMount};
|
|
13
|
+
|
|
14
|
+
/// Who a call is made for, holding the security modules registered for it, as
|
|
15
|
+
/// `cred->security` holds a Landlock domain, and the memory budget the host
|
|
16
|
+
/// charges what it holds on the caller's behalf to, which every Cred restricted
|
|
17
|
+
/// from it shares, as a task's memory cgroup does. Its profile decides what the
|
|
18
|
+
/// caller sees of an entry, as `cred->user_ns` decides the owner `cp_new_stat`
|
|
19
|
+
/// reports. Its mount namespace says which mount stands on which name, as a
|
|
20
|
+
/// task's `nsproxy` holds one beside its credentials.
|
|
21
|
+
pub struct Cred {
|
|
22
|
+
security: Vec<Arc<dyn SecurityOperations>>,
|
|
23
|
+
memory: Arc<MemoryBudget>,
|
|
24
|
+
profile: Profile,
|
|
25
|
+
mnt_ns: Arc<MntNamespace>,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// One no module is registered for, which this crate's tests make calls as.
|
|
29
|
+
#[cfg(test)]
|
|
30
|
+
impl Default for Cred {
|
|
31
|
+
fn default() -> Self {
|
|
32
|
+
Self {
|
|
33
|
+
security: Vec::new(),
|
|
34
|
+
memory: MemoryBudget::new(None),
|
|
35
|
+
profile: Profile::Hermetic,
|
|
36
|
+
mnt_ns: Arc::default(),
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
impl Cred {
|
|
42
|
+
/// One with `security` registered, its memory unbounded.
|
|
43
|
+
pub(crate) fn new(security: Vec<Arc<dyn SecurityOperations>>) -> Arc<Self> {
|
|
44
|
+
Self::within(security, MemoryBudget::new(None))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// One with `security` registered, charging what is held on its behalf to
|
|
48
|
+
/// `memory`, seeing entries as the hermetic profile does until told
|
|
49
|
+
/// otherwise.
|
|
50
|
+
pub(crate) fn within(
|
|
51
|
+
security: Vec<Arc<dyn SecurityOperations>>,
|
|
52
|
+
memory: Arc<MemoryBudget>,
|
|
53
|
+
) -> Arc<Self> {
|
|
54
|
+
Arc::new(Self {
|
|
55
|
+
security,
|
|
56
|
+
memory,
|
|
57
|
+
profile: Profile::Hermetic,
|
|
58
|
+
mnt_ns: Arc::default(),
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/// This Cred with `more` modules registered after its own, sharing the
|
|
63
|
+
/// memory held on its behalf, as `landlock_restrict_self` adds a domain.
|
|
64
|
+
pub(crate) fn with_modules(&self, more: Vec<Arc<dyn SecurityOperations>>) -> Arc<Self> {
|
|
65
|
+
let mut security = self.security.clone();
|
|
66
|
+
security.extend(more);
|
|
67
|
+
Arc::new(Self {
|
|
68
|
+
security,
|
|
69
|
+
memory: self.memory.clone(),
|
|
70
|
+
profile: self.profile,
|
|
71
|
+
mnt_ns: self.mnt_ns.clone(),
|
|
72
|
+
})
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// This Cred with `mnt_ns` as its mount namespace, as a task that unshared
|
|
76
|
+
/// its mounts holds a namespace of its own.
|
|
77
|
+
pub(crate) fn with_mnt_ns(&self, mnt_ns: Arc<MntNamespace>) -> Arc<Self> {
|
|
78
|
+
Arc::new(Self {
|
|
79
|
+
security: self.security.clone(),
|
|
80
|
+
memory: self.memory.clone(),
|
|
81
|
+
profile: self.profile,
|
|
82
|
+
mnt_ns,
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/// The mount a walk from the root of `mnt` stands on: the topmost of those
|
|
87
|
+
/// stacked over that root, as Linux's `topmost_overmount` answers.
|
|
88
|
+
pub fn topmost_overmount(&self, mnt: &Arc<VfsMount>) -> Arc<VfsMount> {
|
|
89
|
+
self.mnt_ns.topmost_overmount(mnt)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/// This Cred seeing entries as `profile` does, as a task's credentials
|
|
93
|
+
/// carry the user namespace its stat is reported in.
|
|
94
|
+
pub fn with_profile(&self, profile: Profile) -> Arc<Self> {
|
|
95
|
+
Arc::new(Self {
|
|
96
|
+
security: self.security.clone(),
|
|
97
|
+
memory: self.memory.clone(),
|
|
98
|
+
profile,
|
|
99
|
+
mnt_ns: self.mnt_ns.clone(),
|
|
100
|
+
})
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// The security modules registered for the caller, in the order they are
|
|
104
|
+
/// asked.
|
|
105
|
+
pub(crate) fn modules(&self) -> &[Arc<dyn SecurityOperations>] {
|
|
106
|
+
&self.security
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/// Which mount stands on which name for the caller.
|
|
110
|
+
pub(crate) fn mnt_ns(&self) -> &MntNamespace {
|
|
111
|
+
&self.mnt_ns
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/// The isolation profile the caller runs under.
|
|
115
|
+
pub fn profile(&self) -> Profile {
|
|
116
|
+
self.profile
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/// The budget the caller's memory is charged to, which a Wasm Driver also
|
|
120
|
+
/// charges the guest's own growth to.
|
|
121
|
+
pub fn memory_budget(&self) -> &Arc<MemoryBudget> {
|
|
122
|
+
&self.memory
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
//!
|
|
4
4
|
//! The runtime decodes the Envelope and hands a handler the routed
|
|
5
5
|
//! `Call` — target, method, block flag, and the payload bytes it never
|
|
6
|
-
//! reads — then expects a `
|
|
6
|
+
//! reads — then expects a `CallReply` back. What the handler *is* — a Ruby
|
|
7
7
|
//! Proc, a Rust closure — is the frontend's concern; the runtime only sees
|
|
8
|
-
//! this trait.
|
|
9
|
-
//! it.
|
|
8
|
+
//! this trait.
|
|
10
9
|
|
|
11
10
|
use crate::yielder::Yielder;
|
|
12
|
-
use kobako_transport::envelope::{Call,
|
|
11
|
+
use kobako_transport::envelope::{Call, CallReply};
|
|
13
12
|
|
|
14
13
|
/// Host-side handler for a guest→host dispatch.
|
|
15
14
|
///
|
|
@@ -24,7 +23,7 @@ use kobako_transport::envelope::{Call, Reply};
|
|
|
24
23
|
/// The `Call` borrows the buffer the runtime decoded, so a handler passes
|
|
25
24
|
/// the payload onward without copying it first.
|
|
26
25
|
pub trait DispatchHandler: Send + Sync {
|
|
27
|
-
fn dispatch(&self, call: Call<'_>, yielder: &mut dyn Yielder) -> Option<
|
|
26
|
+
fn dispatch(&self, call: Call<'_>, yielder: &mut dyn Yielder) -> Option<CallReply>;
|
|
28
27
|
|
|
29
28
|
/// Whether the host gave up on this invocation, as when one of its
|
|
30
29
|
/// callbacks raised something meant for the host rather than the
|