1 Star 0 Fork 33

cf-zhao/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-kerndat-check-for-rseq-syscall-support-Signed-off-by.patch 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From 35053ab4bb8fe09818da9421a053e2e13c7ad817 Mon Sep 17 00:00:00 2001
From: bb-cat <ningyu9@huawei.com>
Date: Wed, 2 Mar 2022 13:34:10 +0800
Subject: [PATCH 03/72] kerndat: check for rseq syscall support Signed-off-by:
Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>
---
criu/include/kerndat.h | 1 +
criu/kerndat.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/criu/include/kerndat.h b/criu/include/kerndat.h
index 80bad7f..44a6976 100644
--- a/criu/include/kerndat.h
+++ b/criu/include/kerndat.h
@@ -74,6 +74,7 @@ struct kerndat_s {
bool has_pidfd_getfd;
bool has_nspid;
bool has_nftables_concat;
+ bool has_rseq;
};
extern struct kerndat_s kdat;
diff --git a/criu/kerndat.c b/criu/kerndat.c
index 0e88ba4..f5a4490 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -816,6 +816,20 @@ static int kerndat_x86_has_ptrace_fpu_xsave_bug(void)
return 0;
}
+static int kerndat_has_rseq(void)
+{
+ if (syscall(__NR_rseq, NULL, 0, 0, 0) != -1) {
+ pr_err("rseq should fail\n");
+ return -1;
+ }
+ if (errno == ENOSYS)
+ pr_info("rseq syscall isn't supported\n");
+ else
+ kdat.has_rseq = true;
+
+ return 0;
+}
+
#define KERNDAT_CACHE_FILE KDAT_RUNDIR "/criu.kdat"
#define KERNDAT_CACHE_FILE_TMP KDAT_RUNDIR "/.criu.kdat"
@@ -1360,6 +1374,10 @@ int kerndat_init(void)
ret = -1;
}
+ if (!ret && kerndat_has_rseq()) {
+ pr_err("kerndat_has_rseq failed when initializing kerndat.\n");
+ ret = -1;
+ }
kerndat_lsm();
kerndat_mmap_min_addr();
kerndat_files_stat();
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/cf-zhao/criu.git
git@gitee.com:cf-zhao/criu.git
cf-zhao
criu
criu
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891