Dynamic Image Trampoline Calls for Faster Kernel Interface Access
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing solutions for running applications on electronic devices face low efficiency and fail to meet real-time performance requirements, particularly in embedded systems, where limited system resources and potential kernel attacks compromise reliability.
Innovation Solution
A program running method that utilizes a trampoline function pointer segment to directly access kernel or common code library interfaces, combined with dynamic image optimization and user-mode security checks, reducing resource overheads and minimizing kernel attack risks.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional application running methods are used, then system resource overhead is reduced, but application running efficiency and real-time performance are low
Solution Approach 1:
The patent segments the application image into multiple dynamic images, each corresponding to different function modules. This allows selective loading and execution of only necessary modules, improving running efficiency while reducing overall resource overhead by avoiding loading of unused components.
Solution Approach 2:
The patent performs preliminary compilation of the application into a segmented dynamic image structure before runtime. This pre-processing organizes code and data into executable segments with associated metadata, enabling fast loading and execution during runtime without compromising system resource overhead.
2Speed
If kernel interfaces are accessed through traditional methods, then system reliability is maintained, but call time and response speed are slow
Solution Approach 1:
The patent introduces a trampoline function as an intermediary layer between user-mode application code and kernel-mode interfaces. This trampoline mechanism enables direct function pointer calls that bypass traditional system call overhead, significantly reducing call time while maintaining system reliability through controlled mode transitions.
Solution Approach 2:
The patent creates copyable function pointers in the trampoline segment that reference kernel interfaces. These copied pointers can be directly used in user-mode code to invoke kernel functions without traditional indirect calling mechanisms, achieving fast direct addressing while preserving kernel protection boundaries.
3Quantity of substance
If complete dynamic images including symbol tables are loaded, then application functionality is complete, but memory space and resource overhead increase
Solution Approach 1:
The patent extracts and removes the symbol table from the loaded dynamic image, keeping only the essential code and data segments necessary for execution. This extraction reduces memory space requirements significantly while maintaining complete application functionality, as symbol resolution is handled through the segmented structure and trampoline mechanisms.
Solution Approach 2:
The patent uses lightweight segment headers and metadata structures instead of comprehensive symbol tables. These simplified structures consume minimal memory space and can be discarded or regenerated as needed, providing efficient loading and running without the overhead of maintaining complete symbol information in memory.
4Reliability
If user-mode checking is implemented, then security against kernel attacks is improved, but system complexity increases
Solution Approach 1:
The patent implements preliminary checking of dynamic images in user-mode before they are executed or loaded into kernel space. This pre-validation process verifies integrity and security attributes of the dynamic image, preventing malicious code from compromising the kernel while avoiding the need for complex continuous monitoring mechanisms.
Solution Approach 2:
The patent uses the trampoline function as an intermediary that enforces security boundaries between user-mode and kernel-mode. The trampoline mechanism provides a controlled interface that allows necessary interactions while preventing unauthorized kernel attacks, improving security without significantly increasing system complexity through simple boundary enforcement.
Data Source
Figure 1~3A
Figure 3B
Figure 4
AI summary
A program running method and a device are provided, relate to the field of terminal technologies, and can improve efficiency of running an application. The method includes: obtaining a dynamic image of an application, where the dynamic image includes a trampoline function pointer segment, the trampoline function pointer segment includes at least one trampoline function pointer, the at least one trampoline function pointer corresponds to at least one interface, and the at least one interface includes an interface of a kernel or an interface of a common code library; and calling the interface of the kernel or the interface of the common code library based on the trampoline function pointer segment, to run the application.