Method and apparatus for verifying integrity of firmware-based operating system kernel

By creating a baseline value during the operating system kernel initialization phase and running the verification logic independently in the firmware space, the security problem of kernel integrity verification is solved, ensuring that the kernel data integrity verification process is more secure and reliable.

CN116305082BActive Publication Date: 2026-05-29INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INSPUR SUZHOU INTELLIGENT TECH CO LTD
Filing Date
2023-02-02
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the integrity verification framework of the operating system kernel cannot effectively prevent malicious attacks on critical kernel data, and the verification logic and benchmark values ​​are stored in the kernel memory space, which is at risk of being maliciously attacked.

Method used

By calling the firmware's runtime services during the kernel initialization phase, baseline values ​​for critical data are created, and verification logic runs independently in the firmware space. The firmware is periodically called to perform integrity verification, ensuring that the integrity verification of kernel data is independent of the kernel space.

Benefits of technology

This makes the integrity verification process of the operating system kernel more secure and the verification results more reliable, avoiding the risk of the verification logic being hijacked after the kernel is maliciously attacked.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116305082B_ABST
    Figure CN116305082B_ABST
Patent Text Reader

Abstract

The application provides a firmware-based operating system kernel running integrity verification method and device, the method comprises the following steps: the kernel calls the first runtime service of the firmware, and creates the benchmark value of the key data based on the first runtime service; the kernel calls the second runtime service of the firmware, and closes the benchmark value creation of the firmware based on the second runtime service; the kernel calls the third runtime service of the firmware at a fixed time, sends the integrity verification request to the firmware, and the firmware verifies the integrity of the operating system kernel running based on the integrity verification request and the benchmark value of the integrity verification. The application divides the server into the firmware and the kernel, provides the runtime service of the kernel data integrity verification through the firmware, and the kernel data verification logic runs in the firmware space and is independent of the kernel space, so that the verification logic in the firmware cannot be hijacked after the kernel is maliciously attacked, therefore, the verification process is safer, and the verification result is more reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of server technology, and in particular to a method and apparatus for verifying the integrity of operating system kernel operation based on firmware. Background Technology

[0002] As malicious attack techniques continue to improve, operating system kernels also face malicious attacks or tampering. For example, system call table hijacking can replace existing system calls in the kernel with system calls containing listening logic, making user operations to read / write sensitive data insecure. While the operating system kernel itself has some security mechanisms to ensure its security, such as virtual memory permission control to prevent modification of critical kernel data and integrity checks, these mechanisms all rely on kernel logic. Once the kernel is maliciously attacked, attackers can disable or bypass these security mechanisms.

[0003] However, the kernel integrity verification framework only verifies the integrity of the program when the program file is loaded, and cannot verify the integrity of critical kernel data. Furthermore, the verification logic and the verification benchmark are both located in the kernel memory space, which is also vulnerable to malicious attacks.

[0004] Therefore, how to avoid risks caused by the storage location of verification logic and verification benchmark values ​​is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This invention provides a firmware-based method and apparatus for verifying the integrity of operating system kernel operation, thereby addressing the aforementioned deficiencies in the prior art, effectively preventing the operating system from being maliciously attacked, making the verification process more secure, and the verification results more reliable.

[0006] This invention provides an integrity verification method for operating system kernel execution based on firmware, comprising:

[0007] During the kernel initialization phase, the kernel invokes the firmware's first runtime service to create baseline values ​​for critical data based on the first runtime service.

[0008] Once the kernel initialization phase is complete, the kernel calls the firmware's second runtime service and disables the firmware's baseline value creation based on the second runtime service.

[0009] The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0010] According to the present invention, an integrity verification method for operating system kernel execution based on firmware is provided. During the kernel initialization phase, the kernel invokes a first runtime service of the firmware to create baseline values ​​for critical data based on the first runtime service, including:

[0011] During the kernel initialization phase, the kernel determines the data type of the critical data;

[0012] Based on the creation timing of key data of different data types, the first runtime service is called multiple times, and a baseline value for each key data is created based on each of the first runtime services.

