A vulnerability evaluation method for GPU kernel instructions
By constructing a GPU kernel instruction tree model and training a generative adversarial network, and dynamically loading test instructions, the problem of existing technologies being unable to analyze GPU kernel vulnerabilities is solved. This enables security assessment of the GPU kernel and simulation of malicious instructions, ensuring the security of GPU parallel computing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- UNIV OF ELECTRONICS SCI & TECH OF CHINA
- Filing Date
- 2026-03-20
- Publication Date
- 2026-07-21
AI Technical Summary
Existing instruction security analysis techniques cannot be effectively applied to GPU kernels, resulting in a lack of kernel security analysis methods, difficulty in analyzing the path of malicious instructions, and an inability to ensure the security of GPU parallel computing.
By reverse engineering the GPU kernel structure, extracting instructions and constructing a directed tree model, training a generative adversarial network to generate test instructions, dynamically loading the kernel for security modeling and testing, and assessing kernel vulnerabilities.
Effectively analyze the vulnerabilities of the GPU kernel, assess the risks of potential malicious instructions, provide reliable security analysis methods for high-performance parallel computing of GPUs, and ensure the robustness of the kernel under malicious instruction attacks.
Smart Images

Figure CN122431723A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of processor security, and proposes an effective kernel vulnerability analysis method to address the instruction execution security problem of GPU kernels, providing a reliable security analysis means for GPU-based high-performance parallel computing applications. Background Technology
[0002] With the continuous development of emerging fields such as image processing, artificial intelligence, and cloud computing, Graphics Processing Units (GPUs) are widely used in various computing acceleration applications due to their high-performance parallel computing capabilities. However, as a coprocessor, the GPU cannot independently load and run its kernel; it requires control from the host side. The GPU kernel is the execution entity containing instructions. This exposes the GPU kernel to an untrusted execution environment, where malicious instructions may be injected by potential attackers, potentially leading to serious security risks such as computational errors, unauthorized privilege escalation, denial-of-service attacks, and information leakage. For example, in the paper O. Kwon, Y. Kim, J. Huh, et al. ZeroKernel: Secure context-isolated execution on commodity GPUs [J]. IEEE Transactions on Dependable and Secure Computing, vol. 18, no. 4, pp. 1974-1988, 2019., Kwon et al. manipulated the GPU page table to inject malicious instructions into the GPU kernel, causing the GPU to leak keys during the execution of encryption algorithms. Furthermore, in the paper C. Domas. Hardware Backdoors in x86 CPUs [C]. BlackHat USA, 2018: 1–14., Guo et al. exploited a GPU memory overflow vulnerability to inject malicious instructions into the GPU kernel, resulting in a significant decrease in the predictive performance of neural networks deployed on the GPU. Therefore, it is essential to study vulnerability analysis methods for GPU kernels to ensure the security of GPU parallel computing.
[0003] Current instruction security analysis techniques, such as [3] F. Strupe, R. Kumar. Uncovering hidden instructions in Armv8-A implementations [M]. Hardware and Architectural Support for Security and Privacy, 2020, mainly target typical CPU processor architectures such as X86, ARM, and DSP. However, GPU architecture differs greatly from traditional CPU architecture, specifically in its streaming multiprocessor architecture, kernel compilation and loading mechanism, and single instruction multithreaded execution, which makes it impossible for existing instruction security analysis methods to be directly and effectively applied to GPUs. Therefore, in the field of vulnerability analysis for GPU kernels, there are still technical challenges such as the lack of kernel security analysis methods and the difficulty in analyzing the path of malicious instructions. It is urgent to propose a vulnerability analysis method that can effectively target GPU kernels to ensure the security of GPU parallel computing applications. Summary of the Invention
[0004] This invention proposes a vulnerability assessment method for GPU kernel instructions. This method addresses the problem that existing technologies struggle to effectively analyze GPU kernel vulnerabilities when facing potential malicious instruction attacks. Compared to existing technologies, this method focuses on five aspects: kernel instruction extraction, instruction execution modeling, generator network training, test instruction injection, and dynamic kernel loading. It performs security modeling and testing on the GPU kernel instruction execution process, effectively realizing vulnerability analysis of GPU kernel instructions. This facilitates the assessment of potential malicious instruction risks and vulnerabilities in target GPU applications, providing a reliable security analysis tool for high-performance parallel computing applications based on GPUs.
[0005] This invention proposes a vulnerability assessment method for GPU kernel instructions. The method first reverse-engineers the organizational structure of the GPU kernel under test, extracting the instruction portion. Then, based on the data flow and execution path between instructions, it constructs a directed tree model of the instruction flow. Next, it trains a generative adversarial network (GAN) model to generate test instructions, which are then injected into the kernel to simulate a malicious instruction attack. Finally, using dynamic kernel loading technology, the kernel with the injected test instructions is loaded onto the GPU for execution, and the kernel vulnerability is assessed based on the execution results. If the test instructions affect the kernel execution results, it indicates that the kernel has a security vulnerability; otherwise, the kernel has no security risk. This method effectively solves the problems of insufficient GPU kernel vulnerability analysis methods, difficulty in generating kernel test instructions, unclear malicious instruction impact paths, and difficulty in dynamically loading test kernels, providing security assurance for GPU parallel computing applications. The process of the vulnerability analysis method for GPU kernel instructions is as follows: Figure 1 As shown, the technical solution of this invention is a vulnerability assessment method for GPU kernel instructions, which includes:
[0006] Step 1: Extract kernel instructions;
[0007] The process of extracting kernel instructions is as follows: Figure 2 As shown;
[0008] Step 1.1: Locate the offset address of the section header table based on the header information;
[0009] Step 1.2: Identify each entry in the section header table;
[0010] Step 1.3: Determine if the type of the section header entry is 0x1. If yes, proceed to step 1.4; otherwise, perform the determination here.
[0011] Step 1.4: Locate the instruction based on the offset address of the section header entry;
[0012] Step 1.5: Extract instructions from the kernel;
[0013] The GPU kernel file consists of four parts: header (ehead), sections, header table (shead), and program header table (phead). The header (ehead) contains header table offsets (e_shoff and e_shnum), indicating the location and number of header table entries in the header table (shead). The header table (shead) contains e_shnum entries, each with a type (sh_type) and size (sh_size). The type of each entry is identified sequentially. When the type (sh_type) equals "0x1", the corresponding offset address (sh_offset) in the header table entry is the location (ins_addr) where the kernel instruction I is stored, as shown in Equation 1. Only one header table entry in the kernel contains the offset address (sh_offset) of the instruction. Finally, the instruction I, with a length of sh_size bytes, is read from the kernel instruction address (ins_addr).
[0014] (1);
[0015] Step 2: Instruction execution modeling;
[0016] The format of GPU instruction I is shown in Equation 2, where opcode is the opcode of assembly instruction I, indicating the operation type of the instruction; the first operand dest is the destination operand, used to store the operation result; and the second operand src is the source operand, used to store the input data.
[0017] (2);
[0018] First, locate the kernel's memory type instruction I. st And use it as the root node T of the directed tree T. root As shown in Equation 3;
[0019] (3);
[0020] Then search for the storage instruction I. st Proximity association instruction I r The definition of proximity association is: within the kernel, the distance I from the current instruction... st Recent instructions, and I r The destination operand is the current instruction I st The source operands are shown in Equation 4; where Indicate I st The source operand, Indicate I r The target operand, This indicates that the distance between two instructions in the kernel file is calculated.
[0021] (4);
[0022] Finally, connect I with a directed edge. st and I r , by I r Point to I st As shown in Equation 5; at the same time, As a new leaf node of tree T As shown in Equation 6;
[0023] (5);
[0024] (6);
[0025] Search and connect to leaf node T leaf Adjacent related instructions and will As a new leaf node; if the instruction If it is a load type instruction, then stop the growth of tree T; otherwise, continue searching and connecting with leaf nodes T. leaf The next associated instruction;
[0026] Step 3: Build and train a generative network to produce test instructions;
[0027] Step 4: Test instruction injection;
[0028] In the instruction tree T modeled in step 2, an instruction node is randomly selected as a vulnerability test node in a uniform distribution. Then, the test instructions generated in step 3 are... Injected into the instruction tree T generated by the GPU kernel, the injection location is... As shown in Equation 12; where Represents the instruction tree T node," "Indicates that the test command will be executed" Connect to tree T;
[0029] (12);
[0030] Finally, Equation 13 provides the test instructions. transmission path The effect path of malicious instructions simulated for explicit testing within the GPU kernel; where, the effect path... The starting node is the test command. Injection location The terminating node is the root node of the kernel execution tree T. Any two adjacent nodes in the effective path satisfy Equation 14, that is, the previous node The destination operand equals the next node The source operand, and is an associated instruction in the original tree model T;
[0031] (13);
[0032] (14);
[0033] Step 5: Dynamically load the kernel from Steps 1 to 4 above to assess the vulnerability of the test kernel to potential malicious instruction attacks.
[0034] Furthermore, the structure of the generated network in step 3 is as follows:
[0035] A generative adversarial network (GAN) model is trained to generate test commands to simulate potentially malicious commands; the GAN model consists of a generator G and a discriminator D, such as... Figure 3 As shown;
[0036] The generator G has a three-layer structure, with an input layer... Receive a 100-dimensional noise vector that follows a Gaussian distribution. ;
[0037] Intermediate layer It is used to process instruction sequences, as shown in Equation 7; where, and They are and Intermediate layer output at any given time. and These are the parameter matrices of the intermediate layer. It is a bias parameter. It is the hyperbolic tangent function;
[0038] (7);
[0039] Output layer Generate test instructions according to formula 8. ,in It is the middle layer Output at any moment and These are the parameter matrix and bias of the output layer, respectively;
[0040] (8);
[0041] Discriminator D has a three-layer structure, including the input layer. Accept test instructions generated by the generator or actual GPU kernel instructions ;
[0042] Intermediate layer Two-dimensional feature vectors used to extract input instructions As shown in Equation 9, where It's an input command, an input command. The type is either a test command or a real command. and These are the parameter matrix and bias of the intermediate layer, respectively. It is the hyperbolic tangent function;
[0043] (9);
[0044] Output layer Calculate the two-dimensional probability vector of whether the input command is a test command or a real command according to Equation 10. ,in It is a two-dimensional feature vector output by the intermediate layer;
[0045] (10).
[0046] Furthermore, the training method for the generator network in step 3 is as follows:
[0047] The training method for the generative network is shown in Equation 11, where D and G are the discriminator and generator, respectively. It is a loss function. and These are Gaussian noise input to the generator and real instruction samples, respectively. The discriminator D determines the true instruction sample. The probability of a real instruction. The generator G is based on the input The generated test instruction sample, The discriminator D judges the test instruction sample. The probability of a real instruction. It is the mathematical expectation;
[0048] (11);
[0049] After training, the parameter matrix and bias of each of the above layers are obtained, enabling the generator G to generate valid test instructions. .
[0050] The specific method for step 5 is as follows:
[0051] The kernel containing the test instructions injected in the previous step is dynamically loaded into the GPU for execution. First, a kernel dynamic loading function is designed, which integrates the above four steps and has the same function interface as the kernel loading function provided by the GPU manufacturer.
[0052] Then, the function is compiled using the compiler provided by the GPU manufacturer, and it is encapsulated into a dynamic library using the command "-shared", so that the entire vulnerability testing method has the same calling method as the native kernel loading function; next, the operating system's dynamic library preloading environment variable ld_preload is modified, and the path of the encapsulated dynamic library is assigned to ld_preload, so that the system will call the vulnerability testing method first when the GPU application runs.
[0053] Finally, when the GPU application calls the kernel loading function, it automatically injects test instructions into the GPU kernel for execution. The output of these test instructions will propagate to the final result of the kernel execution, thereby assessing the vulnerability of the test kernel to potential malicious instruction attacks. If the test instructions have no effect on the kernel execution result, the GPU kernel does not have any security risks; otherwise, there are security risks, and the kernel needs to be verified and hardened.
[0054] This invention proposes a vulnerability assessment method for GPU kernel instructions. The method models the instruction execution process of the GPU kernel, trains a generative adversarial network (GAN) to generate test instructions simulating malicious commands, and injects these instructions into the kernel under test. Finally, the kernel is dynamically loaded onto the GPU for execution, and the impact of the test instructions on the kernel is observed to determine whether the kernel has any security vulnerabilities. This invention can effectively analyze the vulnerabilities in GPU kernels, i.e., their robustness against malicious instruction attacks, providing a powerful security analysis tool for high-performance parallel trusted computing on GPUs. Attached Figure Description
[0055] Figure 1 This is a flowchart of a vulnerability analysis method for GPU kernels.
[0056] Figure 2 This is a flowchart for extracting kernel instructions.
[0057] Figure 3 The architecture for generating adversarial networks. Figure 4 This is a schematic diagram for tumor region segmentation and identification. Detailed Implementation
[0058] In this embodiment, the GPU is specifically an NVIDIA GTX 1050 Ti, with CUDA driver version 13.0, and the operating system is Linux Ubuntu 2022. The GPU kernel under test implements a medical image processing example, capable of segmenting and identifying tumor regions, such as... Figure 4 As shown in (a) and (b), the vulnerability testing method injects the ISETP instructions generated by the generator into the GPU kernel under test and dynamically loads them onto the GPU for execution. The generated ISETP test instructions tamper with the original image threshold segmentation threshold parameter from 0xe5 to 0xfe, and then propagate the tampered threshold parameter to the final result, ultimately leading to errors in tumor region identification, such as... Figure 4 As shown in (c). Therefore, it can be concluded that the ISETP instruction affected the kernel execution results, and the GPU kernel under test has a vulnerability and security risk.
[0059] The vulnerability analysis process for GPU kernel instructions is as follows: Figure 1 As shown, it includes the following 5 steps, each corresponding to a number in the diagram:
[0060] Step 1: Kernel Instruction Extraction
[0061] The process of extracting kernel instructions is as follows: Figure 2 As shown in Equation 1, the GPU kernel file consists of four parts: the header (ehead), sections, the section header table (shead), and the program header table (phead). The section header table offset (e_shoff) and the number of section header table entries (e_shnum) in the header (ehead) indicate the location of the section header table (shead) and the number of section header table entries in it, respectively. The section header table (shead) contains e_shnum entries, along with the type (sh_type) and size (sh_size) of each entry. The type of each entry is identified sequentially. When the type (sh_type) equals "0x1", the corresponding offset address (sh_offset) in the section header table entry is the location (ins_addr) where the kernel instruction I is stored, as shown in Equation 1. It is important to note that there is only one section header table entry in the kernel containing the offset address (sh_offset) of the instruction. Finally, the instruction I, with a length of sh_size bytes, is read from the kernel instruction address (ins_addr).
[0062] (1);
[0063] Step 2: Instruction Execution Modeling
[0064] The format of GPU instruction I is shown in Equation 2, where opcode is the opcode of assembly instruction I, indicating the operation type of the instruction; the first operand dest is the destination operand, used to store the operation result; and the second operand src is the source operand, used to store the input data.
[0065] (2);
[0066] First, locate the kernel's memory type instruction I. st And use it as the root node T of the directed tree T. root As shown in Equation 3.
[0067] (3);
[0068] Then search for the storage instruction I. st Proximity association instruction I r The definition of proximity association is: within the kernel, the distance I from the current instruction... st Recent instructions, and I r The destination operand is the current instruction I st The source operands are shown in Equation 4. Indicate I st The source operand, Indicate I r The target operand, This indicates that the distance between two instructions in the kernel file is calculated.
[0069] (4);
[0070] Finally, connect I with a directed edge. st and I r , by I r Point to I st As shown in Equation 5. Simultaneously, As a new leaf node of tree T As shown in Equation 6.
[0071] (5);
[0072] (6);
[0073] Search and connect to leaf node T leaf Adjacent related instructions and will As a new leaf node. If the instruction If it is a load type instruction, then stop the growth of tree T. Otherwise, continue searching and connecting with leaf nodes T. leaf The next associated instruction.
[0074] Step 3: Generate network training
[0075] A generative adversarial network (GAN) model is trained to generate test commands to simulate potentially malicious commands. The GAN model consists of a generator G and a discriminator D, such as... Figure 3 As shown.
[0076] The generator G has a three-layer structure, with an input layer... Receive a 100-dimensional noise vector that follows a Gaussian distribution. Intermediate layer It is used to process instruction sequences, as shown in Equation 7. Wherein, and They are and Intermediate layer output at any given time. and These are the parameter matrices of the intermediate layer. It is a bias parameter. It is the hyperbolic tangent function.
[0077] (7);
[0078] Output layer Generate test instructions according to formula 8. ,in It is the middle layer Output at any moment and These are the parameter matrix and bias of the output layer, respectively.
[0079] (8);
[0080] Discriminator D has a three-layer structure, including the input layer. Accept test instructions generated by the generator or actual GPU kernel instructions Intermediate layer Two-dimensional feature vectors used to extract input instructions As shown in Equation 9, where It is the input command (type either test command or real command, used here). (collective term) and These are the parameter matrix and bias of the intermediate layer, respectively. It is the hyperbolic tangent function.
[0081] (9);
[0082] Output layer Calculate the two-dimensional probability vector of whether the input command is a test command or a real command according to Equation 10. ,in It is a two-dimensional feature vector output by the intermediate layer.
[0083] (10);
[0084] The training method for the generative network is shown in Equation 11, where D and G are the discriminator and generator, respectively. It is a loss function. and These are Gaussian noise input to the generator and real instruction samples, respectively. The discriminator D determines the true instruction sample. The probability of a real instruction. The generator G is based on the input The generated test instruction sample, The discriminator D judges the test instruction sample. The probability of a real instruction. It is the mathematical expectation.
[0085] (11);
[0086] After training, the parameter matrix and bias of each layer can be obtained, enabling the generator G to generate valid test instructions. .
[0087] Step 4: Test instruction injection
[0088] In the instruction tree T modeled in step (2), an instruction node is randomly selected as a vulnerability test node in a uniform distribution. Then the test instructions generated in step (3) Injected into the instruction tree T generated by the GPU kernel, the injection location is... As shown in Equation 12. Represents the instruction tree T node," "Indicates that the test command will be executed" Connect to tree T.
[0089] (12);
[0090] Finally, Equation 13 provides the test instructions. transmission path This is used to explicitly demonstrate the effect path of malicious instructions simulated in the GPU kernel during testing. The effect path... The starting node is the test command. Injection location The terminating node is the root node of the kernel execution tree T. Any two adjacent nodes in the effective path satisfy Equation 14, that is, the previous node The destination operand equals the next node The source operand, and is an associated instruction in the original tree model T.
[0091] (13);
[0092] (14);
[0093] Step 5: Dynamic kernel loading
[0094] The kernel containing the test instructions injected in the previous step is dynamically loaded into the GPU for execution. First, a kernel dynamic loading function is designed, integrating the four steps described above, and ensuring that this function has the same interface as the kernel loading function provided by the GPU manufacturer.
[0095] Then, the function is compiled using the compiler provided by the GPU manufacturer, and it is encapsulated into a dynamic library using the command "-shared". This makes the entire vulnerability testing method have the same calling style as the native kernel loading function. Next, the operating system's dynamic library preloading environment variable ld_preload is modified, and the path of the encapsulated dynamic library is assigned to ld_preload, so that the system will call this vulnerability testing method first when the GPU application runs.
[0096] Finally, when the GPU application calls the kernel loading function, test instructions are automatically dynamically injected into the GPU kernel for execution. The output of these test instructions propagates to the final result of the kernel execution, thereby assessing the vulnerability of the test kernel to potential malicious instruction attacks. If the test instructions have no impact on the kernel execution result, the GPU kernel has no security risks; otherwise, there are security risks, and the kernel needs to be verified and hardened.
Claims
1. A vulnerability assessment method for GPU kernel instructions, the method comprising: Step 1: Extract kernel instructions; Step 1.1: Locate the offset address of the section header table based on the header information; Step 1.2: Identify each entry in the section header table; Step 1.3: Determine if the type of the section header entry is 0x1. If yes, proceed to step 1.4; otherwise, perform the determination here. Step 1.4: Locate the instruction based on the offset address of the section header entry; Step 1.5: Extract instructions from the kernel; The GPU kernel file consists of four parts: header (ehead), sections, header table (shead), and program header table (phead). The header (ehead) contains header table offsets (e_shoff and e_shnum), indicating the location and number of header table entries in the header table (shead). The header table (shead) contains e_shnum entries, each with a type (sh_type) and size (sh_size). The type of each entry is identified sequentially. When the type (sh_type) equals "0x1", the corresponding offset address (sh_offset) in the header table entry is the location (ins_addr) where the kernel instruction I is stored, as shown in Equation 1. Only one header table entry in the kernel contains the offset address (sh_offset) of the instruction. Finally, the instruction I, with a length of sh_size bytes, is read from the kernel instruction address (ins_addr). (1); Step 2: Instruction execution modeling; The format of GPU instruction I is shown in Equation 2, where opcode is the opcode of assembly instruction I, indicating the operation type of the instruction; the first operand dest is the destination operand, used to store the operation result; and the second operand src is the source operand, used to store the input data. (2); First, locate the kernel's memory type instruction I. st And use it as the root node T of the directed tree T. root As shown in Equation 3; (3); Then search for the storage instruction I. st Proximity association instruction I r The definition of proximity association is: within the kernel, the distance I from the current instruction... st Recent instructions, and I r The destination operand is the current instruction I st The source operands are shown in Equation 4; where Indicate I st The source operand, Indicate I r The target operand, This indicates that the distance between two instructions in the kernel file is calculated. (4); Finally, connect I with a directed edge. st and I r , by I r Point to I st As shown in Equation 5; at the same time, As a new leaf node of tree T As shown in Equation 6; (5); (6); Search and connect to leaf node T leaf Adjacent related instructions and will As a new leaf node; if the instruction If it is a load type instruction, then stop the growth of tree T; otherwise, continue searching and connecting with leaf nodes T. leaf The next associated instruction; Step 3: Build and train a generative network to produce test instructions; Step 4: Test instruction injection; In the instruction tree T modeled in step 2, an instruction node is randomly selected as a vulnerability test node in a uniform distribution. ; Then the test instructions generated in step 3 Injected into the instruction tree T generated by the GPU kernel, the injection location is... As shown in Equation 12; where Represents the instruction tree T node," "Indicates that the test command will be executed" Connect to tree T; (12); Finally, Equation 13 provides the test instructions. transmission path The effect path of malicious instructions simulated for explicit testing within the GPU kernel; where, the effect path... The starting node is the test command. Injection location The terminating node is the root node of the kernel execution tree T. Any two adjacent nodes in the effective path satisfy Equation 14, that is, the previous node The destination operand equals the next node The source operand, and is an associated instruction in the original tree model T; (13); (14); Step 5: Dynamically load the kernel from Steps 1 to 4 above to assess the vulnerability of the test kernel to potential malicious instruction attacks.
2. The vulnerability assessment method for GPU kernel instructions as described in claim 1, characterized in that, The structure of the generated network in step 3 is as follows: A generative adversarial network (GAN) model is trained to generate test commands to simulate potential malicious commands; the GAN model consists of a generator G and a discriminator D. The generator G has a three-layer structure, with an input layer... Receive a 100-dimensional noise vector that follows a Gaussian distribution. ; Intermediate layer It is used to process instruction sequences, as shown in Equation 7; where, and They are and Intermediate layer output at any given time. and These are the parameter matrices of the intermediate layer. It is a bias parameter. It is the hyperbolic tangent function; (7); Output layer Generate test instructions according to formula 8. ,in It is the middle layer Output at any moment and These are the parameter matrix and bias of the output layer, respectively; (8); Discriminator D has a three-layer structure, including the input layer. Accept test instructions generated by the generator or actual GPU kernel instructions ; Intermediate layer Two-dimensional feature vectors used to extract input instructions As shown in Equation 9, where It's an input command, an input command. The type is either a test command or a real command. and These are the parameter matrix and bias of the intermediate layer, respectively. It is the hyperbolic tangent function; (9); Output layer Calculate the two-dimensional probability vector of whether the input command is a test command or a real command according to Equation 10. ,in It is a two-dimensional feature vector output by the intermediate layer; (10)。 3. The vulnerability assessment method for GPU kernel instructions as described in claim 1, characterized in that, The training method for the generator network in step 3 is as follows: The training method for the generative network is shown in Equation 11, where D and G are the discriminator and generator, respectively. It is a loss function. and These are Gaussian noise input to the generator and real instruction samples, respectively. The discriminator D determines the true instruction sample. The probability of a real instruction. The generator G is based on the input The generated test instruction sample, The discriminator D judges the test instruction sample. The probability of a real instruction. It is the mathematical expectation; (11); After training, the parameter matrix and bias of each of the above layers are obtained, enabling the generator G to generate valid test instructions. .
4. The vulnerability assessment method for GPU kernel instructions as described in claim 1, characterized in that, The specific method for step 5 is as follows: The kernel containing the test instructions injected in the previous step is dynamically loaded into the GPU for execution. First, a kernel dynamic loading function is designed, which integrates the above four steps and has the same function interface as the kernel loading function provided by the GPU manufacturer. Then, the function is compiled using the compiler provided by the GPU manufacturer, and it is encapsulated into a dynamic library using the command "-shared", so that the entire vulnerability testing method has the same calling method as the native kernel loading function; next, the operating system's dynamic library preloading environment variable ld_preload is modified, and the path of the encapsulated dynamic library is assigned to ld_preload, so that the system will call the vulnerability testing method first when the GPU application runs. Finally, when the GPU application calls the kernel loading function, it will automatically dynamically inject test instructions into the GPU kernel for execution. The output of these test instructions will be propagated to the final result of the kernel execution, thereby assessing the vulnerability of the test kernel to potential malicious instruction attacks. If the test instructions have no effect on the kernel execution results, then the GPU kernel does not have any security vulnerabilities; otherwise, there are security risks, and the kernel needs to be verified and hardened.