mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
IMA: add support to restrict the hash algorithms used for file appraisal
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 <Simon.THOBY@viveris.fr> Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
@@ -77,8 +77,9 @@ int ima_must_appraise(struct user_namespace *mnt_userns, struct inode *inode,
|
||||
return 0;
|
||||
|
||||
security_task_getsecid_subj(current, &secid);
|
||||
return ima_match_policy(mnt_userns, inode, current_cred(), secid, func,
|
||||
mask, IMA_APPRAISE | IMA_HASH, NULL, NULL, NULL);
|
||||
return ima_match_policy(mnt_userns, inode, current_cred(), secid,
|
||||
func, mask, IMA_APPRAISE | IMA_HASH, NULL,
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
static int ima_fix_xattr(struct dentry *dentry,
|
||||
|
||||
Reference in New Issue
Block a user