ima: fix blocking of security.ima xattrs of unsupported algorithms
authorMimi Zohar <zohar@linux.ibm.com>
Wed, 17 Aug 2022 21:18:42 +0000 (17:18 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Oct 2022 10:34:35 +0000 (12:34 +0200)
commit10918ebecdc9771999783e933ed8265d9b1d3e5a
tree3a8f333a2657411d3fa7775df9565899d51a7edb
parentb7af9b8be89171f5bd842d8813eddeb846433ff3
ima: fix blocking of security.ima xattrs of unsupported algorithms

[ Upstream commit 5926586f291b53cb8a0c9631fc19489be1186e2d ]

Limit validating the hash algorithm to just security.ima xattr, not
the security.evm xattr or any of the protected EVM security xattrs,
nor posix acls.

Fixes: 50f742dd9147 ("IMA: block writes of the security.ima xattr with unsupported algorithms")
Reported-by: Christian Brauner <brauner@kernel.org>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/integrity/ima/ima_appraise.c