AST-Based Batch System Calls for Secure Kernel Code Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In microkernel architectures, batch system calls are prone to security vulnerabilities due to the ease of inserting malicious code into binary code during registration, leading to performance deterioration and errors.
Innovation Solution
Compile source code of batch system calls into executable programs containing abstract syntax tree (AST) data, load this data to a user-mode virtual address space, and have the kernel generate binary code from AST data in the kernel-mode virtual address space, making it difficult to insert malicious code into the binary code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If binary code is directly registered with the kernel for batch system call implementation, then the system call execution efficiency is improved, but security is compromised due to ease of malicious code insertion
Solution Approach 1:
The patent introduces an intermediary representation (abstract syntax tree) between the registered program and the generated binary code. The kernel registers and stores the intermediary representation instead of directly registering binary code, acting as a mediator that prevents malicious code insertion while enabling efficient execution. The intermediary representation serves as a secure intermediate form that can be verified and transformed into executable code only through authorized kernel operations.
Solution Approach 2:
The patent performs preliminary compilation of the batch system call program into an intermediary representation (abstract syntax tree) before registration with the kernel. This preliminary action ensures that the program structure is validated and secured before being stored in the kernel, preventing malicious code insertion at the registration stage while maintaining the ability to generate efficient binary code later when needed.
2Productivity
If multiple system calls are packaged into a batch system call, then the number of IPC operations is reduced and performance is improved, but the complexity of code registration and management increases
Solution Approach 1:
The patent extracts the registration and management complexity from the kernel by using an intermediary representation that can be stored and managed in a standardized format. The abstract syntax tree structure separates the program semantics from the execution details, allowing the kernel to manage batch system calls without dealing with the complexity of multiple binary code formats and registration procedures.
Solution Approach 2:
The patent changes the parameter format for registration from binary code to an intermediary representation (abstract syntax tree). This parameter change simplifies the registration process by using a standardized, text-based or structured format that is easier to parse, validate, and manage than binary code, while still containing all necessary information for generating executable code.
Data Source
AI summary
A method and a related apparatus for implementing a batch system call are disclosed. The method includes: loading an executable program to a user-mode virtual address space, where the executable program is obtained by compiling source code of the batch system call, and includes abstract syntax tree (AST) data of the batch system call; and invoking a first instruction to invoke a kernel to generate, based on the AST data in the user-mode virtual address space, binary code that is used to implement the batch system call. Because there is difficulty in inserting malicious data into a data structure like the AST, it is difficult to insert malicious code into the binary code of the batch system call, so as to avoid an error or an excessively long delay caused by the malicious code when the kernel runs the binary code of the batch system call, thereby improving security of the batch system call.


