Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
e7dbd4d5
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e7dbd4d5
编写于
3月 28, 2022
作者:
P
Petr Mladek
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'for-5.18/selftests-fixes' into for-linus
上级
29573083
5e6ded2e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
23 addition
and
6 deletion
+23
-6
samples/livepatch/livepatch-shadow-fix1.c
samples/livepatch/livepatch-shadow-fix1.c
+1
-1
samples/livepatch/livepatch-shadow-fix2.c
samples/livepatch/livepatch-shadow-fix2.c
+1
-1
tools/testing/selftests/livepatch/functions.sh
tools/testing/selftests/livepatch/functions.sh
+19
-3
tools/testing/selftests/livepatch/test-ftrace.sh
tools/testing/selftests/livepatch/test-ftrace.sh
+2
-1
未找到文件。
samples/livepatch/livepatch-shadow-fix1.c
浏览文件 @
e7dbd4d5
...
...
@@ -109,9 +109,9 @@ static void livepatch_fix1_dummy_leak_dtor(void *obj, void *shadow_data)
void
*
d
=
obj
;
int
**
shadow_leak
=
shadow_data
;
kfree
(
*
shadow_leak
);
pr_info
(
"%s: dummy @ %p, prevented leak @ %p
\n
"
,
__func__
,
d
,
*
shadow_leak
);
kfree
(
*
shadow_leak
);
}
static
void
livepatch_fix1_dummy_free
(
struct
dummy
*
d
)
...
...
samples/livepatch/livepatch-shadow-fix2.c
浏览文件 @
e7dbd4d5
...
...
@@ -61,9 +61,9 @@ static void livepatch_fix2_dummy_leak_dtor(void *obj, void *shadow_data)
void
*
d
=
obj
;
int
**
shadow_leak
=
shadow_data
;
kfree
(
*
shadow_leak
);
pr_info
(
"%s: dummy @ %p, prevented leak @ %p
\n
"
,
__func__
,
d
,
*
shadow_leak
);
kfree
(
*
shadow_leak
);
}
static
void
livepatch_fix2_dummy_free
(
struct
dummy
*
d
)
...
...
tools/testing/selftests/livepatch/functions.sh
浏览文件 @
e7dbd4d5
...
...
@@ -75,9 +75,25 @@ function set_dynamic_debug() {
}
function
set_ftrace_enabled
()
{
result
=
$(
sysctl
-q
kernel.ftrace_enabled
=
"
$1
"
2>&1
&&
\
sysctl kernel.ftrace_enabled 2>&1
)
echo
"livepatch:
$result
"
>
/dev/kmsg
local
can_fail
=
0
if
[[
"
$1
"
==
"--fail"
]]
;
then
can_fail
=
1
shift
fi
local
err
=
$(
sysctl
-q
kernel.ftrace_enabled
=
"
$1
"
2>&1
)
local
result
=
$(
sysctl
--values
kernel.ftrace_enabled
)
if
[[
"
$result
"
!=
"
$1
"
]]
;
then
if
[[
$can_fail
-eq
1
]]
;
then
echo
"livepatch:
$err
"
>
/dev/kmsg
return
fi
skip
"failed to set kernel.ftrace_enabled =
$1
"
fi
echo
"livepatch: kernel.ftrace_enabled =
$result
"
>
/dev/kmsg
}
function
cleanup
()
{
...
...
tools/testing/selftests/livepatch/test-ftrace.sh
浏览文件 @
e7dbd4d5
...
...
@@ -25,7 +25,8 @@ if [[ "$(cat /proc/cmdline)" != "$MOD_LIVEPATCH: this has been live patched" ]]
die
"livepatch kselftest(s) failed"
fi
set_ftrace_enabled 0
# Check that ftrace could not get disabled when a livepatch is enabled
set_ftrace_enabled
--fail
0
if
[[
"
$(
cat
/proc/cmdline
)
"
!=
"
$MOD_LIVEPATCH
: this has been live patched"
]]
;
then
echo
-e
"FAIL
\n\n
"
die
"livepatch kselftest(s) failed"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录