Skip to content

Commit bac1b17

Browse files
committed
Fix make_fcontext/jump_fcontext with SHSTK enabled
Removed accidentally duplicated shadow stack handling sections
1 parent 151a677 commit bac1b17

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
@@ -67,14 +67,6 @@ jump_fcontext:
6767
movq %rbx, 0x30(%rsp) /* save RBX */
6868
movq %rbp, 0x38(%rsp) /* save RBP */
6969

70-
#if BOOST_CONTEXT_SHADOW_STACK
71-
/* grow the stack to reserve space for shadow stack pointer(SSP) */
72-
leaq -0x8(%rsp), %rsp
73-
/* read the current SSP and store it */
74-
rdsspq %rcx
75-
movq %rcx, (%rsp)
76-
#endif
77-
7870
#if BOOST_CONTEXT_SHADOW_STACK
7971
/* grow the stack to reserve space for shadow stack pointer(SSP) */
8072
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
@@ -91,35 +91,6 @@ make_fcontext:
9191
/* will be entered after context-function returns */
9292
movq %rcx, 0x38(%rax)
9393

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

0 commit comments

Comments
 (0)