IP Library Granted Patent US 12,367,019
Granted Patent B2
US 12,367,019 · App. 18/365,312 · Granted Jul 22, 2025

Method and apparatus for implementing batch system call

Inventors: Xin Gao (Shenzhen, CN); Yuzhong Wen (Hangzhou, CN); Bin Fang (Shanghai, CN); Hai He (Hangzhou, CN)
Assignee: HUAWEI TECHNOLOGIES CO., LTD.
G06F8/42
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,367,019
App. No.
18/365,312
Granted
Jul 22, 2025
Kind
B2
Abstract

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.

Claims (35)

1. A method for implementing a batch system call, comprising:

loading an executable program to a user-mode virtual address space, wherein the executable program is obtained by compiling source code of the batch system call, and the executable program comprises abstract syntax tree (AST) data of the batch system call; and

invoking a first instruction, wherein the first instruction, when executed, causes a kernel to read the AST data from the user-mode virtual address space, and generate, based on the AST data, binary code for implementing the batch system call, the binary code being stored in a kernel-mode virtual address space.

2. The method according to claim 1 , wherein the executable program further comprises call stub code of the batch system call, and the method further comprises:

invoking a second instruction when the call stub code of the batch system call is executed, wherein the second instruction, when executed, causes the kernel to execute the binary code to implement the batch system call.

3. The method according to claim 2 , wherein after the invoking of the first instruction, the method further comprises:

receiving an invoking result of the first instruction, wherein the invoking result comprises an identifier of the binary code for implementing the batch system call, wherein

the second instruction carries the identifier, and the second instruction, when executed, causes the kernel to execute the binary code corresponding to the identifier to implement the batch system call.

4. The method according to claim 1 , wherein the source code of the batch system call comprises delay information of the batch system call, and the AST data comprises the delay information of the batch system call; and

the first instruction, when executed, further causes the kernel to calculate a worst-case execution time of the batch system call based on the delay information in the AST data.

5. The method according to claim 4 , wherein the first instruction, when executed, further causes the kernel to store the worst-case execution time into the kernel-mode virtual address space.

6. An apparatus for implementing a batch system call, comprising at least one memory and at least one processor, wherein the at least one memory is configured to store a computer program, and the at least one processor is configured to invoke the computer program from the at least one memory and run the computer program to perform operations comprising:

loading an executable program to a user-mode virtual address space, wherein the executable program is obtained by compiling source code of the batch system call, and the executable program comprises abstract syntax tree (AST) data of the batch system call; and

invoking a first instruction, wherein the first instruction, when executed, causes a kernel to read the AST data from the user-mode virtual address space, and generate, based on the AST data, binary code for implementing the batch system call, the binary code being stored in a kernel-mode virtual address space.

7. The apparatus according to claim 6 , wherein the executable program further comprises call stub code of the batch system call, and the operations further comprise:

invoking a second instruction when the call stub code of the batch system call is executed, wherein the second instruction, when executed, cause the kernel to execute the binary code to implement the batch system call.

8. The apparatus according to claim 7 , wherein after the invoking of the first instruction, the operations further comprise:

receiving an invoking result of the first instruction, wherein the invoking result comprises an identifier of the binary code for implementing the batch system call, wherein

the second instruction carries the identifier, and the second instruction, when executed, causes the kernel to execute the binary code corresponding the identifier to implement the batch system call.

9. The apparatus according to claim 6 , wherein the source code of the batch system call comprises delay information of the batch system call, and the AST data comprises the delay information of the batch system call; and

the first instruction, when executed, further causes the kernel to calculate a worst-case execution time of the batch system call based on the delay information in the AST data.

10. The apparatus according to claim 9 , wherein the first instruction, when executed, further causes the kernel to store the worst-case execution time into the kernel-mode virtual address space.

11. A non-transitory storage medium, storing a computer program that, when executed by one or more processors, control the one or more processors to perform operations comprising:

loading an executable program to a user-mode virtual address space, wherein the executable program is obtained by compiling source code of a batch system call, and the executable program comprises abstract syntax tree (AST) data of the batch system call; and

invoking a first instruction, wherein the first instruction, when executed, causing a kernel to read the AST data from the user-mode virtual address space, and generate, based on the AST data, binary code for implementing the batch system call, the binary code being stored in a kernel-mode virtual address space.

12. The non-transitory storage medium according to claim 11 , wherein the executable program further comprises call stub code of the batch system call, and the operations further comprise:

invoking a second instruction when the call stub code of the batch system call is executed, wherein the second instruction, when executed, causes the kernel to execute the binary code to implement the batch system call.

13. The non-transitory storage medium according to claim 12 , wherein after the invoking of the first instruction, the operations further comprise:

receiving an invoking result of the first instruction, wherein the invoking result comprises an identifier of the binary code for implementing the batch system call, wherein

the second instruction carries the identifier, and the second instructions, when executed, causes the kernel to execute the binary code corresponding to the identifier to implement the batch system call.

14. The non-transitory, computer-readable storage medium according to claim 11 , wherein the source code of the batch system call comprises delay information of the batch system call, and the AST data comprises the delay information of the batch system call; and

the first instruction, when executed, further causes the kernel to calculate a worst-case execution time of the batch system call based on the delay information in the AST data.

15. The non-transitory, storage medium according to claim 14 , wherein the first instruction, when executed, further causes the kernel to store the worst-case execution time into the kernel-mode virtual address space.

16. The method of claim 1 , wherein the AST data represents a syntax structure of a programming language in a tree, and each node in the tree represents a structure in the source code of the batch system call.

17. The method of claim 1 , wherein the AST data of the batch system call belongs to a data segment in the executable program of the batch system call.

Assignments (2)
EMPLOYMENT AGREEMENT Recorded May 14, 2025
From: GAO, XIN
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 071417/0891 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Apr 14, 2025
From: WEN, YUZHONG; FANG, BIN; HE, HAI
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 070824/0667 →
Priority Claims (1)
CN 202110163179.2 · Feb 5, 2021 · national
Continuity (2)
Continuation PCTCN2022071747 · Jan 13, 2022
Related Publication 20230376289A1 · Nov 23, 2023
References Cited (13)
US 5584023A · Hsu · 1996 [cited by examiner]
US 7191445B2 · Brokish · 2007 [cited by applicant]
US 20160147559A1 · Weimer · 2016 [cited by examiner]
US 20180349614A1 · Ionescu · 2018 [cited by examiner]
US 20190108342A1 · Conikee · 2019 [cited by examiner]
CN 105468400A · 2016 [cited by applicant]
CN 105677493A · 2016 [cited by applicant]
CN 107729159A · 2018 [cited by applicant]
CN 108062253A · 2018 [cited by applicant]
CN 112199217A · 2021 [cited by applicant]
CN 114546539A · 2022 [cited by examiner]
WO 2017036376A1 · 2017 [cited by applicant]
International Search Report and Written Opinion issued in PCT/CN2022/071747, dated Apr. 13, 2022, 10 pages. [cited by applicant]