WEFT_OS/crates/weft-runtime
Marco Allegretti f519832af1
fix(portal): confine file operations beneath the granted directory
The portal normalised a request path to check it against the granted
directories, but then operated on the raw path. A link inside a granted
directory, followed by '..', therefore reached files outside it. Links
pointing outside were followed too.

Each granted directory is now opened once. Every request is resolved
beneath that descriptor with openat2(RESOLVE_BENEATH | NO_MAGICLINKS),
so the kernel keeps the operation inside the directory even when links
are replaced while it runs. Paths with '.' or '..' components are
refused.

Other changes:
- Writes replace the file atomically and no longer create directories.
- Files are limited to 16 MiB, listings to 10,000 entries, request
  lines to the size of a full write, and the portal to 4 concurrent
  connections.
- The runtime no longer passes the portal's socket path to components,
  which cannot reach it.
2026-10-09 18:06:25 +00:00
..
src fix(portal): confine file operations beneath the granted directory 2026-10-09 18:06:25 +00:00
wit fix(runtime): close fetch and preopen gaps in grant enforcement 2026-10-09 08:25:40 +00:00
Cargo.toml fix(runtime): enforce effective capability grants per session 2026-10-09 08:08:58 +00:00