[0013] According to the present invention, an integrity verification method for operating system kernel operation based on firmware includes, wherein the creation of a baseline value based on disabling the firmware using the second runtime service includes:

[0014] The execution status of the second runtime service is determined based on whether the target baseline value is set.

[0015] Once the second runtime service has completed execution, the creation of the firmware's baseline value is disabled.

[0016] The integrity verification method for operating system kernel operation based on firmware provided by the present invention further includes:

[0017] If the second runtime service has not been completed, continue executing the baseline value for creating the key data.

[0018] The integrity verification method for operating system kernel operation based on firmware provided by the present invention further includes:

[0019] The kernel calls the fourth runtime service of the firmware and initializes memory data based on the fourth runtime service;

[0020] The firmware clears the baseline value and resets the target baseline value, and verifies the restart logic to execute an operating system restart.

[0021] According to the present invention, an integrity verification method for operating system kernel operation based on firmware is provided, wherein the kernel periodically calls a third runtime service of the firmware to send an integrity verification request to the firmware, and the firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and a baseline value for integrity verification, including:

[0022] The kernel uses a timer mechanism to periodically call the third runtime service of the firmware to send integrity verification requests to the firmware.

[0023] In response to the integrity verification request, the firmware reads the current critical data based on the recorded data type and data address, obtains a digest value, compares the digest value with the baseline value for integrity verification, and obtains a comparison result.

[0024] The kernel determines that it is running normally based on the comparison results, and the firmware verifies the integrity of the operating system kernel operation.

[0025] The integrity verification method for operating system kernel operation based on firmware provided by the present invention further includes:

[0026] The kernel performs an alarm or shutdown operation based on the comparison result, or the firmware performs a reboot operation based on the comparison result.

[0027] The present invention also provides an integrity verification device for operating system kernel operation based on firmware, comprising:

[0028] A module is created for the kernel to call the firmware's first runtime service during the kernel's initialization phase, and to create a baseline value for key data based on the first runtime service.

[0029] The shutdown module is used to determine the end of the kernel initialization phase. The kernel calls the second runtime service of the firmware and shuts down the creation of the firmware's baseline value based on the second runtime service.

[0030] The verification module is used to enable the kernel to periodically call the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0031] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement an integrity verification method based on firmware operating system kernel as described above.

[0032] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an integrity verification method for operating system kernel based on firmware as described above.

[0033] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements an integrity verification method for operating system kernel based on firmware as described above.

[0034] This invention provides a firmware-based operating system kernel integrity verification method and apparatus. During kernel initialization, the kernel calls the firmware's first runtime service to create baseline values ​​for critical data. Then, upon completion of the initialization phase, the kernel calls the firmware's second runtime service to disable baseline value creation. Finally, the kernel periodically calls the firmware's third runtime service to send integrity verification requests. The firmware then verifies the integrity of the operating system kernel's operation based on these requests. This invention divides the server into firmware and kernel, providing kernel data integrity verification runtime services through the firmware. This allows firmware that can provide runtime services to the operating system to also perform critical data integrity verification for the operating system kernel. Furthermore, the kernel data verification logic runs in the firmware space, independent of the kernel space, ensuring that the verification logic in the firmware will not be hijacked by malicious attacks on the kernel. Therefore, the verification process is more secure, and the verification results are more reliable. Attached Figure Description

[0035] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0036] Figure 1 This is one of the flowcharts illustrating the integrity verification method for operating system kernel operation based on firmware provided by this invention;

[0037] Figure 2 This is a computer startup timing diagram of the integrity verification method for operating system kernel operation based on firmware provided by the present invention;

[0038] Figure 3 This is a server restart timing diagram of the integrity verification method for operating system kernel operation based on firmware provided by this invention;

[0039] Figure 4 This is a flowchart of the integrity verification method for operating system kernel operation based on firmware provided by the present invention.

[0040] Figure 5 This is a schematic diagram of the structure of the integrity verification device for operating system kernel operation based on firmware provided by the present invention;

[0041] Figure 6 This is a complete system architecture diagram of the integrity verification device based on firmware operating system kernel provided by the present invention;

