Lines Matching full:fs

6 fs-verity: read-only file-based authenticity protection
12 fs-verity (``fs/verity/``) is a support layer that filesystems can
16 needed to support fs-verity.
18 fs-verity is similar to `dm-verity
21 filesystems supporting fs-verity, userspace can execute an ioctl that
30 the "fs-verity file digest", which is a hash that includes the Merkle
31 tree root hash) that fs-verity is enforcing for the file. This ioctl
34 fs-verity is essentially a way to hash a file in constant time,
41 By itself, the base fs-verity feature only provides integrity
44 However, because fs-verity makes retrieving the file hash extremely
51 authenticate the contents of an fs-verity file by using the
55 A standard file hash could be used instead of fs-verity. However,
63 Unlike an ahead-of-time hash, fs-verity also re-verifies data each
67 fs-verity does not replace or obsolete dm-verity. dm-verity should
68 still be used on read-only filesystems. fs-verity is for files that
72 The base fs-verity feature is a hashing mechanism only; actually
74 users' needs, fs-verity optionally supports a simple signature
76 that all fs-verity files be signed by a key loaded into a keyring; see
77 `Built-in signature verification`_. Support for fs-verity file hashes
86 The FS_IOC_ENABLE_VERITY ioctl enables fs-verity on a file. It takes
160 - ``ENOKEY``: the fs-verity keyring doesn't contain the certificate
162 - ``ENOPKG``: fs-verity recognizes the hash algorithm, but it's not
165 - ``ENOTTY``: this type of filesystem does not implement fs-verity
166 - ``EOPNOTSUPP``: the kernel was not configured with fs-verity
168 feature enabled on it; or the filesystem does not support fs-verity
181 The fs-verity file digest is a cryptographic digest that identifies
213 - ``ENOTTY``: this type of filesystem does not implement fs-verity
214 - ``EOPNOTSUPP``: the kernel was not configured with fs-verity
228 fs-verity compatible verification of the file. This only makes sense
232 This is a fairly specialized use case, and most fs-verity users won't
257 - ``FS_VERITY_METADATA_TYPE_DESCRIPTOR`` reads the fs-verity
258 descriptor. See `fs-verity descriptor`_.
276 implement fs-verity compatible verification anyway (though absent a
290 - ``ENOTTY``: this type of filesystem does not implement fs-verity, or
292 - ``EOPNOTSUPP``: the kernel was not configured with fs-verity
299 The existing ioctl FS_IOC_GETFLAGS (which isn't specific to fs-verity)
300 can also be used to check whether a file has fs-verity enabled or not.
310 the file has fs-verity enabled. This can perform better than
324 allowed, since these are not measured by fs-verity. Verity files
336 - If the sysctl "fs.verity.require_signatures" is set to 1 and the
337 file is not signed by a key in the fs-verity keyring, then opening
342 its "verity"-ness. fs-verity is primarily meant for files like
348 This section describes how fs-verity hashes the file contents using a
351 that support fs-verity.
354 compute fs-verity file digests itself, e.g. in order to sign files.
396 fs-verity descriptor
404 To solve this problem, the fs-verity file digest is actually computed
423 With CONFIG_FS_VERITY_BUILTIN_SIGNATURES=y, fs-verity supports putting
427 1. At fs-verity module initialization time, a keyring ".fs-verity" is
434 detached signature in DER format of the file's fs-verity digest.
438 in the ".fs-verity" keyring.
440 3. A new sysctl "fs.verity.require_signatures" is made available.
444 fs-verity file digests must be signed in the following format, which
454 fs-verity's built-in signature verification support is meant as a
465 fs-verity is currently supported by the ext4 and f2fs filesystems.
466 The CONFIG_FS_VERITY kconfig option must be enabled to use fs-verity
470 ``fs/verity/`` support layer and filesystems. Briefly, filesystems
475 ``fs/verity/`` at certain times, such as when a file is opened or when
481 ext4 supports fs-verity since Linux v5.4 and e2fsprogs v1.45.2.
495 fs-verity. In this case, the plaintext data is verified rather than
496 the ciphertext. This is necessary in order to make the fs-verity file
517 f2fs supports fs-verity since Linux v5.4 and f2fs-tools v1.11.0.
542 fs-verity ensures that all reads of a verity file's data are verified,
556 Therefore, fs/verity/ provides a function fsverity_verify_page() which
592 filesystems to support fs-verity, fs/verity/ also provides a function
616 are issued. To prevent this case from bypassing fs-verity, these
620 direct I/O would bypass fs-verity. (They also do the same for
627 fs-verity can be found at:
632 including examples of setting up fs-verity protected files.
637 To test fs-verity, use xfstests. For example, using `kvm-xfstests
645 This section answers frequently asked questions about fs-verity that
648 :Q: Why isn't fs-verity part of IMA?
649 :A: fs-verity and IMA (Integrity Measurement Architecture) have
650 different focuses. fs-verity is a filesystem-level mechanism for
656 IMA is planned to support the fs-verity hashing mechanism as an
659 But it doesn't make sense to force all uses of fs-verity to be
660 through IMA. As a standalone filesystem feature, fs-verity
664 :Q: Isn't fs-verity useless because the attacker can just modify the
666 :A: To verify the authenticity of an fs-verity file you must verify
667 the authenticity of the "fs-verity file digest", which
670 :Q: Isn't fs-verity useless because the attacker can just replace a
673 userspace code that authenticates the files; fs-verity is just a
721 :Q: Why doesn't fs-verity support writes?
724 fs-verity. Write support would require:
746 very different cases; the same applies to fs-verity.
753 properties are unwanted for fs-verity, so reusing the immutable
762 :Q: Does fs-verity support remote filesystems?
765 can support fs-verity, regardless of whether it's local or remote.
769 data verification functions provided by ``fs/verity/`` also assume
773 :Q: Why is anything filesystem-specific at all? Shouldn't fs-verity