<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/security/integrity/ima, branch v5.16.18</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.16.18</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.16.18'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-02-16T11:58:06+00:00</updated>
<entry>
<title>ima: Do not print policy rule with inactive LSM labels</title>
<updated>2022-02-16T11:58:06+00:00</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2022-02-01T20:37:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=74ff20ee157e7e76cb82abc7890baecf67c495fe'/>
<id>urn:sha1:74ff20ee157e7e76cb82abc7890baecf67c495fe</id>
<content type='text'>
commit 89677197ae709eb1ab3646952c44f6a171c9e74c upstream.

Before printing a policy rule scan for inactive LSM labels in the policy
rule. Inactive LSM labels are identified by args_p != NULL and
rule == NULL.

Fixes: 483ec26eed42 ("ima: ima/lsm policy rule loading logic bug fixes")
Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v5.6+
Acked-by: Christian Brauner &lt;brauner@kernel.org&gt;
[zohar@linux.ibm.com: Updated "Fixes" tag]
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: Allow template selection with ima_template[_fmt]= after ima_hash=</title>
<updated>2022-02-16T11:58:06+00:00</updated>
<author>
<name>Roberto Sassu</name>
<email>roberto.sassu@huawei.com</email>
</author>
<published>2022-01-31T17:11:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d38a03a82f873afaf9273e6b1c9fb8d2dacd78eb'/>
<id>urn:sha1:d38a03a82f873afaf9273e6b1c9fb8d2dacd78eb</id>
<content type='text'>
commit bb8e52e4906f148c2faf6656b5106cf7233e9301 upstream.

