ima: Fail rule parsing when the KEY_CHECK hook is combined with an invalid cond
authorTyler Hicks <tyhicks@linux.microsoft.com>
Thu, 9 Jul 2020 06:19:05 +0000 (01:19 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:23:55 +0000 (08:23 +0200)
commit097ad6fe5795f0933bc4676d8111b8eaf4bc296e
treeaeb66abf539127fd6ff0f07c02eafb5d0102fdb6
parentdcc7ac519503cb77627ef013151bb81509270c64
ima: Fail rule parsing when the KEY_CHECK hook is combined with an invalid cond

[ Upstream commit eb624fe214a2e156ddafd9868377cf91499f789d ]

The KEY_CHECK function only supports the uid, pcr, and keyrings
conditionals. Make this clear at policy load so that IMA policy authors
don't assume that other conditionals are supported.

Fixes: 5808611cccb2 ("IMA: Add KEY_CHECK func to measure keys")
Signed-off-by: Tyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
security/integrity/ima/ima_policy.c