Commit 453cf667 authored by xuce's avatar xuce
Browse files

IMA: Fix hungtask issue of digestlist importing

EulerOS inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IB6364



--------------------------------

In the function ima_check_measured_appraised, if the digest list is not
measured or appraised, the function returns without releasing the lock
iint->mutex.

Fixes: a513be25 ("ima: dont disable digest_list if the file is not processed")
Signed-off-by: default avatarxuce <xuce10@h-partners.com>
parent d1d14cfb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -291,12 +291,14 @@ bool ima_check_measured_appraised(struct file *file)
	if ((ima_digest_list_actions & IMA_MEASURE) &&
	    !(iint->flags & IMA_MEASURED)) {
		pr_err("%s not measured\n", file_dentry(file)->d_name.name);
		mutex_unlock(&iint->mutex);
		return false;
	}

	if ((ima_digest_list_actions & IMA_APPRAISE) &&
	    (!(iint->flags & IMA_APPRAISED))) {
		pr_err("%s not appraised\n", file_dentry(file)->d_name.name);
		mutex_unlock(&iint->mutex);
		return false;
	}