Identification and protection method for attackable data in kernel file system

By performing LLVM IR compilation and data flow tracking of the source code of the Linux kernel file system, dynamic verification of non-control data, identifying and classifying attackable data, solving the problem of failure to effectively identify and protect non-control data in the Linux kernel in the existing technology , realizes the protection effect of automated analysis and low performance overhead, is suitable for a variety of file systems and hardware, and supports cross-version applications.

CN119004443AActive Publication Date: 2024-11-22ZHEJIANG UNIV
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411021889.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-22
Estimated Expiration
2044-07-29

AI Technical Summary

Technical Problem

The existing technology is difficult to systematically identify and protect non-control data in the Linux kernel, resulting in unknown attack surface and lack of effective protection measures, which can easily lead to permission escalation vulnerabilities.

Method used

By compiling the source code of the kernel file system into LLVM IR files, scanning and tracking the data flow and control flow of core data, dynamically verifying potential non-control data, identifying and classifying attackable data, and designing protection schemes based on its semantic information.

Benefits of technology

It realizes automation, systematic analysis and protection of attack-free data in Linux kernel file system, reduces performance overhead, is compatible with multiple file systems and hardware, and supports cross-version applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119004443A_ABST
    Figure CN119004443A_ABST
Patent Text Reader

Abstract

The invention discloses an identification and protection method for attackable data in a kernel file system, which comprises the following steps: compiling a source code of the kernel file system into an LLVM IR file, and scanning based on the LLVM IR file to obtain different types of core data, including file metadata, file content and file read-write direction; tracking data flow propagation and control flow propagation of the core data based on the LLVM IR file to obtain attackable non-control data; carrying out dynamic verification on the attackable non-control data, and judging whether the attackable non-control data is attackable data or not; and protecting data which is finally influenced by the attackable data in a disk. The method is an automatic analysis tool for an attack surface caused by attacking non-control data in a Linux kernel file system, potential attackable data can be automatically identified and used according to semantic information, the attack process is simulated, the validity of the data is verified, and the complete attack surface is identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of operating system kernel protection, and in particular relates to a method for identifying and protecting attackable data in a kernel file system. Background Art

[0002] The Linux kernel is the foundation of computer operating systems and has a wide range of applications, including servers, personal computers, smartphones, and embedded systems. Since the security of the Linux kernel is directly related to the security of a large number of devices and systems, attacks and defenses against the operating system kernel have continued to evolve in recent decades. Attack strategies have evolved from the earliest kernel code injection attacks to code reuse attacks targeting control data (return addresses and function pointers), and finally non-control data attacks. Since various protection technologies have been proposed and deployed to defend against kernel code injection attacks and code reuse attacks, it is difficult for attackers to destroy the code and control data in the kernel, and then turn to non-control data for attacks.

[0003] However, attacks on non-control data rely on understanding program semantics, and there is still a lot of room for research. Over the years, attackers have tampered with various attackable non-control data to perform privilege escalation attacks, such as page tables, credential data structures, and user-mode helper loading paths in the kernel. These sensitive data are hand-picked based on the experience of researchers, and there is no systematic method to identify potential sensitive data. On the other hand, security researchers have proposed various protection techniques to monitor and protect these sensitive data. The kernel research work KENALI uses a heuristic method based on error codes to identify sensitive non-control data. However, it only captures part of the sensitive data related to permission checks without studying their impact and exploitability. There are still many unknown non-control data, which can cause serious consequences once tampered with, such as privilege escalation. A typical case is the Dirty COW vulnerability (CVE-2016-5195), which exploits a race condition vulnerability to manipulate the state of non-control data to write read-only files to cause privilege escalation. The recently exposed Dirty Pipe vulnerability (CVE-2022-0847) exploits uninitialized non-control data for privilege escalation.

