[PATCH v2] ima_fs: Avoid creating measurement lists for unsupported hash algos

Dmitry Safonov dima at arista.com
Tue Jan 27 14:30:46 UTC 2026


On Tue, Jan 27, 2026 at 2:28 PM Roberto Sassu
<roberto.sassu at huaweicloud.com> wrote:
>
> On Tue, 2026-01-27 at 14:18 +0000, Dmitry Safonov via B4 Relay wrote:
[..]
> >       /* 2nd: template hash */
> > -     ima_print_digest(m, e->digests[algo_idx].digest, hash_digest_size[algo]);
> > +     if (algo == HASH_ALGO__LAST)
> > +             ima_putc(m, "0", 1);
> > +     else
> > +             ima_print_digest(m, e->digests[algo_idx].digest, hash_digest_size[algo]);
>
> No need, the last one is ok with ima_tpm_chip->allocated_banks[algo_idx].digest_size.

Cool, let me check it and I'll update it in v4.

Thanks,
           Dmitry



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