From 2afffca48892718f1d97ac0c11d2eb857dfbed0a Mon Sep 17 00:00:00 2001 From: Wardenjohn Date: Mon, 16 Dec 2024 16:59:24 +0800 Subject: [PATCH] kpatch-elf.c: set insn length to length of 4 --- ...-Bugfix-Set-aarch64-insn-length-to-4.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 patches/0020-Bugfix-Set-aarch64-insn-length-to-4.patch diff --git a/patches/0020-Bugfix-Set-aarch64-insn-length-to-4.patch b/patches/0020-Bugfix-Set-aarch64-insn-length-to-4.patch new file mode 100644 index 0000000..e6034c9 --- /dev/null +++ b/patches/0020-Bugfix-Set-aarch64-insn-length-to-4.patch @@ -0,0 +1,30 @@ +From 16ba20f73389d90ca067954df9fe92fc7a75bfce Mon Sep 17 00:00:00 2001 +From: Wardenjohn +Date: Mon, 16 Dec 2024 16:57:24 +0800 +Subject: [PATCH] (Bugfix)Set aarch64 insn length to 4 + +This is a potential bug. This bug miss the insn length of aarch64. +For aarch64, each insn's length is set to be 4. + +Signed-off-by: Wardenjohn +--- + kpatch-build/kpatch-elf.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/kpatch-build/kpatch-elf.c b/kpatch-build/kpatch-elf.c +index 44dc2cc..f88100e 100644 +--- a/kpatch-build/kpatch-elf.c ++++ b/kpatch-build/kpatch-elf.c +@@ -270,6 +270,9 @@ unsigned int insn_length(struct kpatch_elf *kelf, void *addr) + case PPC64: + return 4; + ++ case AARCH64: ++ return 4; ++ + case S390: + switch(insn[0] >> 6) { + case 0: +-- +2.43.5 + -- Gitee