[0042] Figure 7This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0044] Reference Figure 1 The present invention provides an integrity verification method for operating system kernel operation based on firmware, applied to a server, the server including a kernel and firmware, the method comprising the following steps:

[0045] Step 110: During the kernel initialization phase, the kernel calls the firmware's first runtime service to create a baseline value for key data based on the first runtime service;

[0046] Step 120: After determining that the initialization phase of the kernel has ended, the kernel calls the second runtime service of the firmware and disables the creation of the firmware's baseline value based on the second runtime service;

[0047] Step 130: The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0048] First, it should be noted that the runtime service RS (RuntimeService) in this embodiment may include: a first runtime service, a second runtime service, and a third runtime service, which are the runtime interfaces between the firmware and the kernel during server operation.

[0049] It's important to further explain that firmware is a program stored in the computer's motherboard memory, responsible for self-testing and initializing computer hardware (such as hard drives and memory). After completing the hardware self-test and initialization, the firmware loads and runs the operating system bootloader to start the operating system. After the operating system boots, the firmware code continues to reside in memory, providing runtime services for the operating system.

[0050] Operating system kernel: The most fundamental part of the operating system, it abstracts hardware details and allocates computer resources (CPU, memory, storage, etc.) to the programs running on it. The operating system kernel resides in memory and schedules various computer resources.

[0051] The first runtime service is to set the baseline value RS, the second runtime service is to set the baseline value flag RS, and the third runtime service is to verify the kernel data RS.

[0052] Specifically, step 110 above is the process of setting the baseline value. It requires calculating the integrity value of the data in memory based on the provided data memory address and recording it in the firmware's memory space.

[0053] The kernel creates baseline values ​​for critical data through a first runtime service, but it cannot modify or retrieve the integrity information of the critical data. It should be noted that critical data in the kernel is divided into multiple categories, such as the system call table and read-only kernel data regions. Therefore, the kernel needs to specify the data type when calling this runtime service, and during the initialization phase, the kernel calls this runtime service multiple times depending on when the critical data is created, creating a baseline value for each piece of data.

[0054] Step 120 above describes the process of setting and stopping the baseline value. Since the kernel only needs to create verification baselines for critical data during the initialization phase, the firmware's baseline value setting function is disabled after the initialization process is completed and before user process scheduling begins. This prevents kernel attackers from modifying the verification baselines already created in the firmware.

[0055] Specifically, this involves determining whether the target baseline value (baseline value flag) is set. If yes, baseline value setting stops; otherwise, baseline value setting continues. It should be noted that the target baseline value is determined based on the second runtime service.

[0056] Step 130 above describes the integrity verification process. The kernel periodically calls the third runtime service to initiate a verification request. The firmware calculates the current data digest value based on the recorded data type and data memory address, and compares it with the baseline value.

[0057] If the verification is successful, the kernel continues to run and continues to periodically call the third runtime service to verify the integrity of the system operation.

[0058] If verification fails, the firmware will perform a power-off operation to shut down the computer and prevent damage from malicious attacks.

[0059] It should be noted that the kernel periodically calls a third-party runtime service to request the firmware to verify the integrity of critical kernel data. The kernel only initiates the request; the execution process of the verification logic and the verification baseline values ​​reside in the firmware memory space. Therefore, it can be ensured that the kernel data verification logic runs in the firmware space, independent of the kernel space, ensuring that the verification logic in the firmware will not be hijacked by malicious attacks on the kernel.

[0060] This invention provides a firmware-based operating system kernel integrity verification method. During kernel initialization, the kernel calls the firmware's first runtime service to create baseline values ​​for critical data. Then, upon completion of the initialization phase, the kernel calls the firmware's second runtime service to disable baseline value creation. Finally, the kernel periodically calls the firmware's third runtime service to send integrity verification requests. The firmware then verifies the integrity of the operating system kernel's operation based on these requests. This invention divides the server into firmware and kernel, with the firmware providing a kernel data integrity verification runtime service. This allows firmware that can provide runtime services to the operating system to also perform critical data integrity verification for the operating system kernel. Furthermore, the kernel data verification logic runs in the firmware space, independent of the kernel space, ensuring that the verification logic in the firmware will not be hijacked by malicious attacks on the kernel. Therefore, the verification process is more secure, and the verification results are more reliable.