[0004] However, before real-world attacks, these important non-control data have never been discovered. There is a lack of systematic research to explore the exploitability of non-control data in the Linux kernel, so the attack surface caused by it remains unknown, and there is a lack of corresponding protection measures to resist attacks that can occur at any time. Control data has clear semantic information, that is, it represents the execution logic of program jumps. In contrast, the semantics of non-control data are diverse, and the semantic information of the data determines whether it can cause privilege escalation attacks. However, the kernel does not provide documentation on the semantics of non-control data, and the kernel code is constantly changing, making it almost impossible to record the usage of all non-control data.

[0005] Therefore, an identification method is needed to analyze and obtain all data that can be used as attack targets, and then summarize the rules of the target data and provide a protection solution to effectively resist attacks on non-control data in the file system. Summary of the invention

[0006] In view of the deficiencies in the prior art, the purpose of the embodiments of the present application is to provide a method for identifying and protecting attackable data in a kernel file system.

[0007] According to a first aspect of an embodiment of the present application, a method for identifying and protecting attackable data in a kernel file system is provided, comprising:

[0008] Compile the source code of the kernel file system into an LLVM IR file, and obtain different types of core data based on the LLVM IR file, including file metadata, file content, and file read and write direction;

[0009] Based on the LLVM IR file, the data flow propagation and control flow propagation of the core data are tracked to obtain attackable non-control data;

[0010] Dynamically verifying the attackable non-control data to determine whether it is attackable data;

[0011] The data ultimately affected by the attackable data in the disk is protected.

[0012] Furthermore, the data structure of permission data in the abstract file system layer is used as the file metadata, the data structure representing the file content in the page cache layer and the common block layer is used as the file content, and the read / write event seat uniformly recorded when triggering data exchange in the common block layer is used as the file read and write direction.

[0013] Furthermore, data flow propagation and control flow propagation of the core data are tracked through value flow analysis based on type access paths.

[0014] Furthermore, for core data in the form of flag variables, its data flow propagation includes direct assignment or assignment after logical operation, and in the control flow propagation, branch judgment is used to affect the value of another flag variable.

[0015] Furthermore, for core data in the form of pointer references, its data flow propagation includes direct assignment operations and assignments after arithmetic operations.

[0016] Furthermore, dynamically verifying the attackable non-control data to determine whether it is attackable data includes:

[0017] According to the non-control data to be verified, the user-mode program performs a legal write operation on the file with write permission, triggering the use code of the non-control data in the kernel. The kernel stub code automatically records the target value of the non-control data and stores it in the array maintained by the kernel.

[0018] The user-mode program attempts to write the non-control data into a read-only file, triggering the use code of the non-control data in the kernel, taking out the target value of the non-control data in the array and writing it. At this time, the kernel relocates the data and automatically resets it to the value recorded in the previous step;

[0019] The user-mode program re-reads the read-only file to see if its content has been changed to the malicious content written in the previous step. If so, the data is vulnerable to attack.

[0020] According to a second aspect of an embodiment of the present application, a device for identifying and protecting attackable data in a kernel file system is provided, comprising:

[0021] A scanning module, used to compile the source code of the kernel file system into an LLVM IR file, and obtain different types of core data based on the LLVM IR file scanning, including file metadata, file content, and file read and write direction;

[0022] A tracing module, used for tracing the data flow propagation and control flow propagation of the core data based on the LLVM IR file to obtain attackable non-control data;

[0023] A dynamic verification module, used to dynamically verify the attackable non-control data to determine whether it is attackable data;

[0024] The protection module is used to protect the data ultimately affected by the attackable data in the disk.

[0025] According to a third aspect of an embodiment of the present application, a computer program product is provided, comprising a computer program / instruction, which implements the method described in the first aspect when executed by a processor.

[0026] According to a fourth aspect of an embodiment of the present application, there is provided an electronic device, including:

[0027] one or more processors;

[0028] A memory for storing one or more programs;

