Files
Ryan El KochtaandgVisor bot 595d7505da New mount API: implement fsopen(2), fsconfig(2), fsmount(2), move_mount(2).
The first step in implementing the new file-descriptor based mount API in
gVisor. A "filesystem creation context" is created using fsopen(). The context
is then configured using fsconfig(), and the FSCONFIG_CMD_CREATE command is
used to create a filesystem. A "mount object" can be obtained using fsmount(),
which can be operated on directly using the *at() functions or mounted onto the
real directory tree using move_mount().

The current implementation has the following limitations:
- Linux passes configuration options to filesystems on-the-fly as fsopen() and
  fsconfig() are called, allowing per-parameter error handling. gVisor
  currently queues up all options and passes them to the filesystem all-at-once
  when FSCONFIG_CMD_CREATE occurs. Lifting this will require refactoring the
  option parsing for all existing filesystems.
- Only flag and string arguments to fsconfig() are supported.
- FSCONFIG_CMD_RECONFIGURE is not supported.
- move_mount(): flags MOVE_MOUNT_SET_GROUP and MOVE_MOUNT_BENEATH are not
  supported.
- The filesystem context message retrieval interface is not supported.

In the interest of review size, there is no implementation yet for
mount_setattr(2), open_tree(2), or fspick(2).

PiperOrigin-RevId: 931245256
2026-06-12 11:28:09 -07:00

17 lines
333 B
Python

load("//tools:defs.bzl", "go_library")
package(default_applicable_licenses = ["//:license"])
licenses(["notice"])
go_library(
name = "mountfd",
srcs = ["mountfd.go"],
visibility = ["//pkg/sentry:internal"],
deps = [
"//pkg/context",
"//pkg/sentry/kernel/auth",
"//pkg/sentry/vfs",
],
)