[0061] In some optional embodiments, during the kernel initialization phase, the kernel invokes a first runtime service of the firmware to create baseline values ​​for critical data based on the first runtime service, including:

[0062] During the kernel initialization phase, the kernel determines the data type of the critical data;

[0063] Based on the creation timing of key data of different data types, the first runtime service is called multiple times, and a baseline value for each key data is created based on each of the first runtime services.

[0064] It is understandable that this embodiment describes the specific process of creating a baseline value.

[0065] In this embodiment, since critical data in the kernel is divided into multiple categories, such as the system call table and read-only kernel data regions, the kernel needs to specify the data type when calling this runtime service. Furthermore, during the initialization phase, the kernel needs to call this runtime service multiple times to create a baseline value for each piece of data, depending on when the critical data is created.

[0066] In some optional embodiments, the creation of the baseline value for disabling the firmware based on the second runtime service includes:

[0067] The execution status of the second runtime service is determined based on whether the target baseline value is set.

[0068] Once the second runtime service has completed execution, the creation of the firmware's baseline value is disabled.

[0069] If the second runtime service has not been completed, continue executing the baseline value for creating the key data.

[0070] Specifically, in this embodiment, it is verified whether the target baseline value (flag bit) is set. If the flag bit is set, it indicates that the flag bit setting RS, i.e., the second runtime service, has been executed, and setting or changing the baseline value is no longer allowed. If the flag bit is not set, the subsequent baseline value setting operation is executed normally.

[0071] Reference Figure 2 , Figure 2 The computer startup timing diagram is provided for the integrity verification method of firmware-based operating system kernel operation provided by the present invention.

[0072] Firmware self-test (initialization) — Load and run the bootloader — Run the kernel — Kernel initialization — Kernel critical data addresses are sent to the firmware — Firmware calculates the baseline value — Kernel disables the baseline value setting query function — Update flags — Firmware flags are set — Kernel initialization and other steps.

[0073] In some optional embodiments, it also includes:

[0074] The kernel calls the fourth runtime service of the firmware and initializes memory data based on the fourth runtime service;

[0075] The firmware clears the baseline value and resets the target baseline value, and verifies the restart logic to execute an operating system restart.

[0076] As is easily understood, this embodiment describes the process of restarting the operating system using firmware. When the operating system performs a restart or fast restart, it needs to call the firmware's restart runtime service to initialize data such as memory. When the firmware performs the restart service, it clears the existing baseline value information and resets the flag bits to ensure that the new kernel can normally perform the baseline value creation operation when the operating system performs a fast restart.

[0077] Reference Figure 3 , Figure 3 The server restart timing diagram is provided for the integrity verification method of firmware-based operating system kernel operation provided by the present invention.

[0078] First, load the new kernel—execute the reboot system call—call the firmware to restart RS—the firmware clears the flags and deletes the existing baseline value—the firmware restarts RS and performs other operations—initialize the new kernel—internal key data addresses are sent to the firmware—the firmware calculates the new kernel baseline value—the kernel disables the baseline value setting function—updates the flags—the firmware sets the flags—the kernel initializes other steps.

[0079] This embodiment takes into account the fast restart mechanism. By clearing the flag bit in the firmware restart service, the firmware can build a verification benchmark based on the newly started kernel, which further ensures the applicability of the present invention.

[0080] In some optional embodiments, the kernel periodically invokes a third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and a baseline value for integrity verification, including:

[0081] The kernel uses a timer mechanism to periodically call the third runtime service of the firmware to send integrity verification requests to the firmware.

[0082] In response to the integrity verification request, the firmware reads the current critical data based on the recorded data type and data address, obtains a digest value, compares the digest value with the baseline value for integrity verification, and obtains a comparison result.

[0083] The kernel determines that it is running normally based on the comparison results, and the firmware verifies the integrity of the operating system kernel operation.

[0084] This embodiment describes the detailed process of integrity verification.

