process_buffer_measurement(9)
π 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 isNULLforKEY_CHECK. not me warning you about theNULLcase π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 anenum ima_hooks, very official.pcrβ the pcr to extend the measurement into.func_dataβ func-specific data. she may beNULL, 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:
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_post_read_file(9)ima_load_data(9)ima_post_load_data(9)ima_kexec_cmdline(9)ima_measure_critical_data(9)ima_measure_raw_policy(9)ima_kernel_module_request(9)
they all live at ./security/integrity/ima, a very exclusive address π β¨
lowkey reminder:inodecan beNULLforKEY_CHECK, andfunc_datamay beNULLtoo β 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
- 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