ima_creds_check(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the linux_binprm structure. 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:

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