<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/security/integrity/ima/Kconfig, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-08-30T14:31:43Z</updated>
<entry>
<title>IMA: allow/fix UML builds</title>
<updated>2023-08-30T14:31:43Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2023-02-24T03:27:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56804da32a6edef397e9d967b01e82a4b04a8e9d'/>
<id>urn:sha1:56804da32a6edef397e9d967b01e82a4b04a8e9d</id>
<content type='text'>
[ Upstream commit 644f17412f5acf01a19af9d04a921937a2bc86c6 ]

UML supports HAS_IOMEM since 0bbadafdc49d (um: allow disabling
NO_IOMEM).

Current IMA build on UML fails on allmodconfig (with TCG_TPM=m):

ld: security/integrity/ima/ima_queue.o: in function `ima_add_template_entry':
ima_queue.c:(.text+0x2d9): undefined reference to `tpm_pcr_extend'
ld: security/integrity/ima/ima_init.o: in function `ima_init':
ima_init.c:(.init.text+0x43f): undefined reference to `tpm_default_chip'
ld: security/integrity/ima/ima_crypto.o: in function `ima_calc_boot_aggregate_tfm':
ima_crypto.c:(.text+0x1044): undefined reference to `tpm_pcr_read'
ld: ima_crypto.c:(.text+0x10d8): undefined reference to `tpm_pcr_read'

Modify the IMA Kconfig entry so that it selects TCG_TPM if HAS_IOMEM
is set, regardless of the UML Kconfig setting.
This updates TCG_TPM from =m to =y and fixes the linker errors.

Fixes: f4a0391dfa91 ("ima: fix Kconfig dependencies")
Cc: Stable &lt;stable@vger.kernel.org&gt; # v5.14+
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Fabio Estevam &lt;festevam@gmail.com&gt;
Cc: Richard Weinberger &lt;richard@nod.at&gt;
Cc: Anton Ivanov &lt;anton.ivanov@cambridgegreys.com&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: linux-um@lists.infradead.org
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ima: remove the IMA_TEMPLATE Kconfig option</title>
<updated>2022-07-29T15:10:36Z</updated>
<author>
<name>GUO Zihua</name>
</author>
<published>2022-04-07T02:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=748e4cf57bc78c5a798a3f60c6d0c908ade64ad0'/>
<id>urn:sha1:748e4cf57bc78c5a798a3f60c6d0c908ade64ad0</id>
<content type='text'>
[ Upstream commit 891163adf180bc369b2f11c9dfce6d2758d2a5bd ]

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 &lt;guozihua@huawei.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>IMA: remove the dependency on CRYPTO_MD5</title>
<updated>2021-09-22T09:47:56Z</updated>
<author>
<name>THOBY Simon</name>
</author>
<published>2021-08-16T08:10:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9e71c3544b5d620f12064d9aa026ccfae0dfb644'/>
<id>urn:sha1:9e71c3544b5d620f12064d9aa026ccfae0dfb644</id>
<content type='text'>
commit 8510505d55e194d3f6c9644c9f9d12c4f6b0395a upstream.

MD5 is a weak digest algorithm that shouldn't be used for cryptographic
operation. It hinders the efficiency of a patch set that aims to limit
the digests allowed for the extended file attribute namely security.ima.
MD5 is no longer a requirement for IMA, nor should it be used there.

The sole place where we still use the MD5 algorithm inside IMA is setting
the ima_hash algorithm to MD5, if the user supplies 'ima_hash=md5'
parameter on the command line.  With commit ab60368ab6a4 ("ima: Fallback
to the builtin hash algorithm"), setting "ima_hash=md5" fails gracefully
when CRYPTO_MD5 is not set:
	ima: Can not allocate md5 (reason: -2)
	ima: Allocating md5 failed, going to use default hash algorithm sha256

Remove the CRYPTO_MD5 dependency for IMA.

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Reviewed-by: Lakshmi Ramasubramanian &lt;nramas@linux.microsoft.com&gt;
[zohar@linux.ibm.com: include commit number in patch description for
stable.]
Cc: stable@vger.kernel.org # 4.17
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ima: Do not audit if CONFIG_INTEGRITY_AUDIT is not set</title>
<updated>2018-07-18T11:27:22Z</updated>
<author>
<name>Stefan Berger</name>
</author>
<published>2018-06-04T20:54:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2afd020aaeeefacb7711b47e3afb0cfb50db3f13'/>
<id>urn:sha1:2afd020aaeeefacb7711b47e3afb0cfb50db3f13</id>
<content type='text'>
If Integrity is not auditing, IMA shouldn't audit, either.

Signed-off-by: Stefan Berger &lt;stefanb@linux.vnet.ibm.com&gt;
Acked-by: Paul Moore &lt;paul@paul-moore.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: add build time policy</title>
<updated>2018-07-16T19:31:57Z</updated>
<author>
<name>Mimi Zohar</name>
</author>
<published>2018-07-13T18:06:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef96837b0de4af47732e2a8ebf5c18e8a885ded6'/>
<id>urn:sha1:ef96837b0de4af47732e2a8ebf5c18e8a885ded6</id>
<content type='text'>
IMA by default does not measure, appraise or audit files, but can be
enabled at runtime by specifying a builtin policy on the boot command line
or by loading a custom policy.

This patch defines a build time policy, which verifies kernel modules,
firmware, kexec image, and/or the IMA policy signatures.  This build time
policy is automatically enabled at runtime and persists after loading a
custom policy.

Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: James Morris &lt;james.morris@microsoft.com&gt;
</content>
</entry>
<entry>
<title>ima: Fix Kconfig to select TPM 2.0 CRB interface</title>
<updated>2018-03-25T11:24:31Z</updated>
<author>
<name>Jiandi An</name>
</author>
<published>2018-03-07T05:26:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fac37c628fd5d68fd7298d9b57ae8601ee1b4723'/>
<id>urn:sha1:fac37c628fd5d68fd7298d9b57ae8601ee1b4723</id>
<content type='text'>
TPM_CRB driver provides TPM CRB 2.0 support.  If it is built as a
module, the TPM chip is registered after IMA init.  tpm_pcr_read() in
IMA fails and displays the following message even though eventually
there is a TPM chip on the system.

ima: No TPM chip found, activating TPM-bypass! (rc=-19)

Fix IMA Kconfig to select TPM_CRB so TPM_CRB driver is built in the kernel
and initializes before IMA.

Signed-off-by: Jiandi An &lt;anjiandi@codeaurora.org&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>IMA: Correct Kconfig dependencies for hash selection</title>
<updated>2017-06-21T18:37:12Z</updated>
<author>
<name>Ben Hutchings</name>
</author>
<published>2017-05-02T18:27:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38d192684e8b1811c352c208447d565f8f0a309f'/>
<id>urn:sha1:38d192684e8b1811c352c208447d565f8f0a309f</id>
<content type='text'>
IMA uses the hash algorithm too early to be able to use a module.
Require the selected hash algorithm to be built-in.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: define Kconfig IMA_APPRAISE_BOOTPARAM option</title>
<updated>2017-06-21T18:37:12Z</updated>
<author>
<name>Mimi Zohar</name>
</author>
<published>2017-04-25T02:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1f5e01f4b035ced1c71b40866e4e5c0508fbb0b'/>
<id>urn:sha1:e1f5e01f4b035ced1c71b40866e4e5c0508fbb0b</id>
<content type='text'>
Permit enabling the different "ima_appraise=" modes (eg. log, fix)
from the boot command line.

Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: maintain memory size needed for serializing the measurement list</title>
<updated>2016-12-20T17:48:44Z</updated>
<author>
<name>Mimi Zohar</name>
</author>
<published>2016-12-20T00:22:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d158847ae89a25615f3d8757ad8c6f50fc816db5'/>
<id>urn:sha1:d158847ae89a25615f3d8757ad8c6f50fc816db5</id>
<content type='text'>
In preparation for serializing the binary_runtime_measurements, this
patch maintains the amount of memory required.

Link: http://lkml.kernel.org/r/1480554346-29071-5-git-send-email-zohar@linux.vnet.ibm.com
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
Acked-by: Dmitry Kasatkin &lt;dmitry.kasatkin@gmail.com&gt;
Cc: Thiago Jung Bauermann &lt;bauerman@linux.vnet.ibm.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Andreas Steffen &lt;andreas.steffen@strongswan.org&gt;
Cc: Josh Sklar &lt;sklar@linux.vnet.ibm.com&gt;
Cc: Dave Young &lt;dyoung@redhat.com&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Baoquan He &lt;bhe@redhat.com&gt;
Cc: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Stewart Smith &lt;stewart@linux.vnet.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>IMA: Use the the system trusted keyrings instead of .ima_mok</title>
<updated>2016-04-11T21:49:15Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2016-04-07T08:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=56104cf2b8d20eed32c14eac8ac574c35377ab38'/>
<id>urn:sha1:56104cf2b8d20eed32c14eac8ac574c35377ab38</id>
<content type='text'>
Add a config option (IMA_KEYRINGS_PERMIT_SIGNED_BY_BUILTIN_OR_SECONDARY)
that, when enabled, allows keys to be added to the IMA keyrings by
userspace - with the restriction that each must be signed by a key in the
system trusted keyrings.

EPERM will be returned if this option is disabled, ENOKEY will be returned if
no authoritative key can be found and EKEYREJECTED will be returned if the
signature doesn't match.  Other errors such as ENOPKG may also be returned.

If this new option is enabled, the builtin system keyring is searched, as is
the secondary system keyring if that is also enabled.  Intermediate keys
between the builtin system keyring and the key being added can be added to
the secondary keyring (which replaces .ima_mok) to form a trust chain -
provided they are also validly signed by a key in one of the trusted keyrings.

The .ima_mok keyring is then removed and the IMA blacklist keyring gets its
own config option (IMA_BLACKLIST_KEYRING).

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
