代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dim 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b313cae9712a5c13ad9617c39019693072372499 Mon Sep 17 00:00:00 2001
From: jinlun <jinlun@huawei.com>
Date: Mon, 17 Jun 2024 14:58:16 +0800
Subject: [PATCH 03/14] fix double free in tpm
---
src/common/dim_tpm.c | 4 +++-
src/measure/dim_measure.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/common/dim_tpm.c b/src/common/dim_tpm.c
index 6d3c255..35f3fac 100644
--- a/src/common/dim_tpm.c
+++ b/src/common/dim_tpm.c
@@ -74,4 +74,6 @@ void dim_tpm_destroy(struct dim_tpm *tpm)
put_device(&tpm->chip->dev);
dim_kfree(tpm->digests);
-}
\ No newline at end of file
+ tpm->chip = NULL;
+ tpm->digests = NULL;
+}
diff --git a/src/measure/dim_measure.c b/src/measure/dim_measure.c
index dd35cb8..c40be0e 100644
--- a/src/measure/dim_measure.c
+++ b/src/measure/dim_measure.c
@@ -44,8 +44,10 @@ int dim_measure_init(struct dim_measure *m, struct dim_measure_cfg *cfg)
/* 2. init TPM, dont break if init fail */
if (cfg->pcr > 0) {
ret = dim_tpm_init(&m->tpm, HASH_ALGO_SHA256);
- if (ret < 0)
+ if (ret < 0) {
+ cfg->pcr = 0;
dim_warn("failed to init tpm chip: %d\n", ret);
+ }
} else {
memset(&m->tpm, 0, sizeof(struct dim_tpm));
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。