Skip to content

agent: directories in maskedPaths are not masked #14188

Closed

Description

@dims

kata-agent applies linux.maskedPaths by bind-mounting /dev/null over each entry and treating ENOTDIR as success (mask_path in src/agent/rustjail/src/mount.rs). A directory in the list is left alone.

With containerd's default list, /sys/firmware stays visible in every kata container, and a container can read the guest's ACPI tables, SMBIOS table and memory map under it. /proc/acpi is left unmasked too, but is empty with the kata guest kernel. The other default directories do not exist in the guest, and the per-CPU thermal_throttle entries containerd adds are dropped the same way.

Reproduce with containerd and kata 4.3.1 on x86_64:

ctr run --rm --runtime io.containerd.kata.v2 docker.io/library/alpine:3.22 t \
  sh -c 'ls /sys/firmware; ls /sys/firmware/acpi/tables'

runc: /sys/firmware is empty. kata: acpi devicetree dmi memmap, and the tables are readable.

Expected: the behavior of runc and crun, which mount an empty read-only tmpfs over a masked directory and share one tmpfs between all of them (runc maskPaths, crun mount_masked_dir, see opencontainers/runc#5275 and containers/crun#2304).

readonlyPaths is not affected; readonly_path handles directories.

Activity

  1. added a commit that references this issue on Nov 1, 2026
    0a735bb
  2. dims commented on Nov 1, 2026

    @dims
    ContributorAuthor
  3. added a commit that references this issue on Nov 1, 2026
    1e285a2
  4. added a commit that references this issue on Nov 2, 2026
    35d99cc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions