Skip to content

Commit fc8f530

Browse files
committed
Fix make_fcontext/jump_fcontext with SHSTK enabled
Sync Zend/asm/*_x86_64_sysv_elf_gas.S with upstream
1 parent cd67c09 commit fc8f530

File tree

2 files changed

+0
-37
lines changed

2 files changed

+0
-37
lines changed

Zend/asm/jump_x86_64_sysv_elf_gas.S

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,6 @@ jump_fcontext:
6464
movq %rbx, 0x30(%rsp) /* save RBX */
6565
movq %rbp, 0x38(%rsp) /* save RBP */
6666

67-
#if BOOST_CONTEXT_SHADOW_STACK
68-
/* grow the stack to reserve space for shadow stack pointer(SSP) */
69-
leaq -0x8(%rsp), %rsp
70-
/* read the current SSP and store it */
71-
rdsspq %rcx
72-
movq %rcx, (%rsp)
73-
#endif
74-
7567
#if BOOST_CONTEXT_SHADOW_STACK
7668
/* grow the stack to reserve space for shadow stack pointer(SSP) */
7769
leaq -0x8(%rsp), %rsp

Zend/asm/make_x86_64_sysv_elf_gas.S

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -88,35 +88,6 @@ make_fcontext:
8888
/* will be entered after context-function returns */
8989
movq %rcx, 0x38(%rax)
9090

91-
#if BOOST_CONTEXT_SHADOW_STACK
92-
/* Populate the shadow stack and normal stack */
93-
/* get original SSP */
94-
rdsspq %r8
95-
/* restore new shadow stack */
96-
rstorssp -0x8(%r9)
97-
/* save the restore token on the original shadow stack */
98-
saveprevssp
99-
/* push the address of "jmp trampoline" to the new shadow stack */
100-
/* as well as the stack */
101-
call 1f
102-
jmp trampoline
103-
1:
104-
/* save address of "jmp trampoline" as return-address */
105-
/* for context-function */
106-
pop 0x38(%rax)
107-
/* Get the new SSP. */
108-
rdsspq %r9
109-
/* restore original shadow stack */
110-
rstorssp -0x8(%r8)
111-
/* save the restore token on the new shadow stack. */
112-
saveprevssp
113-
114-
/* reserve space for the new SSP */
115-
leaq -0x8(%rax), %rax
116-
/* save the new SSP to this fcontext */
117-
movq %r9, (%rax)
118-
#endif
119-
12091
#if BOOST_CONTEXT_SHADOW_STACK
12192
/* Populate the shadow stack */
12293

0 commit comments

Comments
 (0)