<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/security/integrity, branch v5.15</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.15</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.15'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-09-02T19:51:41Z</updated>
<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:41Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-09-02T19:51:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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>Merge tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm</title>
<updated>2021-08-31T21:55:09Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-08-31T21:55:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=efa916af13206eb15916e102c45c99a13ea78f33'/>
<id>urn:sha1:efa916af13206eb15916e102c45c99a13ea78f33</id>
<content type='text'>
Pull device mapper updates from Mike Snitzer:

 - Add DM infrastructure for IMA-based remote attestion. These changes
   are the basis for deploying DM-based storage in a "cloud" that must
   validate configurations end-users run to maintain trust. These DM
   changes allow supported DM targets' configurations to be measured via
   IMA. But the policy and enforcement (of which configurations are
   valid) is managed by something outside the kernel (e.g. Keylime).

 - Fix DM crypt scalability regression on systems with many cpus due to
   percpu_counter spinlock contention in crypt_page_alloc().

 - Use in_hardirq() instead of deprecated in_irq() in DM crypt.

 - Add event counters to DM writecache to allow users to further assess
   how the writecache is performing.

 - Various code cleanup in DM writecache's main IO mapping function.

* tag 'for-5.15/dm-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
  dm crypt: use in_hardirq() instead of deprecated in_irq()
  dm ima: update dm documentation for ima measurement support
  dm ima: update dm target attributes for ima measurements
  dm ima: add a warning in dm_init if duplicate ima events are not measured
  dm ima: prefix ima event name related to device mapper with dm_
  dm ima: add version info to dm related events in ima log
  dm ima: prefix dm table hashes in ima log with hash algorithm
  dm crypt: Avoid percpu_counter spinlock contention in crypt_page_alloc()
  dm: add documentation for IMA measurement support
  dm: update target status functions to support IMA measurement
  dm ima: measure data on device rename
  dm ima: measure data on table clear
  dm ima: measure data on device remove
  dm ima: measure data on device resume
  dm ima: measure data on table load
  dm writecache: add event counters
  dm writecache: report invalid return from writecache_map helpers
  dm writecache: further writecache_map() cleanup
  dm writecache: factor out writecache_map_remap_origin()
  dm writecache: split up writecache_map() to improve code readability
</content>
</entry>
<entry>
<title>efi: Don't use knowledge about efi_guid_t internals</title>
<updated>2021-08-27T14:01:27Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2021-02-09T16:45:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b31eea2e04c1002e5cb864eefdc718b70d2cb08c'/>
<id>urn:sha1:b31eea2e04c1002e5cb864eefdc718b70d2cb08c</id>
<content type='text'>
When print GUIDs supply pointer to the efi_guid_t (guid_t) type rather
its internal members.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Serge Hallyn &lt;serge@hallyn.com&gt;
Signed-off-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
</content>
</entry>
<entry>
<title>IMA: reject unknown hash algorithms in ima_get_hash_algo</title>
<updated>2021-08-23T22:22:00Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-22T08:55:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/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>
<entry>
<title>IMA: prevent SETXATTR_CHECK policy rules with unavailable algorithms</title>
<updated>2021-08-16T21:35:35Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-16T08:11:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ecd39cb61d9e302716d73be329c4d4822c24931'/>
<id>urn:sha1:8ecd39cb61d9e302716d73be329c4d4822c24931</id>
<content type='text'>
SETXATTR_CHECK policy rules assume that any algorithm listed in the
'appraise_algos' flag must be accepted when performing setxattr() on
the security.ima xattr.  However nothing checks that they are
available in the current kernel.  A userland application could hash
a file with a digest that the kernel wouldn't be able to verify.
However, if SETXATTR_CHECK is not in use, the kernel already forbids
that xattr write.

Verify that algorithms listed in appraise_algos are available to the
current kernel and reject the policy update otherwise. This will fix
the inconsistency between SETXATTR_CHECK and non-SETXATTR_CHECK
behaviors.

That filtering is only performed in ima_parse_appraise_algos() when
updating policies so that we do not have to pay the price of
allocating a hash object every time validate_hash_algo() is called
in ima_inode_setxattr().

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>IMA: introduce a new policy option func=SETXATTR_CHECK</title>
<updated>2021-08-16T21:35:35Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-16T08:11:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4f2946aa0c45c78b4f4ef101bab9694e38c68db0'/>
<id>urn:sha1:4f2946aa0c45c78b4f4ef101bab9694e38c68db0</id>
<content type='text'>
While users can restrict the accepted hash algorithms for the
security.ima xattr file signature when appraising said file, users
cannot restrict the algorithms that can be set on that attribute:
any algorithm built in the kernel is accepted on a write.