Commit c2426d2ad5027 ("ima: added support for new kernel cmdline parameter
ima_template_fmt") introduced an additional check on the ima_template
variable to avoid multiple template selection.

Unfortunately, ima_template could be also set by the setup function of the
ima_hash= parameter, when it calls ima_template_desc_current(). This causes
attempts to choose a new template with ima_template= or with
ima_template_fmt=, after ima_hash=, to be ignored.

Achieve the goal of the commit mentioned with the new static variable
template_setup_done, so that template selection requests after ima_hash=
are not ignored.

Finally, call ima_init_template_list(), if not already done, to initialize
the list of templates before lookup_template_desc() is called.

Reported-by: Guo Zihua &lt;guozihua@huawei.com&gt;
Signed-off-by: Roberto Sassu &lt;roberto.sassu@huawei.com&gt;
Cc: stable@vger.kernel.org
Fixes: c2426d2ad5027 ("ima: added support for new kernel cmdline parameter ima_template_fmt")
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: Remove ima_policy file before directory</title>
<updated>2022-02-16T11:58:05+00:00</updated>
<author>
<name>Stefan Berger</name>
<email>stefanb@linux.ibm.com</email>
</author>
<published>2022-01-25T22:46:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=09bef807c7630efd4d4be9dcf59467137ff782df'/>
<id>urn:sha1:09bef807c7630efd4d4be9dcf59467137ff782df</id>
<content type='text'>
commit f7333b9572d0559e00352a926c92f29f061b4569 upstream.

The removal of ima_dir currently fails since ima_policy still exists, so
remove the ima_policy file before removing the directory.

Fixes: 4af4662fa4a9 ("integrity: IMA policy")
Signed-off-by: Stefan Berger &lt;stefanb@linux.ibm.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Christian Brauner &lt;brauner@kernel.org&gt;
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: Use strscpy instead of strlcpy</title>
<updated>2021-10-10T02:17:58+00:00</updated>
<author>
<name>Petr Vorel</name>
<email>pvorel@suse.cz</email>
</author>
<published>2021-10-08T09:14:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cc4299ea039972e57e219e2981b74967c133d41c'/>
<id>urn:sha1:cc4299ea039972e57e219e2981b74967c133d41c</id>
<content type='text'>
strlcpy is deprecated, use its safer replacement.

Signed-off-by: Petr Vorel &lt;pvorel@suse.cz&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima_policy: Remove duplicate 'the' in docs comment</title>
<updated>2021-10-10T02:17:57+00:00</updated>
<author>
<name>Petr Vorel</name>
<email>pvorel@suse.cz</email>
</author>
<published>2021-10-08T09:14:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=61868acb0728db19a0ff107fb2361421eb1cd33c'/>
<id>urn:sha1:61868acb0728db19a0ff107fb2361421eb1cd33c</id>
<content type='text'>
Also join string (short enough to be on single line).

Signed-off-by: Petr Vorel &lt;pvorel@suse.cz&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: add gid support</title>
<updated>2021-10-10T02:17:57+00:00</updated>
<author>
<name>Curtis Veit</name>
<email>veit@vpieng.com</email>
</author>
<published>2021-10-07T20:03:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=40224c41661b9342617a2f8f3e115b2ce6b51288'/>
<id>urn:sha1:40224c41661b9342617a2f8f3e115b2ce6b51288</id>
<content type='text'>
IMA currently supports the concept of rules based on uid where the rule
is based on the uid of the file owner or the uid of the user accessing
the file. Provide the ability to have similar rules based on gid.

Signed-off-by: Curtis Veit &lt;veit@vpieng.com&gt;
Co-developed-by: Alex Henrie &lt;alexh@vpitech.com&gt;
Signed-off-by: Alex Henrie &lt;alexh@vpitech.com&gt;
Reviewed-by: Petr Vorel &lt;pvorel@suse.cz&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: fix uid code style problems</title>
<updated>2021-10-10T02:17:57+00:00</updated>
<author>
<name>Alex Henrie</name>
<email>alexh@vpitech.com</email>
</author>
<published>2021-10-07T20:03:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=30d8764a744fbd9db2e55b2777b65def2f6ec1c1'/>
<id>urn:sha1:30d8764a744fbd9db2e55b2777b65def2f6ec1c1</id>
<content type='text'>
scripts/checkpatch.pl wants function arguments to have names; and Mimi
prefers to keep the line length in functions to 80 characters or less.

Signed-off-by: Alex Henrie &lt;alexh@vpitech.com&gt;
Reviewed-by: Petr Vorel &lt;pvorel@suse.cz&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>ima: fix deadlock when traversing "ima_default_rules".</title>
<updated>2021-10-10T02:17:52+00:00</updated>
<author>
<name>liqiong</name>
<email>liqiong@nfschina.com</email>
</author>
<published>2021-10-09T10:38:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=eb0782bbdfd0d7c4786216659277c3fd585afc0e'/>
<id>urn:sha1:eb0782bbdfd0d7c4786216659277c3fd585afc0e</id>
<content type='text'>
The current IMA ruleset is identified by the variable "ima_rules"
that default to "&amp;ima_default_rules". When loading a custom policy
for the first time, the variable is updated to "&amp;ima_policy_rules"
instead. That update isn't RCU-safe, and deadlocks are possible.
Indeed, some functions like ima_match_policy() may loop indefinitely
when traversing "ima_default_rules" with list_for_each_entry_rcu().

When iterating over the default ruleset back to head, if the list
head is "ima_default_rules", and "ima_rules" have been updated to
"&amp;ima_policy_rules", the loop condition (&amp;entry-&gt;list != ima_rules)
stays always true, traversing won't terminate, causing a soft lockup
and RCU stalls.

Introduce a temporary value for "ima_rules" when iterating over
the ruleset to avoid the deadlocks.

Signed-off-by: liqiong &lt;liqiong@nfschina.com&gt;
Reviewed-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Fixes: 38d859f991f3 ("IMA: policy can now be updated multiple times")
Reported-by: kernel test robot &lt;lkp@intel.com&gt; (Fix sparse: incompatible types in comparison expression.)
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'integrity-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity</title>
<updated>2021-09-02T19:51:41+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-09-02T19:51:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aef4892a63c248c31718d23941536b86829a49f0'/>
<id>urn:sha1:aef4892a63c248c31718d23941536b86829a49f0</id>
<content type='text'>
Pull integrity subsystem updates from Mimi Zohar:

 - Limit the allowed hash algorithms when writing security.ima xattrs or
   verifying them, based on the IMA policy and the configured hash
   algorithms.

 - Return the calculated "critical data" measurement hash and size to
   avoid code duplication. (Preparatory change for a proposed LSM.)

 - and a single patch to address a compiler warning.

* tag 'integrity-v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity:
  IMA: reject unknown hash algorithms in ima_get_hash_algo
  IMA: prevent SETXATTR_CHECK policy rules with unavailable algorithms
  IMA: introduce a new policy option func=SETXATTR_CHECK
  IMA: add a policy option to restrict xattr hash algorithms on appraisal
  IMA: add support to restrict the hash algorithms used for file appraisal
  IMA: block writes of the security.ima xattr with unsupported algorithms
  IMA: remove the dependency on CRYPTO_MD5
  ima: Add digest and digest_len params to the functions to measure a buffer
  ima: Return int in the functions to measure a buffer
  ima: Introduce ima_get_current_hash_algo()
  IMA: remove -Wmissing-prototypes warning
</content>
</entry>
<entry>
<title>IMA: reject unknown hash algorithms in ima_get_hash_algo</title>
<updated>2021-08-23T22:22:00+00:00</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-22T08:55:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cb181da161963eddc9de0000de6ab2c7942be219'/>
<id>urn:sha1:cb181da161963eddc9de0000de6ab2c7942be219</id>
<content type='text'>
The new function validate_hash_algo() assumed that ima_get_hash_algo()
always return a valid 'enum hash_algo', but it returned the
user-supplied value present in the digital signature without
any bounds checks.

Update ima_get_hash_algo() to always return a valid hash algorithm,
defaulting on 'ima_hash_algo' when the user-supplied value inside
the xattr is invalid.

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Reported-by: syzbot+e8bafe7b82c739eaf153@syzkaller.appspotmail.com
Fixes: 50f742dd9147 ("IMA: block writes of the security.ima xattr with unsupported algorithms")
Reviewed-by: Lakshmi Ramasubramanian &lt;nramas@linux.microsoft.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
</feed>
