Providing instructions to protect stack return addresses in a hardware managed stack architecture
AssigneeInternational Business Machines Corporation
InventorsKarl J. Duvalsaint, Michael K. Gschwind, Valentina Salapura
Life of this patent
Estimating the term…
Abstract
Corruption of program stacks is detected by using guard words placed in the program stacks. An instruction, which is to be used in protecting stacks of a computing environment, is provided in a called routine, based on determining that the called routine is to include logic to detect corruption of stacks. The instruction in the called routine is to check a guard word provided by a calling routine to determine whether a stack is corrupt.
Claims20
A computer program product for facilitating detection of corruption of stacks of a computing environment, said computer program product comprising:
- a non-transitory computer readable storage medium readable by a processing circuit and storing instructions for execution by the processing circuit for performing a method comprising:
- determining that a called routine executing on a processor of the computing environment is to include logic to detect corruption of stacks;
- and
- providing, based on determining that the called routine is to include logic to detect corruption of stacks, an instruction in the called routine to check a guard word provided by a calling routine, the calling routine having called the called routine, and the guard word being stored in a stack by the calling routine and protecting a return address stored directly into the stack by a hardware instruction, the guard word being stored in the stack at a location between a stack frame of the calling routine and a stack frame of the called routine, the stack frame of the calling routine and the stack frame of the called routine being a part of the stack.
A computer system for facilitating detection of corruption of stacks of a computing environment, said computer system comprising:
- a memory;
- and
- a processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:
- determining that a called routine executing on a processor of the computing environment is to include logic to detect corruption of stacks;
- and
- providing, based on determining that the called routine is to include logic to detect corruption of stacks, an instruction in the called routine to check a guard word provided by a calling routine, the calling routine having called the called routine, and the guard word being stored in a stack by the calling routine and protecting a return address stored directly into the stack by a hardware instruction, the guard word being stored in the stack at a location between a stack frame of the calling routine and a stack frame of the called routine, the stack frame of the calling routine and the stack frame of the called routine being a part of the stack.
A computer-implemented method of detecting corruption of stacks of a computing environment, said computer-implemented method comprising:
- determining that a called routine executing on a processor of the computing environment is to include logic to detect corruption of stacks;
- and
- providing, based on determining that the called routine is to include logic to detect corruption of stacks, an instruction in the called routine to check a guard word provided by a calling routine, the calling routine having called the called routine, and the guard word being stored in a stack by the calling routine and protecting a return address stored directly into the stack by a hardware instruction, the guard word being stored in the stack at a location between a stack frame of the calling routine and a stack frame of the called routine, the stack frame of the calling routine and the stack frame of the called routine being a part of the stack.
Dependencies are inferred from the claim text.