提交 eb624fe2 编写于 作者: T Tyler Hicks 提交者: Mimi Zohar

ima: Fail rule parsing when the KEY_CHECK hook is combined with an invalid cond

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: 5808611c ("IMA: Add KEY_CHECK func to measure keys")
Signed-off-by: NTyler Hicks <tyhicks@linux.microsoft.com>
Reviewed-by: NLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
上级 db2045f5
......@@ -1023,6 +1023,13 @@ static bool ima_validate_rule(struct ima_rule_entry *entry)
if (entry->action & ~(MEASURE | DONT_MEASURE))
return false;
if (entry->flags & ~(IMA_FUNC | IMA_UID | IMA_PCR |
IMA_KEYRINGS))
return false;
if (ima_rule_contains_lsm_cond(entry))
return false;
break;
default:
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册