[0085] The kernel uses a timer mechanism to periodically call the firmware's third runtime service to send integrity verification requests to the firmware. In response to the integrity verification request, the firmware reads the current critical data based on the recorded data type and data address, obtains a digest value, and compares this digest value with the integrity verification baseline value to obtain the comparison result.

[0086] The kernel performs different operations based on the comparison results, as follows:

[0087] 1. The kernel determines normal operation based on the comparison results, and the firmware verifies the integrity of the operating system kernel operation.

[0088] 2. The kernel performs an alarm or shutdown operation based on the comparison results, or the firmware performs a reboot operation based on the comparison results.

[0089] Specifically, in this embodiment, a kernel timer is first started, using the kernel's timer mechanism to periodically trigger the execution of integrity verification requests. The current data digest value is calculated: When the firmware integrity verification service runs, it reads the current critical data according to the recorded data type and data address, and calculates the digest value. The integrity of the critical data is verified: The firmware integrity verification service compares the data baseline value with the calculated current digest value, and performs different system operations based on the comparison result.

[0090] If the results are consistent, the kernel will run normally and set a timer to trigger the integrity verification request periodically. If the verification results are inconsistent, it means that the critical data has been tampered with. The kernel can return a verification error result and perform operations such as alarm or shutdown, or the firmware can perform a reboot to prevent malicious attacks from further affecting the user's operating system.

[0091] Reference Figure 4 , Figure 4 This is a flowchart of the integrity verification method for operating system kernel execution based on firmware provided by the present invention, including the following steps:

[0092] Step 410: The kernel starts a timer to periodically call the baseline value to verify RS;

[0093] Step 420: When the kernel timer reaches the specified time, the baseline value is called to verify RS;

[0094] Step 430: The firmware reads and calculates the current critical data integrity value;

[0095] Step 440: Firmware verification of critical data integrity;

[0096] Step 450: Determine if the data is complete; if yes, proceed to step 460; otherwise, return to step 410.

[0097] Step 460: Perform a restart or alarm operation.

[0098] The following describes the integrity verification device for firmware-based operating system kernel operation provided by the present invention. The integrity verification device for firmware-based operating system kernel operation described below can be referred to in correspondence with the integrity verification method for firmware-based operating system kernel operation described above.

[0099] Reference Figure 5 The present invention provides an integrity verification device based on firmware operating system kernel operation, applied to a server, the server including a kernel and firmware, the device comprising:

[0100] A creation module 510 is used to, during the kernel initialization phase, call the firmware's first runtime service to create a baseline value for key data based on the first runtime service;

[0101] The shutdown module 520 is used to determine the end of the kernel initialization phase. The kernel calls the second runtime service of the firmware and shuts down the creation of the firmware's baseline value based on the second runtime service.

[0102] The verification module 530 is used to enable the kernel to periodically call the third runtime service of the firmware to send an integrity verification request to the firmware, and the firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0103] First, it should be noted that the runtime service RS (RuntimeService) in this embodiment may include: a first runtime service, a second runtime service, and a third runtime service, which are the runtime interfaces between the firmware and the kernel during server operation.

[0104] It's important to further explain that firmware is a program stored in the computer's motherboard memory, responsible for self-testing and initializing computer hardware (such as hard drives and memory). After completing the hardware self-test and initialization, the firmware loads and runs the operating system bootloader to start the operating system. After the operating system boots, the firmware code continues to reside in memory, providing runtime services for the operating system.

[0105] Operating system kernel: The most fundamental part of the operating system, it abstracts hardware details and allocates computer resources (CPU, memory, storage, etc.) to the programs running on it. The operating system kernel resides in memory and schedules various computer resources.

[0106] The first runtime service is to set the baseline value RS, the second runtime service is to set the baseline value flag RS, and the third runtime service is to verify the kernel data RS.

[0107] Specifically, the function of setting the baseline value in the above-mentioned creation module 510 requires calculating the integrity value of the data in memory based on the provided data memory address and recording it in the firmware's memory space.

