Software Memory Tagging for Low-Overhead Heap Overflow Detection

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing buffer overflow protection methods, such as hardware memory tagging and page heap, are not compatible with 32-bit and 64-bit operating systems, and solutions like Address Sanitizer (ASAN) incur significant performance degradation.

Innovation Solution

A software-based buffer overflow protection system using a bit map to maintain disjoint heap memory allocations, where each allocation is assigned a unique tag value, allowing for efficient detection of buffer overflows by comparing tag values during memory write operations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If hardware memory tagging or page heap is used for buffer overflow protection, then buffer overflow detection capability is improved, but compatibility with 32-bit and 64-bit operating systems deteriorates

Engineering Contradiction:
Improvebuffer overflow detection capabilityVSAvoidcompatibility with 32-bit and 64-bit operating systems
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent replaces hardware-based memory tagging mechanisms with a software-based solution that uses a bit map data structure to track heap memory allocations. Instead of relying on hardware features that are incompatible with certain operating systems, the invention uses software instructions to read and compare tag values from the bit map, achieving buffer overflow detection across 32-bit and 64-bit systems without hardware dependencies

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The patent introduces a bit map as an intermediary data structure that mediates between the heap memory allocations and the buffer overflow detection mechanism. The bit map stores tag values for each heap allocation and serves as the intermediary that the software reads to determine whether a buffer overflow has occurred, enabling compatibility across different operating system architectures

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If Address Sanitizer (ASAN) is used for buffer overflow protection, then buffer overflow detection capability is improved, but processing performance deteriorates

Engineering Contradiction:
Improvebuffer overflow detection capabilityVSAvoidprocessing performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent extracts only the essential tag comparison functionality needed for buffer overflow detection, separating it from the comprehensive but performance-heavy Address Sanitizer system. By using a simple bit map with tag values and performing minimal comparisons during memory operations, the invention achieves buffer overflow detection with significantly reduced processing overhead compared to full ASAN instrumentation

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent performs partial checking by comparing tag values only for the specific memory addresses involved in each allocation and deallocation operation, rather than performing exhaustive checks on all memory accesses. This partial action approach maintains adequate security while minimizing the performance impact on normal program execution

Inventive Principle:
Principle #16Partial or excessive action

3Reliability

If traditional buffer overflow protection methods are used, then security against buffer overflow is improved, but memory overhead increases

Engineering Contradiction:
Improvesecurity against buffer overflowVSAvoidmemory overhead
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The patent applies local quality by using a bit map where each bit represents the tag value for a specific heap allocation. This localized approach stores only the necessary tag information at the appropriate memory locations rather than using comprehensive protection structures, reducing overall memory overhead while maintaining security

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent changes the parameter representation by using single-bit tag values in the bit map instead of larger data structures. By encoding heap allocation tags as individual bits rather than using complex metadata structures, the invention significantly reduces the memory overhead required for buffer overflow protection

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12517676B2Software memory tagging for heap overflow protection
Publication Date: 2026.01.06 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12517676B2 patent drawing
  • US12517676B2 patent drawing
  • US12517676B2 patent drawing

AI summary

Generally discussed herein are devices, systems, and methods for software memory tagging that provides buffer overflow protection. A method can include responsive to a memory write operation to write data to a heap of a memory, identifying a first tag value associated with a first address of the memory write operation in the bit map, comparing, for each address after the first address affected by the memory write operation, respective tag values in a bit map of the memory to the identified first tag value, and halting execution of the application if any of the respective tag values do not match the first tag value.