From a972a48272686eabc1b7fde0aca03208cec698c8 Mon Sep 17 00:00:00 2001 From: "zhangyongde.zyd" Date: Wed, 22 May 2024 17:27:41 +0800 Subject: [PATCH 1/2] provide easy script to generate the copmplete kpatch-build --- patch.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 patch.sh diff --git a/patch.sh b/patch.sh new file mode 100755 index 0000000..79addb1 --- /dev/null +++ b/patch.sh @@ -0,0 +1,10 @@ +KPATCH_VERSION=0.9.9 + +patches=`ls patches` + +tar -xf v$KPATCH_VERSION.tar.gz + +for each in $patches; do + echo "$each" + patch -d kpatch-$KPATCH_VERSION -p1 < ./patches/$each +done -- Gitee From 88cea805e2c9a30a230f2588792bfdfd4c86fa0b Mon Sep 17 00:00:00 2001 From: "zhangyongde.zyd" Date: Tue, 4 Jun 2024 21:49:33 +0800 Subject: [PATCH 2/2] (bugfix)fix the wrong description of README.md Correct the link to anolis repo --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0b3b4aa..a8fe35c 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,13 @@ yum install -y make gcc patch bison flex openssl-devel elfutils elfutils-devel d ### 2.下载kernel-debuginfo,kernel-devel,kernel source -源代码下载地址: [https://anas.openanolis.cn/errata/detail/ANSA-2022:0692](https://anas.openanolis.cn/errata/detail/ANSA-2022:0692) -debuginfo地址:[https://mirrors.aliyun.com/anolis/8.6/Plus/x86_64/debug/Packages/](https://mirrors.aliyun.com/anolis/8.6/Plus/x86_64/debug/Packages/) -kernel-devel: [https://anas.openanolis.cn/errata/detail/ANSA-2022:0692](https://anas.openanolis.cn/errata/detail/ANSA-2022:0692) +Anolis 内核包仓库地址: +[https://mirrors.openanolis.cn/anolis/](https://mirrors.openanolis.cn/anolis/) + +以Anolis 8.6为例子: +源代码下载地址: [https://mirrors.aliyun.com/anolis/8.6/Plus/source/Packages/](https://mirrors.aliyun.com/anolis/8.6/Plus/source/Packages/) +debuginfo地址:[https://mirrors.aliyun.com/anolis/8.6/Plus/x86_64/debug/Packages/](https://mirrors.aliyun.com/anolis/8.6/Plus/x86_64/debug/Packages/) +kernel-devel: [https://mirrors.openanolis.cn/anolis/8.6/Experimental/x86_64/os/Packages/](https://mirrors.openanolis.cn/anolis/8.6/Experimental/x86_64/os/Packages/) 分别解压三个软件包(rpm2cpio xxx.rpm | cpio -div),依次提取出vmlinux, .config和kernel source,并放置在同一个目录。 @@ -86,4 +90,4 @@ kpatch list - 那些修改了函数与动态分配数据的交互方式的补丁不一定是安全的。kpatch-build不会去验证这一类补丁的安全性。这个完全取决于patch的制作者是不是对其修改有足够的认识,以及对一个正在运行的系统打上这样的补丁会对系统造成什么潜在的影响。 - 修改vdso函数是不支持的,因为这些函数运行在用户态下,并且ftrace hook不了它们。 - 修改那些没有fentry的函数也是不支持的。kpatch-build基于ftrace进行函数跟踪,没有ftrace点将使kpatch无法工作。包括那些为了后续链接的所有链接到`lib.a`的`lib-y`的目标(打个比方:`lib/string.o`) -- 本仓库内的kpatch代码逻辑默认关闭KLP_REPLACE,如果需要请在kpatch-build脚本中打开 \ No newline at end of file +- 本仓库内的kpatch代码逻辑默认关闭KLP_REPLACE,如果需要请在kpatch-build脚本中打开 -- Gitee