From: "Guozihua (Scott)" <guozihua@huawei.com>
To: Mimi Zohar <zohar@linux.ibm.com>, <linux-integrity@vger.kernel.org>
Cc: <dmitry.kasatkin@gmail.com>, <roberto.sassu@huawei.com>,
<linux-security-module@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 1/1] ima: remove the IMA_TEMPLATE Kconfig option
Date: Thu, 5 May 2022 09:35:40 +0800 [thread overview]
Message-ID: <1f40a55b-7489-5e87-3584-73e2b1948615@huawei.com> (raw)
In-Reply-To: <fbc9cda8eacc0a701d7b336bf45ecb6dfd450be9.camel@linux.ibm.com>
On 2022/4/7 22:43, Mimi Zohar wrote:
> On Thu, 2022-04-07 at 10:16 +0800, GUO Zihua wrote:
>> The original 'ima' measurement list template contains a hash, defined
>> as 20 bytes, and a null terminated pathname, limited to 255
>> characters. Other measurement list templates permit both larger hashes
>> and longer pathnames. When the "ima" template is configured as the
>> default, a new measurement list template (ima_template=) must be
>> specified before specifying a larger hash algorithm (ima_hash=) on the
>> boot command line.
>>
>> To avoid this boot command line ordering issue, remove the legacy "ima"
>> template configuration option, allowing it to still be specified on the
>> boot command line.
>>
>> The root cause of this issue is that during the processing of ima_hash,
>> we would try to check whether the hash algorithm is compatible with the
>> template. If the template is not set at the moment we do the check, we
>> check the algorithm against the configured default template. If the
>> default template is "ima", then we reject any hash algorithm other than
>> sha1 and md5.
>>
>> For example, if the compiled default template is "ima", and the default
>> algorithm is sha1 (which is the current default). In the cmdline, we put
>> in "ima_hash=sha256 ima_template=ima-ng". The expected behavior would be
>> that ima starts with ima-ng as the template and sha256 as the hash
>> algorithm. However, during the processing of "ima_hash=",
>> "ima_template=" has not been processed yet, and hash_setup would check
>> the configured hash algorithm against the compiled default: ima, and
>> reject sha256. So at the end, the hash algorithm that is actually used
>> will be sha1.
>>
>> With template "ima" removed from the configured default, we ensure that
>> the default tempalte would at least be "ima-ng" which allows for
>> basically any hash algorithm.
>>
>> This change would not break the algorithm compatibility checks for IMA.
>>
>> Fixes: 4286587dccd43 ("ima: add Kconfig default measurement list template")
>> Signed-off-by: GUO Zihua <guozihua@huawei.com>
>
> thanks,
>
> Mimi
>
>
> .
Hi,
Is this patch picked?
Thanks
GUO Zihua
next prev parent reply other threads:[~2022-05-05 1:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 2:16 [PATCH v3 0/1] ima: fix boot command line issue GUO Zihua
2022-04-07 2:16 ` [PATCH v3 1/1] ima: remove the IMA_TEMPLATE Kconfig option GUO Zihua
2022-04-07 14:43 ` Mimi Zohar
2022-05-05 1:35 ` Guozihua (Scott) [this message]
2022-05-05 12:39 ` Mimi Zohar
2022-05-06 1:31 ` Guozihua (Scott)
2022-04-07 12:46 ` [PATCH v3 0/1] ima: fix boot command line issue Mimi Zohar
2022-04-08 1:12 ` Guozihua (Scott)
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=1f40a55b-7489-5e87-3584-73e2b1948615@huawei.com \
--to=guozihua@huawei.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=roberto.sassu@huawei.com \
--cc=zohar@linux.ibm.com \
/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
all inboxes | Powered by JetHome®