ecryptfs_new_file_context(9)
π ecryptfs_new_file_context β Kernel API Manual (9)
Ok so bestie, buckle up, because we're diving into the kernel's eCryptfs guts and honestly? It's giving main character energy. This is ecryptfs_new_file_context(9), straight out of the Kernel API Manual. π¦
β¨ NAME β¨
ecryptfs_new_file_context β the function where we set up a brand-new crypto context for a file, iykyk. π
πΈ SYNOPSIS πΈ
int ecryptfs_new_file_context (struct inode *ecryptfs_inode );
π ARGUMENTS π
ecryptfs_inodeβ the eCryptfs inode, aka the inode we're doing all this for. That's it, that's the argument. π«Ά
π DESCRIPTION π
Okay so here's the vibe: if the crypto context for the file has not yet been established, this is literally where we do that. No context? We make one. Slay. β¨
Establishing a new crypto context involves the following decisions (yes, actual decisions, we're being thoughtful here):
- What cipher to use? π₯
- What set of authentication tokens to use? Here we just worry about getting enough information into the authentication tokens so that we know that they are available. We associate the available authentication tokens with the new file via the set of signatures in the
crypt_statstruct. Later, when the headers are actually written out, we may again defer to userspace to perform the encryption of the session key; for the foreseeable future, this will be the case with public key packets. π
Returns zero on success; non-zero otherwise. That's the whole mood. π
Ngl bestie, "non-zero otherwise" is doing a lot of heavy lifting, so likeβ¦ check your return value, ok? π
β SEE ALSO β
Kernel file ./fs/ecryptfs/crypto.c β the whole friend group lives here:
ecryptfs_from_hex(9)ecryptfs_derive_iv(9)ecryptfs_init_crypt_stat(9)ecryptfs_destroy_crypt_stat(9)virt_to_scatterlist(9)crypt_scatterlist(9)crypt_extent(9)ecryptfs_encrypt_page(9)ecryptfs_decrypt_page(9)ecryptfs_init_crypt_ctx(9)ecryptfs_copy_mount_wide_flags_to_inode_flags(9)ecryptfs_set_default_crypt_stat_vals(9)ecryptfs_validate_marker(9)ecryptfs_process_flags(9)write_ecryptfs_marker(9)ecryptfs_code_for_cipher_string(9)ecryptfs_cipher_code_to_string(9)ecryptfs_write_headers_virt(9)ecryptfs_write_metadata(9)set_default_header_data(9)ecryptfs_read_headers_virt(9)ecryptfs_read_xattr_region(9)ecryptfs_process_key_cipher(9)ecryptfs_destroy_crypto(9)ecryptfs_tfm_exists(9)ecryptfs_get_tfm_and_mutex_for_cipher_name(9)ecryptfs_encode_for_filename(9)ecryptfs_decode_from_filename(9)ecryptfs_encrypt_and_encode_filename(9)ecryptfs_decode_and_decrypt_filename(9)
π That's the whole page, bestie. No notes, no cap, ate and left no crumbs.
Sign-off time π β this lil beauty comes from ./fs/ecryptfs and it's dated October 2026. Periodt. π
β¨
π¦ 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