[0108] The kernel creates baseline values ​​for critical data through a first runtime service, but it cannot modify or retrieve the integrity information of the critical data. It should be noted that critical data in the kernel is divided into multiple categories, such as the system call table and read-only kernel data regions. Therefore, the kernel needs to specify the data type when calling this runtime service, and during the initialization phase, the kernel calls this runtime service multiple times depending on when the critical data is created, creating a baseline value for each piece of data.

[0109] The aforementioned shutdown module 520 is a function that stops the baseline value setting once it is complete. Since the kernel only needs to create verification baselines for critical data during the initialization phase, the firmware's baseline value setting function is disabled after the initialization process is completed and before user process scheduling begins, preventing kernel attackers from modifying the verification baselines already created in the firmware.

[0110] Specifically, this involves determining whether the target baseline value (baseline value flag) is set. If yes, baseline value setting stops; otherwise, baseline value setting continues. It should be noted that the target baseline value is determined based on the second runtime service.

[0111] The aforementioned verification module 530 performs integrity verification. The kernel periodically calls the third runtime service to initiate a verification request. The firmware calculates the current data digest value based on the recorded data type and data memory address, and compares it with a baseline value.

[0112] If the verification is successful, the kernel continues to run and continues to periodically call the third runtime service to verify the integrity of the system operation.

[0113] If verification fails, the firmware will perform a power-off operation to shut down the computer and prevent damage from malicious attacks.

[0114] It should be noted that the kernel periodically calls a third-party runtime service to request the firmware to verify the integrity of critical kernel data. The kernel only initiates the request; the execution process of the verification logic and the verification baseline values ​​reside in the firmware memory space. Therefore, it can be ensured that the kernel data verification logic runs in the firmware space, independent of the kernel space, ensuring that the verification logic in the firmware will not be hijacked by malicious attacks on the kernel.

[0115] The present invention provides a firmware-based operating system kernel integrity verification device. During the kernel initialization phase, the kernel calls the firmware's first runtime service to create baseline values ​​for critical data. Then, upon completion of the initialization phase, the kernel calls the firmware's second runtime service to disable baseline value creation. Finally, the kernel periodically calls the firmware's third runtime service to send integrity verification requests. The firmware then verifies the integrity of the operating system kernel's operation based on these requests. This invention divides the server into firmware and kernel, with the firmware providing kernel data integrity verification runtime services. This invention enables firmware that can provide runtime services to the operating system to also perform critical data integrity verification for the operating system kernel. Furthermore, the kernel data verification logic runs in the firmware space, independent of the kernel space, ensuring that the verification logic in the firmware will not be hijacked by malicious attacks on the kernel. Therefore, the verification process is more secure, and the verification results are more reliable.

[0116] Reference Figure 6 , Figure 6 This is a complete system architecture diagram of the integrity verification device based on firmware operating system kernel provided by the present invention. The computer memory 600 includes firmware memory 610 and kernel memory 620.

[0117] Firmware memory 610 includes baseline value setting RS611, baseline value flag setting RS612, kernel data verification RS613, reboot RS614, kernel baseline value 615, and baseline value setting flag 616;

[0118] Kernel memory 620 includes baseline setting 621, integrity verification timer 622, and reboot 623.

[0119] In some optional embodiments, during the kernel initialization phase, the kernel invokes a first runtime service of the firmware to create baseline values ​​for critical data based on the first runtime service, including:

[0120] During the kernel initialization phase, the kernel determines the data type of the critical data;

[0121] Based on the creation timing of key data of different data types, the first runtime service is called multiple times, and a baseline value for each key data is created based on each of the first runtime services.

[0122] It is understandable that this embodiment describes the specific process of creating a baseline value.

[0123] In this embodiment, since critical data in the kernel is divided into multiple categories, such as the system call table and read-only kernel data regions, the kernel needs to specify the data type when calling this runtime service. Furthermore, during the initialization phase, the kernel needs to call this runtime service multiple times to create a baseline value for each piece of data, depending on when the critical data is created.

[0124] In some optional embodiments, the creation of the baseline value for disabling the firmware based on the second runtime service includes:

[0125] The execution status of the second runtime service is determined based on whether the target baseline value is set.

[0126] Once the second runtime service has completed execution, the creation of the firmware's baseline value is disabled.

