boostorg / context

307 stars 150 forks source link

Add shadow stack support for fcontext #207

Closed PeterYang12 closed 2 years ago

PeterYang12 commented 2 years ago
Shadow stack is part of Intel's Control-Flow Enforcement Technology.

Whenever a function is called, the return address is pushed onto both
the regular stack and the shadow stack. When that function returns, the
return addresses are popped off both stacks and compared; if they fail
to match, #CP raised.

Backport this commit from https://github.com/php/php-src/pull/9283
With this commit, we create shadow stack with syscall map_shadow_stack
(no.451) for each fiber context and switch the shadow stack accordingly
during fcontext switch.

Signed-off-by: PeterYang12 yuhan.yang@intel.com Signed-off-by: chen-hu-97 hu1.chen@intel.com

olk commented 2 years ago

ty