fscrypt_has...tted_context(9)
π fscrypt_has_permitted_context(9) π
okay bestie, this one's from the Kernel API Manual and it's lowkey one of the most important vibe checks in the whole fscrypt saga. like, it's literally the bouncer at the club door of encrypted directories. let's get into it π«Ά
β¨ NAME β¨
fscrypt_has_permitted_context β is a file's encryption policy permitted within its directory? π§
like... can this file actually sit with this directory, or is it giving "not on the guest list" energy?
πΈ SYNOPSIS πΈ
int fscrypt_has_permitted_context (struct inode *parent , struct inode *child );
that's it, that's the whole thing. two inodes walk into a function... π
π ARGUMENTS π
parentβ inode for parent directory. like the mom of the situation, the one who decides who's allowed in. πchildβ inode for file being looked up, opened, or linked intoparent. the one showing up at the door like "hi i'm here π" π₯Ί
π¦ DESCRIPTION π¦
okay so listen up, filesystems, because this is a must:
Filesystems must call this before permitting access to an inode in a situation where the parent directory is encrypted β either before allowing ->lookup to succeed, or for a regular file before allowing it to be opened β and before any operation that involves linking an inode into an encrypted directory, including link, rename, and cross rename. πππ
the way that this works is it enforces the constraint that within a given encrypted directory tree, all files use the same encryption policy. everyone matching, everyone on brand, no chaos. π
The pre-access check is needed to detect potentially malicious offline violations of this constraint, while the link and rename checks are needed to prevent online violations of this constraint.
π¨ bestie this is the important part: offline violations = sketchy malicious stuff happening when nobody's looking. online violations = people trying to sneak links/renames past you in real time. both are handled. no cap. π₯
β RETURN β
1if permitted π (slay, come on in)0if forbidden β (sorry bestie, not today)
π SEE ALSO π
shoutout to the whole squad, all living in Kernel file ./fs/crypto/policy.c:
fscrypt_policies_equal(9)fscrypt_supported_policy(9)fscrypt_new_context(9)fscrypt_policy_from_context(9)fscrypt_context_for_new_inode(9)fscrypt_set_context(9)fscrypt_parse_test_dummy_encryption(9)fscrypt_dummy_policies_equal(9)fscrypt_show_test_dummy_encryption(9)
and that's the whole page, periodt π this lil icon lives over at ./fs/crypto, dated October 2026, and its name is fscrypt_has...tted_context(9) β the truncated lil guy, iykyk ππ mwah, go call your filesystem, bestie π
β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms