Virtual Function Pointer Validation via Class Hierarchy Hash Table

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Software applications are vulnerable to malicious attacks that alter their control flow, such as worms and viruses exploiting vulnerabilities in virtual function pointers, leading to unanticipated execution sequences and performance degradation, despite existing mitigation efforts that cannot guarantee prevention of attacks.

Innovation Solution

A device and method that compiles source code to generate a Class Hierarchy Hash Table (CHHT) with security checks, hashing virtual function pointers, and relocating virtual tables to a specific memory range, ensuring valid function calls by comparing hash results with indicators in the CHHT before invocation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If security checks are inserted into the program binary to validate virtual function calls, then control flow integrity is improved, but device complexity increases

Engineering Contradiction:
Improvecontrol flow integrityVSAvoidsystem complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent pre-computes hash values of all legitimate virtual function pointers during compilation and stores them in a hash table before runtime execution. This preliminary action allows the runtime security check to simply compare incoming function pointers against the pre-computed hash table, rather than performing complex validation during execution, thus improving reliability while managing device complexity.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent introduces a hash table as an intermediary data structure that stores pre-computed hash values of legitimate virtual function pointers. This intermediary enables efficient O(1) lookup and validation of function pointers during runtime, simplifying the security check mechanism while maintaining strong control flow integrity guarantees.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If hash computation is performed for each virtual function pointer validation, then measurement precision is improved, but use of energy increases

Engineering Contradiction:
Improvevalidation accuracyVSAvoidenergy consumption
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The patent performs the computationally intensive hash computation during the compilation phase rather than at runtime. All virtual function pointers are hashed in advance and their hash values are stored in a hash table. During runtime, the system only performs simple hash table lookups by comparing the computed hash of the incoming function pointer against the pre-stored hashes, dramatically reducing energy consumption while maintaining validation accuracy.

Inventive Principle:
Principle #10Preliminary action

3Reliability

If the Class Hierarchy Hash Table stores all valid virtual function pointers, then reliability is improved, but volume of stationary object increases

Engineering Contradiction:
Improvevalidation reliabilityVSAvoidmemory consumption
Core Design Contradiction:
ReliabilityVSVolume of stationary object

Solution Approach 1:

The patent extracts only the essential validation information (hash values of legitimate virtual function pointers) into a compact hash table, storing it in the read-only section of the binary. By using hash-based storage rather than storing full function pointer structures, the patent significantly reduces the memory footprint while maintaining complete validation coverage for all legitimate virtual function calls.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentEP3861469B1Device and method for validation of virtual function pointers
Publication Date: 2023.05.31 HUAWEI TECH CO LTD
  • EP3861469B1 patent drawingFigure 1A~1B
  • EP3861469B1 patent drawingFigure 2
  • EP3861469B1 patent drawingFigure 3

AI summary

Device (170) and method for validation of virtual function pointers. The method is about compiling a source code file with one or more classes whereby each of the classes has a virtual table, the compiling comprises: associating a security check function with the virtual function invocation site such that the associated security check function is executed prior to an invocation of the virtual function; generating a Class Hierarchy Hash Table (CHHT); whereby when the compiled source code file is executed, the security check function is used to determine whether an invoked virtual function pointer of a virtual function associated with the security check function is valid by looking up a indicator in the CHHT according to a hash result of the virtual function pointer and an address of a virtual table containing the virtual function pointer.