1 Star 0 Fork 33

wangjunqiang/criu

forked from src-openEuler/criu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0043-fix-dump-fail-problem-with-no-access-to-get-socket-f.patch 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
river 提交于 2022-04-13 15:05 . criu: backport kinds of features/bugfix
From 88274e29aaaec4a53df996ae84c37ad20f36395f Mon Sep 17 00:00:00 2001
From: Zhuling <zhuling8@huawei.com>
Date: Sat, 24 Jul 2021 16:37:17 +0800
Subject: [PATCH 43/72] fix dump fail problem with no access to get socket
filter
Someone uses bpf hook by writing the kernel function instead
of the bpf code, it causes the error here.
Fix socket dumping fail problem when user space has no access
to getting socket filter.
Signed-off-by: Jingxian He <hejingxian@huawei.com>
Signed-off-by: fu.lin <fulin10@huawei.com>
---
criu/sockets.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/criu/sockets.c b/criu/sockets.c
index 2ddf85e..e412a1d 100644
--- a/criu/sockets.c
+++ b/criu/sockets.c
@@ -355,7 +355,12 @@ static int dump_socket_filter(int sk, SkOptsEntry *soe)
ret = getsockopt(sk, SOL_SOCKET, SO_GET_FILTER, NULL, &len);
if (ret) {
- pr_perror("Can't get socket filter len");
+ pr_warn("Can't get socket filter len");
+ /* Someone uses bpf hook by writing the kernel function
+ * instead of the bpf code, it causes the error here.
+ */
+ if (errno == EACCES)
+ return 0;
return ret;
}
--
2.34.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/geasscore/criu.git
git@gitee.com:geasscore/criu.git
geasscore
criu
criu
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891