Unverified Commit 55fafc5c authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10785 fix CVE-2024-42155

Merge Pull Request from: @ci-robot 
 
PR sync from: Hongbo Li <lihongbo22@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/BBKTDN3YQC7ZUY2JE75YMEF4OBQ4TXCY/ 
Fix CVE-2024-42155.

Holger Dengler (1):
  s390/pkey: Wipe copies of protected- and secure-keys

Hongbo Li (1):
  Revert "s390/pkey: Wipe copies of protected- and secure-keys"


-- 
2.34.1
 
https://gitee.com/src-openeuler/kernel/issues/IAGTIZ 
 
Link:https://gitee.com/openeuler/kernel/pulls/10785

 

Reviewed-by: default avatarZhang Jianhua <chris.zjh@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
parents 6cfbe577 cd075fde
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -1373,10 +1373,11 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
				     &kvk.cardnr, &kvk.domain,
				     &kvk.type, &kvk.size, &kvk.flags);
		DEBUG_DBG("%s pkey_verifykey2()=%d\n", __func__, rc);
		kfree(kkey);
		if (!rc && copy_to_user(utp, &ktp, sizeof(ktp)))
			rc = -EFAULT;
		memzero_explicit(&ktp, sizeof(ktp));
		kfree_sensitive(kkey);
		if (rc)
			break;
		if (copy_to_user(uvk, &kvk, sizeof(kvk)))
			return -EFAULT;
		break;
	}
	case PKEY_KBLOB2PROTK2: {
@@ -1401,10 +1402,9 @@ static long pkey_unlocked_ioctl(struct file *filp, unsigned int cmd,
		kfree(apqns);
		memzero_explicit(kkey, ktp.keylen);
		kfree(kkey);
		if (rc)
			break;
		if (copy_to_user(utp, &ktp, sizeof(ktp)))
			return -EFAULT;
		if (!rc && copy_to_user(utp, &ktp, sizeof(ktp)))
			rc = -EFAULT;
		memzero_explicit(&ktp, sizeof(ktp));
		break;
	}
	case PKEY_APQNS4K: {