[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in the first aspect.

[0030] According to a fifth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.

[0031] Compared with the prior art, the technical innovations of the present invention are: 1. Semantic-based non-control data classification method: modeling the semantics of attackable non-control data in the file system, and classifying it into different categories based on the semantics, and screening the core data representing each category. 2. Static tracking technology for potentially attackable data: for the core data representing each category, statically track the propagation process of the data, and analyze and obtain all potentially attackable data. 3. Dynamic simulation attack verification technology: simulate the attacker's dynamic tampering of the data value, automatically determine whether it causes a privilege escalation attack, and thus verify whether the data is attackable data, and obtain the attack surface caused by the non-control data. 4. Protection technology for different categories of data: analyze the level of the file system where the data that can be used for privilege escalation attacks is located, and use different methods to protect the data according to the semantic-based categories in the first step. Therefore, the beneficial effects of the present invention are:

[0032] 1) Automated and systematic attackable non-control data analysis: This invention is the first automatic analysis tool for the attack surface caused by attackable non-control data in the Linux kernel file system. This invention can automatically identify and use potential attackable data based on semantic information, simulate the attack process, verify the validity of the data, and identify the complete attack surface.

[0033] 2) Data protection with low performance overhead: After obtaining data that is effective against privilege escalation attacks, the present invention designs different protection schemes for three types of data respectively. According to the different file system layers where the data is located after propagation, the data that is ultimately affected is selected as the protection target to reduce performance overhead.

[0034] 3) Compatible with various file systems and storage hardware drivers: The present invention automatically identifies attackable non-control data present in various file system implementations, such as ext2, ext4, FAT, etc. In addition, it is compatible with different hardware and can systematically analyze hardware drivers without additional manual overhead.

[0035] 4) Cross-version support: The Linux kernel code is updated and iterated very quickly. The present invention can be ported to multiple versions of the Linux kernel without additional manual overhead. The analysis based on the source code can be compatible with all mainstream system architectures (x86_64, aarch64, etc.).

[0036] Therefore, the present invention has a good promotion and application prospect.

[0037] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0039] Figure 1 The present invention is a flowchart showing a method for identifying and protecting attackable data in a kernel file system according to an exemplary embodiment.

[0040] Figure 2 It is a diagram showing the hierarchical structure of the file system in the Linux kernel.

[0041] Figure 3 The invention is a flowchart of statically extracting core data and tracking its propagation according to an exemplary embodiment.

[0042] Figure 4 The invention is a flowchart showing a method for dynamically verifying attackable non-control data according to an exemplary embodiment.

[0043] Figure 5 The figure is a flowchart of protecting attackable data according to an exemplary embodiment.

[0044] Figure 6 The invention is a block diagram showing a device for identifying and protecting attackable data in a kernel file system according to an exemplary embodiment.

[0045] Figure 7 The diagram is a schematic diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0046] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.

[0047] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0048] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0049] Figure 1 FIG. 1 is a flowchart of a method for identifying and protecting attackable data in a kernel file system according to an exemplary embodiment. Figure 1 As shown, the method is applied in a terminal and may include the following steps:

[0050] Step S1: The kernel file system ( Figure 2 ) is compiled into an LLVM IR file, and different categories of core data are obtained based on the LLVM IR file scan, including file metadata, file content, and file reading and writing direction. Figure 2 The file system hierarchy in the Linux kernel is presented, and a portion of dynamically verified data that can be used for privilege escalation attacks is listed at each layer.

[0051] Specifically, Figure 3 As shown, the kernel source code is compiled into an LLVM IR file that is easy to analyze, and then the static analysis tool is run to scan certain specific layers of the file system for non-control data representing different categories, namely core data.

[0052] The core data is mainly divided into file metadata, file content, and file reading and writing direction:

[0053] (1) File metadata: An attacker can bypass the top-level security check of the file system by tampering with the permission information of the file metadata, thereby obtaining root permissions. Figure 2 As shown, the abstract file system layer (such as the virtual file system layer and the general block layer) hides different implementations to provide an abstract interface, and the module selects the data structure of the permission data of this layer to represent the metadata of the file.

