Cisco has introduced a new file system, PuzzleFS, implemented as a module for the Linux kernel, written in Rust. The file system is designed for use with isolated containers and continues to develop the ideas proposed in the Atomfs file system. The implementation is currently at the prototype stage, supports building with the Linux kernel rust-next branch, and is open under the Apache 2.0 and MIT licenses.
The project aims to circumvent the limitations that arise when using container images in the OCI (Open Container Initiative) format. PuzzleFS addresses issues such as efficient storage of duplicate data, direct mounting capability, repeatable image building, and safe memory operations.
For deduplicating repeating data across different containers, the FastCDC (Fast Content-Defined Chunking) algorithm is employed, which works by breaking data into chunks of arbitrary size and maintaining an index with hashes of the processed chunks. Duplicate chunks are stored once and are jointly indexed for all layers of the file system, meaning that deduplication can span different mount points (a new file system layer can be started based on an existing one, utilizing the chunks of data it contains during deduplication).
Repeatable image building for containers is achieved through defining a canonical representation of the container image format. Direct mounting allows the mounting of an OCI container image from a global shared storage without prior unpacking, using the content hash from the container manifest as an identifier. To verify data integrity in a shared storage environment, the fs-verity mechanism can be employed, which checks the conformity of specified hashes in the binary index with the actual content when accessing files.
Rust is chosen for its combination of high performance in the resulting code and the ability to safely handle memory, which reduces the risk of vulnerabilities caused by issues such as accessing memory after it has been freed and buffer overflows. The application of Rust for the kernel module also allows for code sharing between the kernel and user-space components, creating a unified secure implementation.
Among other goals of the project are very fast image building and mounting, the ability to use an optional intermediate stage for image transformation (canonicalization), the non-requirement of full passes through the FS tree in mtree style when using a layered structure, changes overlay in the style of casync, and a straightforward architecture to implement.
Source: opennet.ru
