I found out that many protection mechanisms are used in computer security to ensure control-flow integrity, one of these mechanisms is the Shadow stack:
The principal is very easy it ensure the integrity of return address of functions. In fact the return address located in the stack is compared to the one pushed in the shadow stack.
There are several implementation of the Shadow stack, one of them consist of modifying the function epilogue and prologue(to make it write in the Shadow stack and load from it for the check).
The question is: If the functions in user space are allowed to write in the shadow stack, how can we prevent the attacker to write/modify the Shadow stack?