[0054] (2) File content: represents the user data stored in the file. There are two ways to store it: disk and memory (page cache). The attacker can modify non-control data and directly write the content of the read-only file to achieve privilege escalation. For example, modify the content of / etc / passwd and add the attacker as the root user to achieve privilege escalation. Therefore, the data structure representing the file content is selected in the page cache layer and the common block layer, such as Figure 2 As shown, the data structure is relatively independent of different file system implementations and disk hardware drivers.

[0055] (3) Read and write direction: File metadata and content are stored on disk and loaded into memory when access is needed. Read and write operations run through the entire file system, from the top layer down to the bottom layer of disk to achieve data exchange. The Linux kernel records the unified data exchange events between disk and main memory in the common block layer. By modifying the read and write flag, the read operation can be converted into a write operation and then written to a read-only file. Therefore, the read / write event is recorded uniformly when the exchange of data is triggered in the common block layer as the core data.

[0056] Step S2: based on the LLVM IR file, tracing the data flow propagation and control flow propagation of the core data to obtain attackable non-control data;

[0057] Specifically, Figure 3As shown in the figure, core data is used as the foundation of propagation, and its propagation process is tracked to discover more attackable non-control data. The three types of data propagation modes are different. Through customized propagation rules, the data flow and control flow of core data are tracked, and then more potential attackable data is obtained through analysis. Specifically, the data structure of the three types of core data in the code has two forms: (1) Flag variables, usually implemented by integers, whose values ​​mark a certain kernel state. Each bit of the flag variable represents a different state, so only logical operations (AND, OR, NOT) are performed, and arithmetic operations (addition, subtraction, multiplication, and division) are not involved. Therefore, in the process of data flow propagation, the propagation algorithm only includes direct assignment or assignment after logical operation. In control flow propagation, a flag variable can affect the value of another flag variable through branch judgment. For example, a specific bit of a flag variable representing permission represents a legal permission. The permission is judged through a branch. If it is legal, the state of another flag variable is assigned to a legal state, otherwise, the state is marked as illegal. (2) Pointer reference, used as an index to find a specific area in the storage space. Unlike flag variables, the information represented by different bits of flag variables has been hard-coded in the kernel and will not change, so it is easy to obtain the values ​​representing different states. The value referenced by a pointer changes dynamically, depending on the location of the target storage space. The value of a pointer is unique and uniquely points to a certain storage space area. The data flow propagation process of tracking the value of a pointer variable involves arithmetic operations (such as aligning a pointer) but not logical operations. Therefore, the data flow propagation rules include direct assignment operations and assignments after arithmetic operations. On the other hand, the value of a pointer is affected by the control flow. In branch judgment, the value of the pointer is determined according to the state of the flag variable in the conditional judgment, and then the flag variable is regarded as the new data to be propagated. This is because pointer variables usually do not appear in branch judgment conditions, only flag variables appear in them to judge the state of the kernel. The propagation rule of this state variable follows the first propagation rule (flag variable propagation). The above propagation process is recursive until no new data is found.

[0058] The tracing process is also applied to LLVM IR files, avoiding expensive pointer analysis through value flow analysis of type-based access paths (such as Practical program modularization with type-based dependence analysis and Statically Discovering High-Order Taint Style Vulnerabilities in OS Kernels).

[0059] Step S3: dynamically verify the attackable non-control data to determine whether it is attackable data;

[0060] Specifically, step S2 obtains a series of potentially attackable non-control data sets. In order to avoid mutual influence between data, the present invention extracts one data from the set each time until all data are verified. Figure 4 As shown, before dynamic verification, plugging is required. Dynamic verification is divided into three steps, which require the use of the kernel and user-mode program after LLVM plugging. The present invention plugs in the locations where all identification data are used in the kernel, but each time a data is extracted for verification, only the value of the data will be recorded and reset when the kernel is running. The function of determining the data to be extracted, as well as the function of recording and resetting the data, is implemented by a newly added system call. The user-mode program triggers the function after the kernel plugging by calling the system call, thereby realizing dynamic verification. Specifically, the present invention customizes a new system call, and the parameters of the system call are: a certain data to be verified, and a specific operation to be performed (including two types, record / reset). In the process of plugging all data in advance, all data are numbered, so the system call only needs to provide the number of the data to be verified; the parameters of the specific operation are distinguished by integers, which are used in steps S31-S32:

[0061] S31: According to the specific data, the user-mode program performs a legal write operation on the file with write permission, triggering the use code of the data in the kernel, and the kernel stub code automatically records the target value of the data and stores it in an array maintained by the kernel;

[0062] S32: The user-mode program attempts to write malicious content to a read-only file, triggering the kernel's use code for the data, taking the value out of the array, and then writing the value into the data. At this time, the kernel relocates the data and automatically resets it to the value recorded in the previous step.

[0063] S33: The user-mode program re-reads the read-only file used in S32 to check whether its content has been changed to the malicious content written in the previous step. If so, the data is attackable data and is collected into the attackable data set.

[0064] After executing the above steps S31-S33 for all non-control data in the attackable non-control data set, all data in the attackable data set are reported, including the data structure on which the allocated data depends and the specific offset position in the structure. The value of the offset position is modified to the value recorded in the third step, causing a read-only file to be written, thereby achieving a privilege escalation attack and obtaining the attack surface of the non-control data in the kernel.

[0065] Step S4: protecting the data ultimately affected by the attackable data in the disk;

[0066] like Figure 5 As shown in the figure, for all attackable data, the data representing the file content distributed in the bottom layer of the kernel file system, i.e., the disk, is analyzed; this part includes the page cache representing the file content and the disk block data. It is worth noting that for file metadata and file read and write directions, the attacker's goal of bypassing permission checks is to write the target file content, or to modify the read and write directions to write the file content; therefore, only the file content data needs to be protected to achieve complete protection and resist non-control data attacks on the file system.

[0067] The present invention proposes for the first time a systematic analysis of non-control data in the kernel that is the target of attack, automatically identifies data that causes privilege escalation attacks, summarizes the patterns of these data, and provides corresponding protection solutions. The scope of this analysis is the file system in the kernel. This is because files play an important role in kernel security. Once file access protection is compromised, attackers can easily launch privilege escalation attacks, and the hierarchical structure of the file system is clear, which facilitates the analysis of semantic information at different levels. Therefore, the present invention first divides non-control data into multiple categories representing different semantics based on the multi-layer semantic structure of the file system; according to the characteristics of the data semantics, the core non-control data representing each category is screened, and then the propagation process of its semantics is statically tracked to analyze all potential attackable data in each category; dynamic instrumentation is used to automatically monitor and simulate the process of attackers tampering with attackable data, and verify that the data that actually causes privilege escalation attacks is obtained, such as Figure 2 As shown in the figure, the identification results include all non-control data currently used in privilege escalation attacks, including the Dirty COW vulnerability (vm_fault->flags), the Dirty Pipe vulnerability (pipe_buffer->flags), and the Dirty Permission vulnerability (file->f_mode); finally, all attackable non-control data are reported, and different protection schemes are adopted for different types of data.

[0068] Corresponding to the aforementioned embodiment of the method for identifying and protecting attackable data in the kernel file system, the present application also provides an embodiment of the device for identifying and protecting attackable data in the kernel file system.

[0069] Figure 6 1 is a block diagram of a device for identifying and protecting attackable data in a kernel file system according to an exemplary embodiment. Figure 6 , the device may include:

[0070] A scanning module 21 is used to compile the source code of the kernel file system into an LLVM IR file, and obtain different types of core data based on the LLVM IR file scanning, including file metadata, file content, and file read and write direction;

[0071] A tracing module 22, used for tracing the data flow propagation and control flow propagation of the core data based on the LLVM IR file to obtain attackable non-control data;

[0072] A dynamic verification module 23, used to dynamically verify the attackable non-control data to determine whether it is attackable data;

