Method and device for verifying integrity of power distribution network terminal based on memory access control
By adopting a memory access control-based method in the distribution network terminal system, kernel integrity and control flow integrity verification are solved, and the problem of the operating system of the distribution network terminal is vulnerable to attacks is significantly improved.
Patent Information
- Application Number
- CN202411753939.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-12-02
AI Technical Summary
The existing technology lacks effective security verification methods, which makes the distribution network terminal operating systems susceptible to malware and attacks, threatening the security, stability and reliability of smart distribution network systems.
Using a memory access control method, kernel integrity and control flow integrity verification are achieved by modifying the HVC exception entry in the processor exception vector table to point to the HVC exception handler. The specific steps include calculating the hash value of the kernel code segment at startup and performing kernel integrity detection when the number of events exceeds the threshold; verifying the legitimacy of the control flow by obtaining the legal jump whitelist of the objective function.
It effectively improves the security, stability and reliability of the distribution network terminal system, prevents unauthorized kernel modifications and malicious program implantation, reduces the risk of control flow hijacking attacks, and protects core business and key data.
Smart Images

Figure CN119598474A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent distribution network security detection, and in particular to a distribution network terminal integrity verification method and device based on memory access control. Background Art
[0002] Smart grid integrates two-way high-speed communication network technology and computer-based automation and distributed control technology to achieve intelligent energy management. As the core component of smart grid, smart distribution network deploys a large number of intelligent terminals and realizes two-way communication between distribution network terminals and distribution network master stations based on multiple communication methods. However, the integration of communication network and distribution network will lead to new security issues, making the massive distribution network terminals potentially vulnerable to security risks. At present, the frequency of cyber attack security incidents is increasing, and the variability, concealment, targeting and persistence of attacks are also increasing. Distribution network terminals are important equipment that directly connects with consumers. If they are attacked by cyber attacks, their chain failures may lead to large-scale power outages and directly endanger other key infrastructure such as finance, energy, communications, and transportation.
[0003] At present, the software stack of distribution network terminals is usually built on the basis of open source Linux or other RTOS. Due to the huge amount of code, these operating systems are prone to a large number of security vulnerabilities due to human negligence. In addition, the distribution network terminals are set in an open environment. Attackers can exploit vulnerabilities to tamper with the operating system kernel to implant malicious programs, or modify the program execution path to run malicious code. There is currently a lack of security verification methods for distribution network terminals, which will seriously threaten the safe, stable and reliable operation of smart distribution network systems and even smart grid systems. Summary of the invention
[0004] The technical problem to be solved by the present invention is: in response to the technical problems existing in the prior art, the present invention provides a distribution network terminal integrity verification method and device based on memory access control, which has a simple implementation method, low cost, high security, stability and reliability, and can protect the kernel integrity to prevent the terminal operating system from being subjected to malware and attacks, while protecting the terminal system from running according to a predetermined control process, effectively improving the overall security, stability and reliability of the terminal system.
[0005] In order to solve the above technical problems, the technical solution proposed by the present invention is: A method for verifying the integrity of a distribution network terminal based on memory access control, comprising the following steps: Modify the HVC exception entry corresponding to the exception vector table in the distribution network terminal processor so that the corresponding HVC exception handling program is executed; The HVC exception handling program controls the start of kernel integrity verification of the distribution network terminal system or the start of control flow integrity verification of the distribution network terminal system according to the parameter value of the general register X0; When starting the kernel integrity verification of the distribution network terminal system, the kernel integrity is verified by comparing the hash value calculated when starting the distribution network terminal system with the hash value calculated when the number of events generated by the kernel layer and the application layer exceeds a preset threshold; Start the control flow integrity verification of the distribution network terminal system by obtaining the legal jump whitelist of the target function and matching the source address value of the current jump with the legal jump whitelist to verify the control flow integrity.
[0006] Further, the HVC exception handling program starts the kernel integrity verification or control flow integrity verification of the distribution network terminal system according to the general register X0 parameter value, including: Read the parameter value of general register X0 and make a judgment; If the parameter is integrity_param, the kernel integrity verification is performed on the distribution network terminal system, where integrity_param is the parameter passed into register X0 after the distribution network terminal system is started and the HVC exception is triggered; If the parameter is control_param, the control flow integrity verification is performed on the distribution network terminal system, where control_param is the parameter passed to the general register X0 when the target function is called and the HVC exception is triggered.
[0007] Furthermore, the core integrity verification of the distribution network terminal system includes: When the distribution network terminal system is started, according to the kernel code segment length and the kernel code segment start address set in the distribution network terminal system configuration file, the first hash value startHashValue of the entire kernel code segment is calculated and saved in the trusted execution environment; Monitor the events generated by the kernel layer and the application layer. When the cumulative value of the number of events exceeds the preset threshold, the kernel integrity detection is triggered, and the second hash value eventHashValue of the kernel code segment at the current moment is calculated in the trusted execution environment; The second hash value eventHashValue is compared with the first hash value startHashValue. If the comparison is consistent, it is determined that the kernel integrity verification has passed; otherwise, it is determined that the kernel integrity verification has failed.
[0008] Furthermore, the events generated by the kernel layer and the application layer include any one or more events of context switching, system call and interrupt processing.
[0009] Furthermore, the second hash value eventHashValue is compared with the first hash value startHashValue. If the comparison is consistent, the accumulated value of the number of events is cleared. If the comparison is inconsistent, the system operation is interrupted.
[0010] Furthermore, the control flow integrity verification of the distribution network terminal system includes: Get the target function's legal jump whitelist in advance; After starting the control flow integrity verification, the source address value of the current jump is obtained and matched with the legal jump whitelist. If they match, it is determined that the control flow integrity verification has passed, otherwise it is determined that the control flow integrity verification has failed.
[0011] Furthermore, the step of obtaining a legal jump whitelist of the target function includes: Decompile the kernel source code of the distribution network terminal system and obtain the first address of the target function; Configure the target function's first address into the distribution network terminal system; Repeatedly run the target function and collect the distribution network terminal system log information during the operation for analysis, and obtain the legal jump whitelist of the target function according to the analysis results; The obtained legal jump whitelist is configured into the distribution network terminal system.
[0012] Furthermore, when it is determined that there is a mismatch, it is determined that there is a risk of control flow hijacking, the current jump is an illegal jump, and the security protection process is executed. The security protection process includes recording the timestamp and context information of the current event, and deciding whether to interrupt the system operation or continue to run the system after isolating the affected part according to the preset strategy.
[0013] A computer device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.
[0014] A computer-readable storage medium storing a computer program, wherein the computer program implements the above method when executed by a processor.
[0015] Compared with the prior art, the advantages of the present invention are: 1. The present invention implements kernel integrity verification of the distribution network terminal system by adopting an event-based kernel integrity verification method. The hash value of the kernel code segment is calculated at startup and saved in a trusted execution environment to ensure that the distribution network terminal system is in a trusted state from the beginning. In the subsequent system operation process, when the number of events generated by the kernel layer and the application layer exceeds a set threshold, the kernel integrity detection is triggered to determine whether the kernel integrity is destroyed, that is, whether it is complete, thereby preventing unauthorized kernel modification, system crash caused by malicious program implantation, data damage or loss, etc., and effectively improving the security, stability and reliability of the distribution network terminal system.
[0016] 2. The present invention implements control flow integrity verification by adopting a whitelist-based control flow integrity verification method. By comparing the target function's legal jump whitelist, it ensures that the system runs according to a predefined control flow, so that the program is executed based on a predefined legal path, thereby effectively reducing the attack surface of the system and avoiding control flow hijacking attacks such as return-oriented programming attacks, jump-oriented programming attacks, and stack-oriented programming attacks.
[0017] 3. The present invention realizes the integrity verification of the distribution network terminal system from two aspects: kernel integrity verification and control flow verification. It can comprehensively strengthen the defense of the distribution network terminal against malicious attacks or intrusions, effectively improve the ability of the distribution network terminal system to prevent malware injection and resist control flow hijacking attacks, reduce the risks and losses caused by terminal security vulnerabilities, and effectively protect core businesses and key data. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart for implementing the method for verifying the integrity of a distribution network terminal based on memory access control in this embodiment.
[0019] Figure 2 The figure is a schematic diagram of the execution flow of the exception handling program in a specific application embodiment of the present invention.
[0020] Figure 3 The figure is a detailed implementation flow chart of kernel integrity verification in a specific application embodiment of the present invention.
[0021] Figure 4 The figure is a detailed implementation flow chart of the control flow integrity verification in a specific application embodiment of the present invention. DETAILED DESCRIPTION
[0022] The present invention is further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the protection scope of the present invention is not limited thereby.
[0023] The present invention is aimed at the integrity verification of the distribution network terminal. It verifies from two aspects: kernel integrity verification and control flow verification. For the kernel integrity verification, an event-based kernel integrity verification method is adopted. By calculating the hash value of the kernel code segment at startup and saving it in a trusted execution environment (TEE), it is ensured that the distribution network terminal system is in a trusted state from the beginning stage. In the subsequent system operation process, when the number of events generated by the kernel layer and the application layer exceeds a set threshold, the kernel integrity detection is triggered to determine whether the kernel integrity is destroyed, that is, whether it is complete, so as to prevent unauthorized kernel modification, system crash caused by malicious program implantation, data damage or loss, etc., and effectively improve the security, stability and reliability of the distribution network terminal system; for the control flow integrity verification, a whitelist-based control flow integrity verification method is adopted. By comparing the legal jump whitelist of the target function, it is ensured that the system runs according to the predefined control flow, so that the program is executed based on the predefined legal path, thereby effectively reducing the attack surface of the system and avoiding control flow hijacking attacks such as return-oriented programming attacks, jump-oriented programming attacks and stack-oriented programming attacks.
[0024] like Figure 1 As shown, the steps of the distribution network terminal integrity verification method based on memory access control in this embodiment include: Step S01. Modify the HVC exception entry corresponding to the exception vector table in the distribution network terminal processor to execute the corresponding HVC exception handler, which starts the kernel integrity verification of the distribution network terminal system or starts the control flow integrity verification of the distribution network terminal system according to the parameter value of the general register X0.
[0025] In this embodiment, the HVC exception handler is a pre-program for kernel integrity verification or control flow integrity verification, and the HVC exception entry corresponding to the exception vector table in the distribution network terminal processor is modified to point to a newly constructed HVC exception handler. The HVC exception handler can be used to control the start of kernel integrity calculation or control flow integrity verification. For example, the program can be configured as follows: first read the parameter value of the general register X0, and then perform parameter matching. If the matching result is E1 (i.e., integrity_param), kernel integrity calculation is performed; if the matching result is E2 (i.e., control_param), control flow integrity verification is started.
[0026] In this embodiment, the steps of starting the kernel integrity verification or control flow integrity verification of the distribution network terminal system according to the parameter value of the general register X0 by the HVC exception handling program include: Step S101. Read the parameter value of general register X0 and make a judgment; Step S102. If the parameter is integrity_param, the kernel integrity verification is performed on the distribution network terminal system, wherein integrity_param is a parameter passed into register X0 after the distribution network terminal system is started and the HVC exception is triggered; Step S103: If the parameter is control_param, the control flow integrity verification is performed on the distribution network terminal system, where control_param is the parameter passed to the general register X0 when the target function is called and the HVC exception is triggered.
[0027] In a specific application embodiment, Figure 2 As shown, the HVC exception entry in the exception vector table is stored at memory location 0x00000008, and the new HVC exception handler it points to first reads the parameter value of the general register X0, then performs parameter matching, and finally, based on the parameter matching result, if the parameter match is integrity_param, then the kernel complete calculation is performed; if the parameter match is control_param, then the control flow integrity verification is performed. Specifically, when the distribution network terminal system is started, the HVC exception is triggered, the parameter integrity_param is passed to the general register X0, the system exception handler is executed, and the kernel integrity calculation is started; when the target function is called, the HVC exception is triggered, the parameter control_param is passed to the general register X0, and the system exception handler is executed to start the control flow integrity verification.
[0028] In a specific application embodiment, modifying the HVC exception entry in the exception vector table may be implemented using the following pseudo code: / / HVC exception entry in the exception vector table void* hvc_vector_entry = (void*)0x00000008; / / Modify the HVC exception entry in the exception vector table void modify_exception_vector_table(void) { / / Modify the HVC exception entry to point to the handle_hvc_exception function *(uint64_t*)hvc_vector_entry = (uint64_t)&handle_hvc_exception; } A simple pseudo code for writing an exception handler is: / / Function to handle HVC exceptions void handle_hvc_exception(void) { / / Read the value of the X0 register uint64_t param = __builtin_aarch64_read_x0(); / / Perform corresponding operations according to the parameters switch(param) { case param is integrity_param; integrity_computation(); break; case param is control_param; control_check(); break; default: break; } } Step S02. When starting the kernel integrity verification of the distribution network terminal system, the kernel integrity is verified by comparing the hash value calculated when starting the distribution network terminal system with the hash value calculated when the number of events generated by the kernel layer and the application layer exceeds a preset threshold.
[0029] This embodiment implements the core integrity verification of the distribution network terminal system based on events, and the steps include: Step S201. When the distribution network terminal system is started, according to the kernel code segment length and the kernel code segment start address set in the distribution network terminal system configuration file, the first hash value startHashValue of the entire kernel code segment is calculated and saved in the trusted execution environment; Step S202. Monitor the events generated by the kernel layer and the application layer (such as context switching, system calls, and interrupt processing, etc.). When the cumulative value of the number of events exceeds a preset threshold, trigger the kernel integrity detection and calculate the second hash value eventHashValue of the kernel code segment at the current moment in the trusted execution environment (TEE); Step S203: Compare the second hash value eventHashValue with the first hash value startHashValue. If the comparison is consistent, it is determined that the kernel integrity verification has passed; otherwise, it is determined that the kernel integrity verification has failed.
[0030] This embodiment calculates the hash value of the kernel code segment at startup and saves it in a trusted execution environment, so as to ensure that the distribution network terminal system is in a trusted state from the beginning. At the same time, in the subsequent system operation process, by monitoring the number of events generated by the kernel layer and the application layer, the kernel integrity detection is triggered when the cumulative value of the number of events exceeds the set threshold, so as to effectively determine whether the kernel integrity is destroyed, prevent unauthorized kernel modification, system crash, data damage or loss caused by malicious program implantation, etc., and by regularly verifying the kernel integrity of the terminal system in the above manner, potential threats can be discovered in time and corresponding countermeasures can be taken, thereby effectively improving the security, stability and reliability of the distribution network terminal system.
[0031] In this embodiment, when the second hash value eventHashValue is compared with the first hash value startHashValue, if the comparison is consistent, the cumulative value of the number of events is cleared, and if the comparison is inconsistent, the system operation is interrupted to ensure the safety of the system operation.
[0032] The following takes the implementation of kernel integrity verification in a specific application embodiment as an example to further illustrate the kernel integrity verification method of the present invention. Figure 3 As shown, the specific steps include: (1) Start the distribution network terminal system, trigger the HVC exception, pass the parameter integrity_param to the general register X0, execute the system exception handler, start the kernel integrity calculation, and complete the hash value calculation of the entire kernel code segment according to the kernel code segment length and kernel code segment starting address set in the distribution network terminal system configuration file. The hash function sha256() in the automation tool is used to assist in the calculation of the hash value of the entire kernel code segment to obtain the first hash value startHashValue. The calculated value is saved in the trusted execution environment (TEE); (2) The performance monitoring unit (PMU) monitors events such as context switching, system calls, and interrupt processing generated by the kernel layer and the application layer. When the cumulative number of events exceeds a preset threshold (e.g., 1000), kernel integrity verification is triggered. (3) When performing kernel integrity verification, the hash value eventHashValue of the kernel code segment at the current moment is calculated in the trusted execution environment (TEE), and compared with the hash value startHashValue calculated when the distribution network terminal system is started. If exentHashValue = startHashValue, it means that the kernel integrity detection has passed, the kernel is judged to have integrity, and the cumulative value of the number of events is cleared to zero; if eventHashValue != startHashValue, it means that the kernel integrity is destroyed, the detection fails, and the kernel integrity is judged to be destroyed. The distribution terminal system will terminate its operation.
[0033] By combining the hardware devices such as the performance monitoring unit (PMU) and so on, the kernel integrity detection and verification of the collaborative work of software and hardware can be realized, providing more comprehensive and effective security protection for the distribution network terminals.
[0034] Step S03: Start the control flow integrity verification of the distribution network terminal system by obtaining the legal jump whitelist of the target function and matching the source address value of the current jump with the legal jump whitelist to verify the control flow integrity.
[0035] Based on the kernel integrity verification, this embodiment can effectively prevent various control flow attacks by focusing on control flow integrity verification of system programs, ensure that the execution path of the system is effectively protected, and thus provide information security protection for the stable and reliable operation of smart distribution networks and smart grids.
[0036] In this embodiment, the steps of verifying the control flow integrity of the distribution network terminal system include: Step S301. Pre-acquire a legal jump whitelist of the target function; Step S302: After starting the control flow integrity verification, obtain the source address value of the current jump and match it with the legal jump whitelist. If they match, it is determined that the control flow integrity verification has passed, otherwise it is determined that the control flow integrity verification has failed.
[0037] This embodiment can ensure that the system runs according to the predefined control flow by comparing the target function's legal jump whitelist, so that the program is executed based on the predefined legal path, thereby effectively reducing the attack surface of the system and avoiding control flow hijacking attacks such as return-oriented programming attacks, jump-oriented programming attacks, and stack-oriented programming attacks.
[0038] In this embodiment, the step of obtaining the legal jump whitelist of the target function in step S301 includes: Step S311. Decompile the kernel source code of the distribution network terminal system, and search and obtain the first address of the target function based on the decompilation result; Step S312. Configure the target function first address into the distribution network terminal system; Step S313. repeatedly run the target function and collect the distribution network terminal system log information during the operation for analysis, and obtain the legal jump whitelist of the target function according to the analysis results; Step S314: configure the obtained legal jump whitelist into the distribution network terminal system.
[0039] Read the LR register (connection register) to obtain the source address value of the current jump, compare the value with the control flow legal whitelist information one by one, and determine whether there is a control flow hijacking risk based on the matching results.
[0040] The following takes the control flow integrity verification in a specific application embodiment as an example to further illustrate the control flow integrity verification method of the present invention. Figure 4 As shown, the specific steps include: (1) Decompile the kernel source code of the distribution network terminal system using decompilation tools such as IDA pro, Ghidra, and Radare2. Search for target functions based on the decompilation results, such as open(), read(), write(), fork(), execve(), and malloc(), and obtain the first address of the target function. (2) The target function's first address is configured into the distribution network terminal system through a JSON file. The configuration is completed based on an automated tool. (3) Repeatedly run the target function, and obtain the legal jump whitelist of the target function by collecting, parsing and monitoring the distribution network terminal system log information. For example, the whitelist is in the form of an address list of 0x11335577, 0x22446688, and 0x12345678; (4) The collected legal whitelist information is configured in the distribution network terminal system using a JSON file. The configuration is completed based on an automated tool. (5) Modify the target function source code and replace the nop instructions in the source code with HVC instructions. Figure 4 As shown, when modifying the target function source code, the nop instruction of "97f6e9f9 bl<_mcount>" is modified to the hvc instruction of "d4000002 hvc#0x0".
[0041] (6) The target function is called to trigger the HVC exception. The corresponding parameter E2 (i.e., control_param) is passed into the general register X0. The exception handler corresponding to the HVC exception entry in the exception vector table is executed. The program reads the parameter value of the general register X0 for parameter matching. The matching value is E2, which triggers the control flow integrity verification.
[0042] (7) When performing control flow integrity verification, read the LR register (connection register) to obtain the source address value of the current jump, compare the value with the legal whitelist information one by one, and determine whether there is a control flow hijacking risk based on the matching results.
[0043] If the verification shows that there is no risk of control flow hijacking, it means that this is a legal jump and the system will continue to run; if the verification shows that there is a risk of control flow hijacking, it means that this jump is an illegal jump and the security protection process is entered to ensure that the system's control flow remains within the legal path.
[0044] like Figure 4 As shown, when executing control flow integrity verification, the source address value 0x12345678 of the current jump is obtained by reading the LR register (connection register), and the value is compared with the legal whitelist information one by one. Since the address 0x12345678 is registered in the legal whitelist, it can be determined according to the matching result that there is no risk of control flow hijacking, which means that this is a legal jump and the system will continue to run.
[0045] In another optional embodiment, when it is judged that there is a control flow hijacking risk, the current jump is an illegal jump, and it also includes entering the execution of the security protection process. The security protection process includes recording the timestamp of the current event, the context information, and deciding whether to interrupt the system operation or continue to operate the system after isolating the affected part according to the preset strategy. It can also further send prompt warning information, such as notifying the system administrator in the form of text messages, phone calls, emails, etc. to handle it in time to ensure that the control flow of the system remains within the legal path. It can be understood that the security protection process can of course adopt other security protection strategies according to actual needs.
[0046] In another optional embodiment, the legal jump whitelist may be updated regularly to adapt to distribution network terminal system updates or emerging threats, or automated tools may be used to assist in hash value calculation, decompilation, whitelist generation, and JSON file configuration processes.
[0047] The invention discloses a method for verifying the integrity of a distribution network terminal based on memory access control. The method first modifies the HVC exception entry corresponding to the exception vector table in the distribution network terminal processor to point to an HVC exception handling program, which is a pre-program for kernel integrity verification or control flow integrity verification. When the kernel integrity verification is started, the kernel integrity calculation is started when the HVC exception is triggered by starting the distribution network terminal system. Events generated by the kernel layer and the application layer are monitored during the subsequent system operation. When the cumulative value of the number of events exceeds a preset threshold, the kernel integrity detection is triggered to judge the kernel integrity and then perform corresponding operations. When the control flow integrity verification is started, the legal jump white list of the target function is obtained by repeatedly running the target function. After the target function is called to trigger the HVC exception, the system exception handling program is executed, and the control flow integrity verification is started to perform corresponding operations according to the verification result. The method can comprehensively strengthen the defense of the distribution network terminal against malicious attacks or intrusions from the two aspects of kernel integrity and control flow integrity, effectively improve the ability of the distribution network terminal system to prevent malware injection and resist control flow hijacking attacks, reduce the risks and losses caused by terminal security vulnerabilities, effectively protect core businesses and key data, and provide information security protection for the safe and stable operation of the power system.
[0048] This embodiment further provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above method.
[0049] It is understandable that the above method of this embodiment can be executed by a single device, such as a computer or server, etc., and can also be applied to a distributed scenario and completed by multiple devices in cooperation with each other. In the case of a distributed scenario, one of the multiple devices can only execute one or more steps in the above method of this embodiment, and multiple devices interact to complete the above method. The processor can be implemented in the form of a general-purpose CPU, a microprocessor, an application-specific integrated circuit, or one or more integrated circuits, etc., for executing related programs to implement the above method of this embodiment. The memory can be implemented in the form of a read-only memory ROM, a random access memory RAM, a static storage device, and a dynamic storage device. The memory can store an operating system and other applications. When the above method of this embodiment is implemented by software or firmware, the relevant program code is stored in the memory and called and executed by the processor.
[0050] This embodiment further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above method is implemented.
[0051] Those skilled in the art should understand that the above-mentioned embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0052] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution of the present invention shall fall within the scope of protection of the technical solution of the present invention.
Claims
1. A method for verifying the integrity of a distribution network terminal based on memory access control, characterized in that the steps include: Modify the HVC exception entry corresponding to the exception vector table in the distribution network terminal processor so that the corresponding HVC exception handling program is executed; The HVC exception handling program controls the start of kernel integrity verification of the distribution network terminal system or the start of control flow integrity verification of the distribution network terminal system according to the parameter value of the general register X0; When starting the kernel integrity verification of the distribution network terminal system, the kernel integrity is verified by comparing the hash value calculated when starting the distribution network terminal system with the hash value calculated when the number of events generated by the kernel layer and the application layer exceeds a preset threshold; Start the control flow integrity verification of the distribution network terminal system by obtaining the legal jump whitelist of the target function and matching the source address value of the current jump with the legal jump whitelist to verify the control flow integrity.
2. The method for verifying the integrity of a distribution network terminal based on memory access control according to claim 1, characterized in that: The HVC exception handling program starts the kernel integrity verification or control flow integrity verification of the distribution network terminal system according to the general register X0 parameter value, including: Read the parameter value of general register X0 and make a judgment; If the parameter is integrity_param, the kernel integrity verification is performed on the distribution network terminal system, where integrity_param is the parameter passed into register X0 after the distribution network terminal system is started and the HVC exception is triggered; If the parameter is control_param, the control flow integrity verification is performed on the distribution network terminal system, where control_param is the parameter passed to the general register X0 when the target function is called and the HVC exception is triggered.
3. The method for verifying the integrity of a distribution network terminal based on memory access control according to claim 1, characterized in that: The core integrity verification of the distribution network terminal system includes: When the distribution network terminal system is started, according to the kernel code segment length and the kernel code segment start address set in the distribution network terminal system configuration file, the first hash value startHashValue of the entire kernel code segment is calculated and saved in the trusted execution environment; Monitor the events generated by the kernel layer and the application layer. When the cumulative value of the number of events exceeds the preset threshold, the kernel integrity detection is triggered, and the second hash value eventHashValue of the kernel code segment at the current moment is calculated in the trusted execution environment; The second hash value eventHashValue is compared with the first hash value startHashValue. If the comparison is consistent, it is determined that the kernel integrity verification has passed; otherwise, it is determined that the kernel integrity verification has failed.
4. The method for verifying the integrity of a distribution network terminal based on memory access control according to claim 3 is characterized in that: The events generated by the kernel layer and the application layer include any one or more events of context switching, system call and interrupt processing.
5. The method for verifying the integrity of a distribution network terminal based on memory access control according to claim 3 is characterized in that: The second hash value eventHashValue is compared with the first hash value startHashValue. If the comparison is consistent, the accumulated value of the number of events is cleared. If the comparison is inconsistent, the system operation is interrupted.
6. The method for verifying the integrity of a distribution network terminal based on memory access control according to any one of claims 1 to 5, characterized in that: The control flow integrity verification of the distribution network terminal system includes: Get the target function's legal jump whitelist in advance; After starting the control flow integrity verification, the source address value of the current jump is obtained and matched with the legal jump whitelist. If they match, it is determined that the control flow integrity verification has passed, otherwise it is determined that the control flow integrity verification has failed.
7. The method for verifying the integrity of a distribution network terminal based on memory access control according to claim 6, characterized in that: The step of obtaining a legal jump whitelist of the target function comprises: Decompile the kernel source code of the distribution network terminal system, and search and obtain the first address of the target function based on the decompilation result; Configure the target function's first address into the distribution network terminal system; Repeatedly run the target function and collect the distribution network terminal system log information during the operation for analysis, and obtain the legal jump whitelist of the target function according to the analysis results; The obtained legal jump whitelist is configured into the distribution network terminal system.
8. The method for verifying the integrity of a distribution network terminal based on memory access control according to claim 6, characterized in that: When it is judged as a mismatch, it is determined that there is a risk of control flow hijacking, the current jump is an illegal jump, and the security protection process is executed. The security protection process includes recording the timestamp and context information of the current event, and deciding whether to interrupt the system operation or continue to run the system after isolating the affected part according to the preset strategy.
9. A computer device comprising a processor and a memory, wherein the memory is used to store a computer program, wherein: The processor is configured to execute the computer program to perform the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Trusted computing terminal integrity measuring and proving method and device
CN105608386A
Kernel control flow anomaly detection method based on hardware mechanism
CN107506638A
Power distribution network safety risk assessment method and system based on strategy association
CN118378891A
Integrity verification system for boot process in linux and update and integrity verification method of managed machine
KR102111327B1
Data integrity protection method and related apparatus
WO2023104013A1