ima_creds_check(9)
π ima_creds_check(9) β like, the kernel API manual bestie π
okay so real talk, this is a page from the Kernel API Manual, and it's about ima_creds_check. she's a little function with a big job and honestly she ate π
β¨
β¨ NAME β¨
ima_creds_check β based on policy, collect/store measurement. that's the whole vibe, no cap π«Ά
πΈ SYNOPSIS πΈ
int ima_creds_check (struct linux_binprm *bprm , const struct file *file
);
literally just those two arguments, bestie, that's the whole guest list π
π¦ ARGUMENTS π¦
bprmβ contains thelinux_binprmstructure. yes, the name is the thing, we love a self-describing icon πfileβ contains the file descriptor of the binary being executed. she's the one actually on stage, okay π₯
π DESCRIPTION π
so here's the tea, and it's genuinely kind of iconic ββ¨
the OS protects against an executable file, already open for write, from being executed in deny_write_access β and it also protects against an executable file, already open for execute, from being modified in get_write_access. two-way lock, no sneaking π
the way that this matters: we can be certain that what we verify and measure here is actually what is being executed. not a lookalike, not a remix, the real file. vibe check passed π
π the difference from ima_bprm_check π
okay this is the part everyone asks about in the group chat, so let's go π₯
ima_creds_check is invoked only after determining the final binary to be executed without interpreter β and not when searching for intermediate binaries. that's the whole point, that's her lane π
the reason? since commit 56305aa9b6fab ("exec: Compute file based creds only once"), the credentials to be applied to the process are calculated only at that stage β via the bprm_creds_from_file security hook instead of bprm_check_security. periodt π
β¨
β return values β
- On success, return 0. slay π
- On integrity appraisal error β assuming the file is in policy and IMA-appraisal is in enforcing mode β return
-EACCES. π yeah, that's the sad one, and it means business. don't sleep on it.
π SEE ALSO π
Kernel file ./security/integrity/ima/ima_main.c, plus the whole friend group, fr fr:
ima_file_free(9)ima_file_mmap(9)ima_file_mprotect(9)ima_bprm_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_post_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 nineteen functions, bestie, count 'em, every single one made the list π«Άπ
ngl, if you're poking around here you're probably deep in IMA and security hooks β drink some water, hydrate, and remember: what you verify and measure is what's actually executing. that's not a vibe, that's a guarantee π β¨
okay that's the page!! it lives at ./security/integrity/ima, it's dated October 2026, and the manual name is ima_creds_check(9). mwah, bye 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