[0073] The protection module 24 is used to protect the data ultimately affected by the attackable data in the disk.

[0074] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0075] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.

[0076] Accordingly, the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the above-mentioned method for identifying and protecting attackable data in a kernel file system.

[0077] Accordingly, the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned identification and protection method for attackable data in the kernel file system. Figure 7 As shown, a hardware structure diagram of a device having data processing capability, in which a device for identifying and protecting attackable data in a kernel file system provided by an embodiment of the present invention is located, except Figure 7 In addition to the processor, memory and network interface shown, any device with data processing capability in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capability, which will not be described in detail.

[0078] Accordingly, the present application also provides a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by the processor, the above-mentioned identification and protection method for attackable data in the kernel file system is implemented. The computer-readable storage medium can be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or a memory. The computer-readable storage medium can also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), an SD card, a flash card (Flash Card), etc. equipped on the device. Further, the computer-readable storage medium can also include both an internal storage unit of any device with data processing capabilities and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and can also be used to temporarily store data that has been output or is to be output.

[0079] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the contents disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

Claims

1. A method for identifying and protecting attackable data in a kernel file system, characterized in that: include: Compile the source code of the kernel file system into an LLVM IR file, and obtain different types of core data based on the LLVM IR file, including file metadata, file content, and file read and write direction; Based on the LLVM IR file, the data flow propagation and control flow propagation of the core data are tracked to obtain attackable non-control data; Dynamically verifying the attackable non-control data to determine whether it is attackable data; The data ultimately affected by the attackable data in the disk is protected.

2. The method according to claim 1, characterized in that: The data structure of permission data in the abstract file system layer is used as the file metadata, the data structure representing the file content in the page cache layer and the common block layer is used as the file content, and the read / write event seat uniformly recorded when triggering data exchange in the common block layer is used as the file read and write direction.

3. The method according to claim 1, characterized in that The data flow propagation and control flow propagation of the core data are tracked through value flow analysis based on type access paths.

4. The method according to claim 1, characterized in that: For core data in the form of flag variables, its data flow propagation includes direct assignment or assignment after logical operation, and in control flow propagation, branch judgment is used to affect the value of another flag variable.

5. The method according to claim 1, characterized in that For core data in the form of pointer reference, its data flow propagation includes direct assignment operations and assignments after arithmetic operations.

6. The method according to claim 1, characterized in that Dynamically verifying the attackable non-control data to determine whether it is attackable data includes: According to the non-control data to be verified, the user-mode program performs a legal write operation on the file with write permission, triggering the use code of the non-control data in the kernel. The kernel stub code automatically records the target value of the non-control data and stores it in the array maintained by the kernel. The user state program attempts to write the non-control data into a read-only file, triggering the use code of the non-control data in the kernel, taking out the target value of the non-control data in the array and writing it. At this time, the kernel relocates the data and automatically resets it to the value recorded in the previous step; The user-mode program re-reads the read-only file to see if its content has been changed to the malicious content written in the previous step. If so, the data is vulnerable to attack.

7. A device for identifying and protecting attackable data in a kernel file system, characterized in that: include: A scanning module, used to compile the source code of the kernel file system into an LLVM IR file, and obtain different types of core data based on the LLVM IR file scanning, including file metadata, file content, and file read and write direction; A tracing module, used for tracing the data flow propagation and control flow propagation of the core data based on the LLVM IR file to obtain attackable non-control data; A dynamic verification module, used to dynamically verify the attackable non-control data to determine whether it is attackable data; The protection module is used to protect the data ultimately affected by the attackable data in the disk.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • System and method for resisting control flow hijack based on LLVM

    CN107545174A

  • Linux kernel data attack detection method and defense method and system

    CN107967426A

  • program non-control data attack protection method based on an LLVM compiler

    CN109918903A

  • Kernel sensitive data integrity protection method based on ARM pointer verification

    CN111881485A

  • Securing software by enforcing data flow integrity

    EP1870829A1