ima_post_read_file(9)
π ima_post_read_file(9) π
okay so bestie, welcome to the Kernel API Manual β this one's ima_post_read_file(9) and it's literally the "in memory collect/appraise/audit measurement" girlie. she's giving integrity, she's giving policy, she's giving π in-memory file vibes π. let's get into it.
β¨ SYNOPSIS β¨
int ima_post_read_file (struct file *file , char *buf , loff_t size ,
enum kernel_read_file_id read_id );
look at her signature, so clean, so main character π
π«Ά ARGUMENTS π«Ά
fileβ pointer to the file to be measured/appraised/audit. yes, all three. she multi-tasks πbufβ pointer to in memory file contents. like, the actual bytes, in RAM, iconicsizeβ size of in memory file contents. how many bytes we're dealing with, no capread_idβ caller identifier. who's calling, iykyk πΈ
π DESCRIPTION π
Measure/appraise/audit in memory file based on policy. periodt. the policy rules are written in terms of a policy identifier β so it's the policy's world and we're just living in it π
On success return 0. slay β¨
On integrity appraisal error, assuming the file is in policy and IMA-appraisal is in enforcing mode, return -EACCES. so like... if the vibes are off and enforcement is on, you get the big no-no π«π not a warning, an actual error code. respect it.
π¦ SEE ALSO π¦
Kernel file ./security/integrity/ima/ima_main.c β go read the source bestie, it's all there π
ima_file_free(9)ima_file_mmap(9)ima_file_mprotect(9)ima_bprm_check(9)ima_creds_check(9)ima_bprm_creds_for_exec(9)ima_file_check(9)ima_file_hash(9)ima_inode_hash(9)ima_post_create_tmpfile(9)ima_post_path_mknod(9)ima_read_file(9)ima_load_data(9)ima_post_load_data(9)process_buffer_measurement(9)ima_kexec_cmdline(9)ima_measure_critical_data(9)ima_measure_raw_policy(9)ima_kernel_module_request(9)
that's the whole friend group fr fr π«Ά literally the entire IMA crew, go say hi to all of them π
ngl bestie, that SEE ALSO list is long but every single one of them is a real one. no skips, no skimming. the kernel doesn't do shortcuts and neither do we π
okay that's the page!! π sourced straight from ./security/integrity/ima, dated October 2026, and yes she's still ima_post_read_file(9) in the header, always and forever πΈπβ¨ muah, go measure something π§ββοΈ
π¦ 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