From deed2d19464499541bc33fc29dabd039f284f909 Mon Sep 17 00:00:00 2001 From: bmax Date: Sat, 21 Sep 2024 19:58:22 +0800 Subject: [PATCH] test fix bti --- kernel/base/hook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/base/hook.c b/kernel/base/hook.c index 3bf0cab4..00e89319 100644 --- a/kernel/base/hook.c +++ b/kernel/base/hook.c @@ -15,7 +15,7 @@ #define bit(n, st) (((n) >> (st)) & 1) #define sign64_extend(n, len) \ (((uint64_t)((n) << (63u - (len - 1))) >> 63u) ? ((n) | (0xFFFFFFFFFFFFFFFF << (len))) : n) -#define align_ceil(x, align) (((u64)(x) + (u64)(align)-1) & ~((u64)(align)-1)) +#define align_ceil(x, align) (((u64)(x) + (u64)(align) - 1) & ~((u64)(align) - 1)) typedef uint32_t inst_type_t; typedef uint32_t inst_mask_t; @@ -164,7 +164,7 @@ static __noinline hook_err_t relo_b(hook_t *hook, uint64_t inst_addr, uint32_t i if (type == INST_BL) { buf[idx++] = 0xD63F0220; // BLR X17 } else { - buf[idx++] = 0xD61F0220; // BR X17 + buf[idx++] = 0xd65f0220; // BR X17 -> RET X17 } buf[idx++] = ARM64_NOP; return HOOK_NO_ERR;