ima_collect_modsig(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ima_collect_modsig(9) β€” Kernel API Manual πŸ’–

Okay bestie, this is ima_collect_modsig(9) from the Kernel API Manual, and it's lowkey iconic because it's all about hashing a file without the signature tacked onto the end. No cap, let's get into it ✨

🌸 NAME 🌸

ima_collect_modsig β€” Calculate the file hash without the appended signature. πŸŽ€

✨ SYNOPSIS ✨

void ima_collect_modsig (struct modsig *modsig , const void *buf ,
loff_t size );

🫢 ARGUMENTS 🫢

  • modsig β€” parsed module signature πŸ’…
  • buf β€” data to verify the signature on
  • size β€” data size

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the situation: since the modsig is literally part of the file contents, the hash used in its signature isn't the same one ordinarily calculated by IMA. 😭 Therefore the PKCS7 code calculates a separate one for signature verification. Slay, that's the whole reason this function exists. ✨

πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./security/integrity/ima/ima_modsig.c β€” go peek, bestie πŸ‘€

Shoutout to source/version ./security/integrity/ima and date October 2026 β€” this was ima_collect_modsig(9), signing off πŸ«ΆπŸ’–

πŸ“¦ where this page comes from