mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
ima: add support to require IMA sigv3 signatures
Defining a policy rule with the "appraise_type=imasig" option allows either v2 or v3 signatures. Defining an IMA appraise rule with the "appraise_type=sigv3" option requires a file sigv3 signature. Define a new appraise type: IMA_SIGV3_REQUIRED Example: appraise func=BPRM_CHECK appraise_type=sigv3 Tested-by: Stefan Berger <stefanb@linux.ibm.com> Acked-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
@@ -302,6 +302,13 @@ static int xattr_verify(enum ima_hooks func, struct ima_iint_cache *iint,
|
||||
*status = INTEGRITY_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((iint->flags & IMA_SIGV3_REQUIRED) && sig->version != 3) {
|
||||
*cause = "IMA-sigv3-required";
|
||||
*status = INTEGRITY_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
rc = integrity_digsig_verify(INTEGRITY_KEYRING_IMA,
|
||||
(const char *)xattr_value,
|
||||
xattr_len,
|
||||
|
||||
Reference in New Issue
Block a user