Skip to content

Commit ea87c55

Browse files
jlintonarmwilldeacon
authored andcommitted
arm64: probes: Fix incorrect bl/blr address and register usage
The pt_regs registers are 64-bit on arm64, and should be u64 when manipulated. Correct this so that we aren't truncating the address during br/blr sequences. Fixes: efb07ac ("arm64: probes: Add GCS support to bl/blr/ret") Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent ba1afc9 commit ea87c55

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/arm64/kernel/probes/simulate-insn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void __kprobes
145145
simulate_br_blr(u32 opcode, long addr, struct pt_regs *regs)
146146
{
147147
int xn = (opcode >> 5) & 0x1f;
148-
int b_target = get_x_reg(regs, xn);
148+
u64 b_target = get_x_reg(regs, xn);
149149

150150
if (((opcode >> 21) & 0x3) == 1)
151151
if (update_lr(regs, addr + 4))
@@ -160,7 +160,7 @@ simulate_ret(u32 opcode, long addr, struct pt_regs *regs)
160160
u64 ret_addr;
161161
int err = 0;
162162
int xn = (opcode >> 5) & 0x1f;
163-
unsigned long r_target = get_x_reg(regs, xn);
163+
u64 r_target = get_x_reg(regs, xn);
164164

165165
if (user_mode(regs) && task_gcs_el0_enabled(current)) {
166166
ret_addr = pop_user_gcs(&err);

0 commit comments

Comments
 (0)