From: Mimi Zohar <zohar@linux.ibm.com>
To: Roberto Sassu <roberto.sassu@huaweicloud.com>,
dima@arista.com, Roberto Sassu <roberto.sassu@huawei.com>,
Dmitry Kasatkin <dmitry.kasatkin@gmail.com>,
Eric Snowberg <eric.snowberg@oracle.com>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
Silvia Sisinni <silvia.sisinni@polito.it>,
Enrico Bravi <enrico.bravi@polito.it>
Cc: Jonathan McDowell <noodles@earth.li>,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Dmitry Safonov <0x7f454c46@gmail.com>
Subject: Re: [PATCH v5] ima_fs: Avoid creating measurement lists for unsupported hash algos
Date: Fri, 27 Feb 2026 13:46:32 -0500 [thread overview]
Message-ID: <dee902ad4fcbc60ed2051cb0d165232ad27c45b1.camel@linux.ibm.com> (raw)
In-Reply-To: <0fde824faace320c6d3ef6137bf50cee0289c6c0.camel@huaweicloud.com>
> > > @@ -404,16 +398,24 @@ static int __init create_securityfs_measurement_lists(void)
> > > char file_name[NAME_MAX + 1];
> > > struct dentry *dentry;
> > >
> > > - sprintf(file_name, "ascii_runtime_measurements_%s",
> > > - hash_algo_name[algo]);
> > > + if (algo == HASH_ALGO__LAST)
> > > + sprintf(file_name, "ascii_runtime_measurements_tpm_alg_%x",
> > > + ima_tpm_chip->allocated_banks[i].alg_id);
> > > + else
> > > + sprintf(file_name, "ascii_runtime_measurements_%s",
> > > + hash_algo_name[algo]);
> > > dentry = securityfs_create_file(file_name, S_IRUSR | S_IRGRP,
> > > ima_dir, (void *)(uintptr_t)i,
> > > &ima_ascii_measurements_ops);
> > > if (IS_ERR(dentry))
> > > return PTR_ERR(dentry);
> > >
> > > - sprintf(file_name, "binary_runtime_measurements_%s",
> > > - hash_algo_name[algo]);
> > > + if (algo == HASH_ALGO__LAST)
> > > + sprintf(file_name, "binary_runtime_measurements_tpm_alg_%x",
> > > + ima_tpm_chip->allocated_banks[i].alg_id);
> >
> > There's no point in creating either of the securityfs files if the kernel
> > doesn't support the hash algorithm.
>
> It is not useful per se, but since it is an information that it is
> produced and maintained by IMA, we can print it. And second, it will
> expose the fact that there is an unsupported algorithm (in the case of
> SHA3-256, the fix is add to the TPM - crypto subsystem mapping in tpm2-
> cmd.c).
Yes, agreed.
Dmitry, the Subject line implies the measurement lists aren't being created, yet
you're actually creating them. Please update the patch description before re-
posting.
thanks,
Mimi
prev parent reply other threads:[~2026-02-27 18:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 14:56 [PATCH v5] ima_fs: Avoid creating measurement lists for unsupported hash algos Dmitry Safonov via B4 Relay
2026-02-25 13:19 ` Roberto Sassu
2026-02-25 18:00 ` Dmitry Safonov
2026-02-25 20:07 ` Mimi Zohar
2026-02-25 20:36 ` Mimi Zohar
2026-02-26 9:05 ` Roberto Sassu
2026-02-27 18:46 ` Mimi Zohar [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dee902ad4fcbc60ed2051cb0d165232ad27c45b1.camel@linux.ibm.com \
--to=zohar@linux.ibm.com \
--cc=0x7f454c46@gmail.com \
--cc=dima@arista.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=enrico.bravi@polito.it \
--cc=eric.snowberg@oracle.com \
--cc=jmorris@namei.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=noodles@earth.li \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=roberto.sassu@huaweicloud.com \
--cc=serge@hallyn.com \
--cc=silvia.sisinni@polito.it \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox