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 0000000000000000000000000000000000000000..e6034c98e780a575d8f52b099805eb665ebe5490 --- /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 +