Patent ID: 11861364
Assignee: nan
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 15:
16. A method, implemented at a computer system that includes a processor, for enabling at least a portion of a shadow stack to be a circular stack an audit mode, the method comprising:
initiating execution of a thread at the processor, the execution of the thread including:
initiating execution of executable code of an application binary as part of the thread; and
enabling shadow stack functionality for the thread in the audit mode;

based at least on the execution of the thread at the processor in the audit mode, enabling at least a portion of a shadow stack as a circular stack;
processing an exception triggered by a mismatch between a first return address in a call stack corresponding to the thread and a second return address in a shadow stack corresponding to the thread, including replacing the second return address stored in the shadow stack with the first return address, such that a violation caused by the mismatch is not enforced;
determining that usage of the shadow stack has reached a defined usage threshold;
overwriting a currently used entry of the shadow stack, based on determining that usage of the shadow stack has reached the defined usage threshold, preventing the shadow stack from overflowing a memory region allocated to the shadow stack; and
preventing shadow stack enforcement for the thread based on the currently used entry being overwritten on the shadow stack.