Kernel Function Patching for System Call Interception

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Intercepting system calls in the LINUX™ operating system is challenging due to indirect methods for reading non-exported kernel symbols, special requirements for overwriting system call vectors, and frequent changes that necessitate repeated porting efforts, leading to interoperability issues among third-party products.

Innovation Solution

Patching operating system kernel functions to point to an agent function, allowing the agent function to be executed when a system call stub invokes the kernel function, thereby intercepting system calls without modifying the system call vector table.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If third-party software intercepts system calls by modifying system call vectors, then system call interception is achieved, but interoperability problems occur and porting efforts are required for each kernel change

Engineering Contradiction:
Improvesystem call interception reliabilityVSAvoidinteroperability among third-party products
Core Design Contradiction:
ReliabilityVSAdaptability or versatility

Solution Approach 1:

The patent introduces an intermediary mechanism (the agent function with first and second pointers) that mediates between third-party interception software and the operating system kernel. The agent function acts as a universal intermediary that can be called by various system call vectors without requiring direct modification of each vector, thereby enabling reliable interception while maintaining interoperability.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The agent function is designed with multi-functionality to handle multiple system call vectors through a single unified interface. By using the first pointer to receive calls from different vectors and the second pointer to uniformly redirect to the same agent function, the system achieves universal interception capability that works across different kernel versions and third-party products without requiring separate porting efforts.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Reliability

If system call vectors are overwritten to intercept calls, then interception is achieved, but the vectors are normally protected as read-only values making modification difficult

Engineering Contradiction:
Improvesystem call interception capabilityVSAvoidease of modifying system call vectors
Core Design Contradiction:
ReliabilityVSEase of manufacture

Solution Approach 1:

The patent extracts the interception functionality from the protected system call vectors and relocates it to a separate agent function. Instead of modifying the read-only vectors directly, the system creates a copy of the vector entry (first pointer) that can be modified, while the actual interception logic is extracted into the agent function that receives calls through this copy.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The agent function performs preliminary action by establishing the first pointer to point to itself before the actual system call execution. This preliminary setup allows the protected system call vector to remain unchanged while the agent function prepares the interception mechanism in advance, avoiding the need to modify read-only memory during call execution.

Inventive Principle:
Principle #10Preliminary action

3Productivity

If frequent kernel changes are made, then system call improvements are achieved, but repeated porting efforts are required for third-party software

Engineering Contradiction:
Improvekernel development agilityVSAvoidtime for repeated porting efforts
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The patent segments the system call interception architecture into separate components: the protected system call vectors, the modifiable first pointers, and the agent function. This segmentation allows the kernel to be updated independently without affecting third-party software, as only the first pointers need to be updated to reflect new vector addresses, while the agent function remains unchanged.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces dynamic adaptability through the first pointer mechanism that can automatically adjust to new system call vector addresses after kernel changes. The agent function maintains a dynamic relationship with the kernel symbols through these pointers, allowing it to adapt to kernel version changes without requiring code porting, thereby eliminating time loss from repeated porting efforts.

Inventive Principle:
Principle #15Dynamics

4Reliability

If direct interception of system calls is implemented, then interception effectiveness is achieved, but indirect methods for reading non-exported kernel symbols create complexity

Engineering Contradiction:
Improveinterception effectivenessVSAvoidcomplexity of reading non-exported kernel symbols
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent uses the first pointer as an intermediary mechanism that simplifies access to non-exported kernel symbols. Instead of directly reading protected kernel symbols which requires complex indirect methods, the system modifies the first pointer to point to the agent function, creating a simpler and more maintainable interface that reduces the complexity of symbol access while maintaining interception effectiveness.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9483327B2Mechanism for interposing on operating system calls
Publication Date: 2016.11.01 THALES DIS CPL USA INC
  • US9483327B2 patent drawing
  • US9483327B2 patent drawing
  • US9483327B2 patent drawing

AI summary

A method for interposing on operating system calls in a host is provided. The method includes patching an operating system kernel function, the patching comprising adding a first pointer that invokes an agent function, the patching performed by an agent. The method includes executing the agent function, responsive to a system call stub calling the operating system kernel function, which invokes the agent function via the first pointer, wherein at least one action of the method is performed by a processor of a host having an operating system.