Skip to content

Commit 4d837f0

Browse files
Merge pull request #62 from patateqbool/master
Fixing an off by 4 in qasan_shadow_stack_pop
2 parents d40bcd8 + 1f4c007 commit 4d837f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

target/arm/translate-a64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ static void disas_uncond_b_imm(DisasContext *s, uint32_t insn)
13441344
if (insn & (1U << 31)) {
13451345
/* BL Branch with link */
13461346
if (use_qasan && qasan_max_call_stack)
1347-
gen_helper_qasan_shadow_stack_push(tcg_const_tl(s->pc_curr));
1347+
gen_helper_qasan_shadow_stack_push(tcg_const_tl(s->pc_curr + 4));
13481348
tcg_gen_movi_i64(cpu_reg(s, 30), s->base.pc_next);
13491349
}
13501350

@@ -2253,7 +2253,7 @@ static void disas_uncond_b_reg(DisasContext *s, uint32_t insn)
22532253
if (opc == 2 && rn == 30)
22542254
gen_helper_qasan_shadow_stack_pop(cpu_reg(s, 30));
22552255
else if (opc == 1)
2256-
gen_helper_qasan_shadow_stack_push(tcg_const_tl(s->pc_curr));
2256+
gen_helper_qasan_shadow_stack_push(tcg_const_tl(s->pc_curr + 4));
22572257
}
22582258
gen_a64_set_pc(s, dst);
22592259
/* BLR also needs to load return address */

0 commit comments

Comments
 (0)