Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 68ec8a2

Browse files
authored
Port to 3.1 - Fix JIT_CheckedWriteBarrier on macOS (#28051)
In a change to enable Mojave hardened runtime support that was made last year, a bug was introduced into the JIT_CheckedWriteBarrier. A conditional relative jump before an updated piece of code that was jumping after that piece of code was not updated and ended up jumping into the middle of an instruction. Since that condition occurs only with specific memory layout and it is very rare, that problem was not discovered until now.
1 parent 5d74d5b commit 68ec8a2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vm/amd64/jithelpers_fast.S

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ LEAF_ENTRY JIT_CheckedWriteBarrier, _TEXT
3333
// See if this is in GCHeap
3434
PREPARE_EXTERNAL_VAR g_lowest_address, rax
3535
cmp rdi, [rax]
36+
#ifdef FEATURE_WRITEBARRIER_COPY
37+
// jb NotInHeap
38+
.byte 0x72, 0x12
39+
#else
3640
// jb NotInHeap
3741
.byte 0x72, 0x0e
42+
#endif
3843
PREPARE_EXTERNAL_VAR g_highest_address, rax
3944
cmp rdi, [rax]
4045

0 commit comments

Comments
 (0)