Skip to content

Commit 9aed76e

Browse files
author
Stanislav Shwartsman
committed
set shadow stack busy should fail if address in the token is above 4GB while in compatibility mode
1 parent da3416c commit 9aed76e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bochs/cpu/access2.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,8 @@ bool BX_CPP_AttrRegparmN(4) BX_CPU_C::shadow_stack_lock_cmpxchg8b(bx_address off
12351235

12361236
bool BX_CPP_AttrRegparmN(2) BX_CPU_C::shadow_stack_atomic_set_busy(bx_address offset, unsigned curr_pl)
12371237
{
1238-
return shadow_stack_lock_cmpxchg8b(offset, curr_pl, offset | 0x1, offset);
1238+
// set busy fail if address in the token is above 4GB while in compatibility mode
1239+
return shadow_stack_lock_cmpxchg8b(offset, curr_pl, offset | 0x1, long64_mode() ? offset : GET32L(offset));
12391240
}
12401241

12411242
bool BX_CPP_AttrRegparmN(2) BX_CPU_C::shadow_stack_atomic_clear_busy(bx_address offset, unsigned curr_pl)

0 commit comments

Comments
 (0)