[0127] In some optional embodiments, it also includes:

[0128] If the second runtime service has not been completed, continue executing the baseline value for creating the key data.

[0129] Specifically, in this embodiment, it is verified whether the target baseline value (flag bit) is set. If the flag bit is set, it indicates that the flag bit setting RS, i.e., the second runtime service, has been executed, and setting or changing the baseline value is no longer allowed. If the flag bit is not set, the subsequent baseline value setting operation is executed normally.

[0130] In some optional embodiments, it also includes:

[0131] The kernel calls the fourth runtime service of the firmware and initializes memory data based on the fourth runtime service;

[0132] The firmware clears the baseline value and resets the target baseline value, and verifies the restart logic to execute an operating system restart.

[0133] As is easily understood, this embodiment describes the process of restarting the operating system using firmware. When the operating system performs a restart or fast restart, it needs to call the firmware's restart runtime service to initialize data such as memory. When the firmware performs the restart service, it clears the existing baseline value information and resets the flag bits to ensure that the new kernel can normally perform the baseline value creation operation when the operating system performs a fast restart.

[0134] In some optional embodiments, the kernel periodically invokes a third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and a baseline value for integrity verification, including:

[0135] The kernel uses a timer mechanism to periodically call the third runtime service of the firmware to send integrity verification requests to the firmware.

[0136] In response to the integrity verification request, the firmware reads the current critical data based on the recorded data type and data address, obtains a digest value, compares the digest value with the baseline value for integrity verification, and obtains a comparison result.

[0137] The kernel determines that it is running normally based on the comparison results, and the firmware verifies the integrity of the operating system kernel operation.

[0138] In some optional embodiments, it also includes:

[0139] The kernel performs an alarm or shutdown operation based on the comparison result, or the firmware performs a reboot operation based on the comparison result.

[0140] This embodiment describes the detailed process of integrity verification.

[0141] The kernel uses a timer mechanism to periodically call the firmware's third runtime service to send integrity verification requests to the firmware. In response to the integrity verification request, the firmware reads the current critical data based on the recorded data type and data address, obtains a digest value, and compares this digest value with the integrity verification baseline value to obtain the comparison result.

[0142] The kernel performs different operations based on the comparison results, as follows:

[0143] 1. The kernel determines normal operation based on the comparison results, and the firmware verifies the integrity of the operating system kernel operation.

[0144] 2. The kernel performs an alarm or shutdown operation based on the comparison results, or the firmware performs a reboot operation based on the comparison results.

[0145] Specifically, in this embodiment, a kernel timer is first started, using the kernel's timer mechanism to periodically trigger the execution of integrity verification requests. The current data digest value is calculated: When the firmware integrity verification service runs, it reads the current critical data according to the recorded data type and data address, and calculates the digest value. The integrity of the critical data is verified: The firmware integrity verification service compares the data baseline value with the calculated current digest value, and performs different system operations based on the comparison result.

[0146] If the results are consistent, the kernel will run normally and set a timer to trigger the integrity verification request periodically. If the verification results are inconsistent, it means that the critical data has been tampered with. The kernel can return a verification error result and perform operations such as alarm or shutdown, or the firmware can perform a reboot to prevent malicious attacks from further affecting the user's operating system.

[0147] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute an integrity verification method based on the firmware operating system kernel. This method includes:

[0148] During the kernel initialization phase, the kernel invokes the firmware's first runtime service to create baseline values ​​for critical data based on the first runtime service.

[0149] Once the kernel initialization phase is complete, the kernel calls the firmware's second runtime service and disables the firmware's baseline value creation based on the second runtime service.

[0150] The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0151] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0152] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the integrity verification method based on firmware operating system kernel provided by the above methods, the method comprising:

[0153] During the kernel initialization phase, the kernel invokes the firmware's first runtime service to create baseline values ​​for critical data based on the first runtime service.

[0154] Once the kernel initialization phase is complete, the kernel calls the firmware's second runtime service and disables the firmware's baseline value creation based on the second runtime service.

[0155] The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0156] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements an integrity verification method based on a firmware-based operating system kernel provided by the methods described above, the method comprising:

