Guard Word Stack Corruption Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing computing environments face challenges in detecting and preventing stack corruption, which can lead to unexpected program behavior or malicious code execution due to overwriting of return addresses in call stacks.

Innovation Solution

A computer system is configured to use a guard word placed in the stack frame of a caller routine, which is verified by called routines to detect any corruption, employing architected instructions like Store Guard Word and Verify Guard Word to ensure the integrity of the stack and prevent malicious returns.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If traditional stack execution is used without guard words, then execution speed is fast and overhead is low, but stack corruption detection capability is absent

Engineering Contradiction:
Improvestack corruption detectionVSAvoidprotection mechanism overhead
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The guard word is stored in the stack frame before the called routine executes, establishing a protection mechanism in advance. This preliminary action allows the called routine to later verify the guard word's integrity without adding complex runtime protection logic

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The guard word acts as an intermediary element between the caller and called routine, serving as a verification token that mediates the detection of stack corruption. Instead of directly checking stack integrity through complex mechanisms, the system uses this intermediate guard word value to indicate corruption status

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If guard word verification is performed at every routine return, then stack corruption is detected, but execution overhead increases

Engineering Contradiction:
Improvestack integrity verificationVSAvoidroutine execution efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The verification mechanism applies local quality checking by examining only the specific guard word value at the particular stack location rather than performing comprehensive stack analysis. This localized verification reduces overhead while maintaining detection capability

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The guard word verification uses a simple, inexpensive comparison operation that can be performed quickly and discarded after use. The verification logic is lightweight and does not require complex or long-lived data structures, enabling frequent checks with minimal performance impact

Inventive Principle:
Principle #27Cheap short-living objects (Disposable)

Data Source

PatentUS10229266B2Architected store and verify guard word instructions
Publication Date: 2019.03.12 INTERNATIONAL BUSINESS MACHINE CORPORATION
  • US10229266B2 patent drawing
  • US10229266B2 patent drawing
  • US10229266B2 patent drawing

AI summary

Corruption of call stacks is detected by using guard words placed in the call stacks. A store guard word instruction is used to store a guard word on a stack frame of a caller routine, and a verify guard word instruction issued by one or more callee routines is used to verify the guard word is an expected value. If the guard word is an unexpected value, corruption is indicated.