1 Star 0 Fork 10

jinlun/dim_9

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-dont-kill-the-init-process.patch 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
From b515dc62636113d06ac524476da7c30fa3fd42b0 Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Thu, 9 May 2024 15:16:28 +0800
Subject: [PATCH 10/28] dont kill the init process
---
.../dim_core_measure_process/dim_core_measure_process.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c b/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c
index 643b661..e5e262a 100644
--- a/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c
+++ b/src/core/tasks/dim_core_measure_process/dim_core_measure_process.c
@@ -78,6 +78,12 @@ static int kill_task_tree(struct task_struct *tsk)
const int def_size = 32;
struct task_kill_ctx ctx = { .size = def_size };
+ if (tsk->pid == 1) {
+ /* dont kill the init process */
+ dim_warn("the pid of tampered task is 1, don't kill it\n");
+ return 0;
+ }
+
ctx.buf = dim_kzalloc_gfp(def_size * sizeof(struct task_struct *));
if (ctx.buf == NULL)
return -ENOMEM;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim_9.git
git@gitee.com:jinlun123123/dim_9.git
jinlun123123
dim_9
dim_9
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385