[PATCH v2 07/13] ima,evm: use d_real_metadata_inode()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Nov 16 09:52:14 UTC 2026


> d_real() is about to be able to fail. D_REAL_METADATA never has to look
> anything up but we don't want to promise that it never fails. So switch
> the open-coded d_inode(d_real(..., D_REAL_METADATA)) in
> process_measurement() and evm_calc_hmac_or_hash() over to
> d_real_metadata_inode() and deal with errors.
> 
> evm_calc_hmac_or_hash() returns the error so EVM fails to verify the
> metadata. process_measurement() passes the error on to
> evm_metadata_changed() which treats it like changed metadata and resets
> the EVM status. That is needed as evm_verify_hmac() would otherwise hand
> out a cached INTEGRITY_PASS without looking at the metadata again.
> 
> This is a no-op as long as overlayfs can't fail D_REAL_METADATA.
> 
> Suggested-by: Amir Goldstein <amir73il at gmail.com>
> Link: https://lore.kernel.org/all/CAOQ4uxjoHbevvu8auB4m8AVcY9H6uHdDAP6mfi9OOMh+3775xA@mail.gmail.com
> Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-work-ovl-d_real-v2-0-90564c4ae347@kernel.org?part=7




More information about the Linux-security-module-archive mailing list