fscrypt-policy · shipping · also fscrypt policy

fscrypt encryption policy

An fscrypt policy selects the encryption format and master-key reference inherited by newly created files in an encrypted directory tree.

Related Observatory article: fscrypt encryption policy on hesela.com

In Linux v6.12, policy fields include the version, contents and filename modes, flags and key reference. The v2 structure also carries a data-unit-size setting. Equal key identifiers alone do not mean equal policies. [3] [2]

Initial setup requires an empty directory. Reapplying the same policy verifies an existing setting; a different policy returns EEXIST instead of re-encrypting data. Regular files, directories and symlinks inherit the parent's policy at creation; special files are excluded. [2] [1]

The legacy FS_IOC_GET_ENCRYPTION_POLICY returns EINVAL for an encrypted v2 file. The extended _EX ioctl supports both versions; policy_size specifies buffer capacity on input and returned policy size on success. EOVERFLOW means the recognized policy does not fit, whereas ENODATA means the file is unencrypted. The v1 version code is 0, not 1; v2 uses 2. [1] [3]

Relations

related
fscrypt, fscrypt v2 key identifier

Citations

  1. Linux v6.12: fscrypt policy setup, enforcement and key identifiers (accessed 2026-10-22)
  2. Linux v6.12: fscrypt policy comparison and installation (accessed 2026-10-22)
  3. Linux v6.12: fscrypt policy structures and identifier size (accessed 2026-10-22)

Further reading

  1. Hesela: filesystem encryption and the execution backend (accessed 2026-10-22)

JSON: /data/terms/fscrypt-policy.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. fscrypt encryption policy. Hesela. 2026-10-23. https://hesela.dev/terms/fscrypt-policy/