[0157] During the kernel initialization phase, the kernel invokes the firmware's first runtime service to create baseline values ​​for critical data based on the first runtime service.

[0158] Once the kernel initialization phase is complete, the kernel calls the firmware's second runtime service and disables the firmware's baseline value creation based on the second runtime service.

[0159] The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation based on the integrity verification request and the integrity verification benchmark value.

[0160] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0161] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for verifying the integrity of operating system kernel execution based on firmware, characterized in that, Applied to a server, the server including a kernel and firmware, the method includes: During the kernel initialization phase, the kernel calls the firmware's first runtime service to create a baseline value for critical data based on the first runtime service. The baseline value is calculated based on the provided data memory address to determine the integrity value of the data in memory and recorded in the firmware's memory space. Once the kernel initialization phase is complete, the kernel calls the firmware's second runtime service and disables the firmware's baseline value creation based on the second runtime service. The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware then verifies the integrity of the operating system kernel operation in the firmware memory space based on the integrity verification request and the integrity verification benchmark value.

2. The integrity verification method for firmware-based operating system kernel operation according to claim 1, characterized in that, During the kernel initialization phase, the kernel invokes the firmware's first runtime service to create baseline values ​​for key data based on the first runtime service, including: During the kernel initialization phase, the kernel determines the data type of the critical data; Based on the creation timing of key data of different data types, the first runtime service is called multiple times, and a baseline value for each key data is created based on each of the first runtime services.

3. The integrity verification method for firmware-based operating system kernel operation according to claim 1, characterized in that, The creation of the baseline value for disabling the firmware based on the second runtime service includes: The execution status of the second runtime service is determined based on whether the target baseline value is set. Once the second runtime service has completed execution, the creation of the firmware's baseline value is disabled.

4. The integrity verification method for firmware-based operating system kernel operation according to claim 3, characterized in that, Also includes: If the second runtime service has not been completed, continue executing the baseline value for creating the key data.

5. The integrity verification method for firmware-based operating system kernel operation according to claim 3, characterized in that, Also includes: The kernel calls the fourth runtime service of the firmware and initializes memory data based on the fourth runtime service; The firmware clears the baseline value and resets the target baseline value, and verifies the restart logic to execute an operating system restart.

6. The integrity verification method for firmware-based operating system kernel operation according to claim 1, characterized in that, The kernel periodically calls the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation in the firmware memory space based on the integrity verification request and the integrity verification benchmark value, including: The kernel uses a timer mechanism to periodically call the third runtime service of the firmware to send integrity verification requests to the firmware. In response to the integrity verification request, the firmware reads the current critical data based on the recorded data type and data address, obtains a digest value, compares the digest value with the baseline value for integrity verification, and obtains a comparison result. The kernel determines that it is running normally based on the comparison results, and the firmware verifies the integrity of the operating system kernel operation; The execution process of the verification logic and the baseline value for integrity verification are both located in the firmware memory space of the firmware.

7. The integrity verification method for firmware-based operating system kernel execution according to claim 6, characterized in that, Also includes: The kernel performs an alarm or shutdown operation based on the comparison result, or the firmware performs a reboot operation based on the comparison result.

8. An integrity verification device based on firmware operating system kernel operation, characterized in that, Applied to a server, the server including a kernel and firmware, the device includes: A creation module is used during the kernel initialization phase to call the firmware's first runtime service and create a baseline value for critical data based on the first runtime service. The baseline value is calculated based on the provided data memory address to determine the integrity value of the data in memory and recorded in the firmware's firmware memory space. The shutdown module is used to determine the end of the kernel initialization phase. The kernel calls the second runtime service of the firmware and shuts down the creation of the firmware's baseline value based on the second runtime service. The verification module is used to enable the kernel to periodically call the third runtime service of the firmware to send an integrity verification request to the firmware. The firmware verifies the integrity of the operating system kernel operation in the firmware memory space based on the integrity verification request and the integrity verification benchmark value.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the integrity verification method for firmware-based operating system kernel operation as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the integrity verification method for firmware-based operating system kernel operation as described in any one of claims 1 to 7.