Define a new value for the ima policy option 'func' that restricts
globally the hash algorithms accepted when writing the security.ima
xattr.

When a policy contains a rule of the form
	appraise func=SETXATTR_CHECK appraise_algos=sha256,sha384,sha512
only values corresponding to one of these three digest algorithms
will be accepted for writing the security.ima xattr.  Attempting to
write the attribute using another algorithm (or "free-form" data)
will be denied with an audit log message.  In the absence of such a
policy rule, the default is still to only accept hash algorithms
built in the kernel (with all the limitations that entails).

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Reviewed-by: Lakshmi Ramasubramanian &lt;nramas@linux.microsoft.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>IMA: add a policy option to restrict xattr hash algorithms on appraisal</title>
<updated>2021-08-16T21:33:07Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-16T08:11:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=583a80ae86b5ceb68119cfb9a37404cf22f6cc46'/>
<id>urn:sha1:583a80ae86b5ceb68119cfb9a37404cf22f6cc46</id>
<content type='text'>
The kernel has the ability to restrict the set of hash algorithms it
accepts for the security.ima xattr when it appraises files.

Define a new IMA policy rule option "appraise_algos=", using the
mentioned mechanism to expose a user-toggable policy knob to opt-in
to that restriction and select the desired set of algorithms that
must be accepted.

When a policy rule uses the 'appraise_algos' option, appraisal of a
file referenced by that rule will now fail if the digest algorithm
employed to hash the file was not one of those explicitly listed in
the option.  In its absence, any hash algorithm compiled in the
kernel will be accepted.

For example, on a system where SELinux is properly deployed, the rule
	appraise func=BPRM_CHECK obj_type=iptables_exec_t \
		appraise_algos=sha256,sha384
will block the execution of iptables if the xattr security.ima of its
executables were not hashed with either sha256 or sha384.

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Reviewed-by: Lakshmi Ramasubramanian &lt;nramas@linux.microsoft.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>IMA: add support to restrict the hash algorithms used for file appraisal</title>
<updated>2021-08-16T21:30:41Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-16T08:11:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1624dc0086056c3a35fd34b0235bb1eb88c1c4d5'/>
<id>urn:sha1:1624dc0086056c3a35fd34b0235bb1eb88c1c4d5</id>
<content type='text'>
The kernel accepts any hash algorithm as a value for the security.ima
xattr. Users may wish to restrict the accepted algorithms to only
support strong cryptographic ones.

Provide the plumbing to restrict the permitted set of hash algorithms
used for verifying file hashes and signatures stored in security.ima
xattr.

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Reviewed-by: Lakshmi Ramasubramanian &lt;nramas@linux.microsoft.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>IMA: block writes of the security.ima xattr with unsupported algorithms</title>
<updated>2021-08-16T21:30:41Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-16T08:10:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=50f742dd91474e7f4954bf88d094eede59783883'/>
<id>urn:sha1:50f742dd91474e7f4954bf88d094eede59783883</id>
<content type='text'>
By default, writes to the extended attributes security.ima will be
allowed even if the hash algorithm used for the xattr is not compiled
in the kernel (which does not make sense because the kernel would not
be able to appraise that file as it lacks support for validating the
hash).

Prevent and audit writes to the security.ima xattr if the hash algorithm
used in the new value is not available in the current kernel.

Signed-off-by: THOBY Simon &lt;Simon.THOBY@viveris.fr&gt;
Reviewed-by: Lakshmi Ramasubramanian &lt;nramas@linux.microsoft.com&gt;
Signed-off-by: Mimi Zohar &lt;zohar@linux.ibm.com&gt;
</content>
</entry>
<entry>
<title>IMA: remove the dependency on CRYPTO_MD5</title>
<updated>2021-08-16T21:29:10Z</updated>
<author>
<name>THOBY Simon</name>
<email>Simon.THOBY@viveris.fr</email>
</author>
<published>2021-08-16T08:10:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8510505d55e194d3f6c9644c9f9d12c4f6b0395a'/>
<id>urn:sha1:8510505d55e194d3f6c9644c9f9d12c4f6b0395a</id>
<content type='text'>
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;
</content>
</entry>
</feed>
