···277277 - This is a huge file (EXT4\_HUGE\_FILE\_FL).278278 * - 0x80000279279 - Inode uses extents (EXT4\_EXTENTS\_FL).280280+ * - 0x100000281281+ - Verity protected file (EXT4\_VERITY\_FL).280282 * - 0x200000281283 - Inode stores a large extended attribute value in its data blocks282284 (EXT4\_EA\_INODE\_FL).···301299 - Reserved for ext4 library (EXT4\_RESERVED\_FL).302300 * -303301 - Aggregate flags:304304- * - 0x4BDFFF302302+ * - 0x705BDFFF305303 - User-visible flags.306306- * - 0x4B80FF304304+ * - 0x604BC0FF307305 - User-modifiable flags. Note that while EXT4\_JOURNAL\_DATA\_FL and308306 EXT4\_EXTENTS\_FL can be set with setattr, they are not in the kernel's309307 EXT4\_FL\_USER\_MODIFIABLE mask, since it needs to handle the setting of
···696696 (RO\_COMPAT\_READONLY)697697 * - 0x2000698698 - Filesystem tracks project quotas. (RO\_COMPAT\_PROJECT)699699+ * - 0x8000700700+ - Verity inodes may be present on the filesystem. (RO\_COMPAT\_VERITY)699701700702.. _super_def_hash:701703
+41
Documentation/filesystems/ext4/verity.rst
···11+.. SPDX-License-Identifier: GPL-2.022+33+Verity files44+------------55+66+ext4 supports fs-verity, which is a filesystem feature that provides77+Merkle tree based hashing for individual readonly files. Most of88+fs-verity is common to all filesystems that support it; see99+:ref:`Documentation/filesystems/fsverity.rst <fsverity>` for the1010+fs-verity documentation. However, the on-disk layout of the verity1111+metadata is filesystem-specific. On ext4, the verity metadata is1212+stored after the end of the file data itself, in the following format:1313+1414+- Zero-padding to the next 65536-byte boundary. This padding need not1515+ actually be allocated on-disk, i.e. it may be a hole.1616+1717+- The Merkle tree, as documented in1818+ :ref:`Documentation/filesystems/fsverity.rst1919+ <fsverity_merkle_tree>`, with the tree levels stored in order from2020+ root to leaf, and the tree blocks within each level stored in their2121+ natural order.2222+2323+- Zero-padding to the next filesystem block boundary.2424+2525+- The verity descriptor, as documented in2626+ :ref:`Documentation/filesystems/fsverity.rst <fsverity_descriptor>`,2727+ with optionally appended signature blob.2828+2929+- Zero-padding to the next offset that is 4 bytes before a filesystem3030+ block boundary.3131+3232+- The size of the verity descriptor in bytes, as a 4-byte little3333+ endian integer.3434+3535+Verity inodes have EXT4_VERITY_FL set, and they must use extents, i.e.3636+EXT4_EXTENTS_FL must be set and EXT4_INLINE_DATA_FL must be clear.3737+They can have EXT4_ENCRYPT_FL set, in which case the verity metadata3838+is encrypted as well as the data itself.3939+4040+Verity files cannot have blocks allocated past the end of the verity4141+metadata.