process_buffer_measurement(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… process_buffer_measurement(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” yes, that's the manual name, we're in the kernel API girlies now πŸŽ€. This one's about process_buffer_measurement, and no cap, it's a whole vibe: it measures the buffer or the buffer data hash. Let me walk you through it 🫢


✨ NAME ✨

process_buffer_measurement β€” literally measures the buffer or the buffer data hash. that's the whole job. iconic. πŸ‘‘


🌸 SYNOPSIS 🌸

int process_buffer_measurement (struct mnt_idmap *idmap , struct inode
*inode , const void *buf , int size , const char *eventname , enum
ima_hooks func , int pcr , const char *func_data , bool buf_hash , u8
*digest , size_t digest_len );

look at all those parameters. she's got range πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • idmap β€” the idmap of the mount the inode was found from. like, the mapping context, iykyk.
  • inode β€” the inode associated with the object being measured. heads up: this is NULL for KEY_CHECK. not me warning you about the NULL case 😭
  • buf β€” pointer to the buffer that needs to be added to the log. the actual data bestie.
  • size β€” size of the buffer, in bytes. keep it in bytes fr fr.
  • eventname β€” the event name to be used for the buffer entry. name her, she deserves it ✨
  • func β€” the IMA hook. this is an enum ima_hooks, very official.
  • pcr β€” the pcr to extend the measurement into.
  • func_data β€” func-specific data. she may be NULL, that's totally fine, we don't judge 🫢
  • buf_hash β€” measure the buffer data hash. your bool era.
  • digest β€” the buffer digest will be written to here. destination unlocked πŸ’–
  • digest_len β€” buffer length. the length. of the buffer. πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

so here's the tea: based on policy, either the buffer data or the buffer data hash is measured. that's it. policy decides, not you. main character energy belongs to the policy 🧚


⭐ RETURN ⭐

  • 0 β€” the buffer has been successfully measured. slay! πŸŽ‰
  • 1 β€” the digest has been written to the passed location, but it was not added to a measurement entry. like, partial credit πŸ’…
  • negative value β€” something went wrong otherwise. we don't love that for us πŸ™ˆ

🌈 SEE ALSO 🌈

kernel file ./security/integrity/ima/ima_main.c, plus the whole friend group:

they all live at ./security/integrity/ima, a very exclusive address 🏠✨


lowkey reminder: inode can be NULL for KEY_CHECK, and func_data may be NULL too β€” handle them with care bestie, no crash era allowed πŸ’€

and that's the page! brought to you by ./security/integrity/ima, dated October 2026 β€” mwah, love u, go measure some buffers πŸ’‹πŸ’–πŸ¦‹

πŸ“¦ where this page comes from