1 Star 0 Fork 44

xujialing/kpatch

forked from src-openEuler/kpatch 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0005-create-diff-object-fix-correlate-static-local-variab.patch 2.03 KB
一键复制 编辑 原始数据 按行查看 历史
谢志鹏 提交于 2020-09-12 05:45 . code optimization
From 24c01beb0ac8cee521ba654ece6c22f6ce9bdafe Mon Sep 17 00:00:00 2001
From: Zhipeng Xie <xiezhipeng1@huawei.com>
Date: Fri, 2 Nov 2018 17:24:51 +0000
Subject: [PATCH 05/23] create-diff-object: fix correlate static local
variables for __param section
kpatch-build correlate fail when no sections reference
static local variables in __param section, so the static
local variables are incorrectly recognized as a new symbol
and include a incomplete __param section into the patch.
The kernel oops when meet the incomplete __param section.
[ 625.961330] Call Trace:
[ 625.963279] [<ffffffff9b2a0c27>] ? kernfs_name_hash+0x17/0xd0
[ 625.965213] [<ffffffff9b2a219f>] kernfs_add_one+0x8f/0x150
[ 625.967120] [<ffffffff9b2a3a1e>] __kernfs_create_file+0x7e/0xa0
[ 625.969038] [<ffffffff9b2a44db>] sysfs_add_file_mode_ns+0x9b/0x160
[ 625.970912] [<ffffffff9b2a5231>] internal_create_group+0xd1/0x250
[ 625.972755] [<ffffffff9b0b8629>] ? add_sysfs_param.isra.3+0x89/0x280
[ 625.975274] [<ffffffff9b2a53c3>] sysfs_create_group+0x13/0x20
[ 625.977108] [<ffffffff9b0b8f24>] module_param_sysfs_setup+0x94/0xd0
[ 625.978899] [<ffffffff9b10f4e2>] load_module+0x2392/0x2bc0
[ 625.980693] [<ffffffff9b376a70>] ? ddebug_proc_write+0xf0/0xf0
[ 625.982448] [<ffffffff9b10b4b3>] ?
copy_module_from_fd.isra.43+0x53/0x150
[ 625.984187] [<ffffffff9b10fec6>] SyS_finit_module+0xa6/0xd0
[ 625.985926] [<ffffffff9b71f7d5>] system_call_fastpath+0x1c/0x21
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
---
kpatch-build/create-diff-object.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kpatch-build/create-diff-object.c b/kpatch-build/create-diff-object.c
index b94060e..3681adb 100644
--- a/kpatch-build/create-diff-object.c
+++ b/kpatch-build/create-diff-object.c
@@ -1108,6 +1108,10 @@ static int kpatch_is_normal_static_local(struct symbol *sym)
if (is_special_static(sym))
return 0;
+ if (!strncmp(sym->name, "__param_", strlen("__param_")) &&
+ !strncmp(sym->sec->name, "__param", strlen("__param")))
+ return 0;
+
return 1;
}
--
2.18.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sticky-rice-wine/kpatch.git
git@gitee.com:sticky-rice-wine/kpatch.git
sticky-rice-wine
kpatch
kpatch
master

搜索帮助