Kernel function reinforcement method, device, storage medium and electronic device

By detecting the permissions of kernel function instructions in the Linux operating system and processing it, the security problem when calling user-state functions in the kernel state is solved, preventing information leakage and other hazards, and enhancing the security of the system.

CN113407933BActive Publication Date: 2024-12-06CHENGDU OPPO TELECOMM TECH CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110667125.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-16
Publication Date
2024-12-06
Estimated Expiration
2041-06-16

AI Technical Summary

Technical Problem

The existing Linux operating system lacks a defense mechanism when calling user-state functions in the kernel state, which causes users to use ROOT permissions to cause information leakage and other hazards, and only depends on routine checks and restrictions on executable binary files that cannot defend against hijacking kernel pointers. attack.

Method used

By detecting the permissions of the target kernel function instruction, we determine whether it has target permissions, and processing the current process based on the judgment results to prevent it from executing calls, providing a kernel function reinforcement method and device, and using the process permission judgment mechanism to prevent information leakage .

Benefits of technology

It effectively prevents information leakage and other hazards caused by permissions, provides a detection mechanism different from the native environment, enhances the defense capabilities of kernel functions, and avoids security risks caused by permission hijacking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113407933B_ABST
    Figure CN113407933B_ABST
Patent Text Reader

Abstract

The present application discloses a kernel function reinforcement method, device, storage medium and electronic device. The method includes, when a trigger target kernel function instruction is detected, judging whether the trigger target kernel function instruction has target authority based on the current process; and processing the current process according to the judgment result of whether the trigger target kernel function instruction has target authority. The present application can judge whether the detected trigger target kernel function instruction has target authority, and when it is judged that it has target authority, it can prevent the trigger target kernel function instruction from executing and calling the target kernel function, providing a detection mechanism different from the native environment for the target kernel function, thereby avoiding hazards such as information leakage caused by authority.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer security technology, and in particular to a kernel function reinforcement method, device, storage medium and electronic device. Background Art

[0002] The kernel of the Linux operating system has a series of kernel functions that can execute set functions. The SHELL interpreter can pass user operation instructions to the kernel to call the kernel function.

[0003] In the kernel function, there is a kernel-mode call to user-mode function (call_usermodehelper function), which can be used to create and run user-mode programs directly in the kernel and return the processing results to the user. This function has ROOT permissions. Using this permission feature, users can hijack the kernel-mode call to user-mode function under certain conditions and execute user-mode programs with ROOT permissions.

[0004] In the existing Linux operating system, the kernel-state calls user-state functions only rely on the native environment to perform routine checks and restrictions on executable binary files, and no defense mechanism is set. For example, when a user hijacks the kernel-state to call a user-state function by hijacking the kernel pointer, the ROOT permission can be used to cause information leakage and other hazards. Summary of the invention

[0005] The embodiments of the present application provide a kernel function hardening method, device, storage medium and electronic device, which can prevent kernel functions from being called arbitrarily by judging process permissions, thereby avoiding information leakage.

[0006] In a first aspect, an embodiment of the present application provides a kernel function hardening method, comprising:

[0007] When a triggering target kernel function instruction is detected, determining whether the triggering target kernel function instruction has the target permission based on the current process;

[0008] The current process is processed according to the judgment result of whether the instruction that triggers the target kernel function has the target permission.

[0009] In a second aspect, an embodiment of the present application provides a kernel function hardening device, including:

[0010] A first processing module is used to determine whether the triggering target kernel function instruction has the target permission based on the current process when a triggering target kernel function instruction is detected;

[0011] The second processing module is used to process the current process according to the judgment result of whether the instruction that triggers the target kernel function has the target permission.

[0012] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;

[0013] The processor is connected to the memory;

[0014] A memory for storing executable program codes;

[0015] The processor runs the program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the kernel function hardening method provided by the first aspect of the embodiment of the present application or any one of the implementation methods of the first aspect.

[0016] In a fourth aspect, an embodiment of the present application provides a computer storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the kernel function hardening method provided by the first aspect of the embodiment of the present application or any one of the implementation methods of the first aspect can be implemented.

[0017] In the embodiment of the present application, when a trigger target kernel function instruction is detected, it is determined based on the current process whether the trigger target kernel function instruction has the target permission; and the current process is processed according to the result of the determination of whether the trigger target kernel function instruction has the target permission. The electronic device can determine whether the detected trigger target kernel function instruction has the target permission, and when it is determined that it has the target permission, it can prevent the trigger target kernel function instruction from executing and calling the target kernel function, providing a detection mechanism for the target kernel function that is different from the native environment, thereby avoiding hazards such as information leakage caused by permissions. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A schematic diagram of the structure of an operating system based on the Linux kernel provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of the architecture of a kernel function hardening system provided in an embodiment of the present application;

[0021] Figure 3 A flowchart of a kernel function reinforcement method provided in an embodiment of the present application;

[0022] Figure 4A schematic diagram of a process incubation based on a Linux system provided in an embodiment of the present application;

[0023] Figure 5 A flowchart of another kernel function reinforcement method provided in an embodiment of the present application;

[0024] Figure 6 A flowchart of another kernel function reinforcement method provided in an embodiment of the present application;

[0025] Figure 7 A flowchart of another kernel function reinforcement method provided in an embodiment of the present application;

[0026] Figure 8 A flowchart of another kernel function reinforcement method provided in an embodiment of the present application;

[0027] Fig. 9 An overall flow chart of a kernel function reinforcement method provided in an embodiment of the present application;

[0028] Fig.10 A flowchart of another kernel function reinforcement method provided in an embodiment of the present application;

[0029] Fig.11 A schematic diagram of the effect of displaying prompt information by an electronic device provided in an embodiment of the present application;

[0030] Fig.12 A schematic diagram of the structure of a kernel function reinforcement device provided in an embodiment of the present application;

[0031] Fig.13 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0033] The terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0034] Android devices on the market are usually installed with the Android system, which is a mobile operating system based on the Linux kernel. It comes with a graphical interface that is easy to receive user operation instructions. The user operation instructions are sent to the Linux kernel, so that the Linux kernel performs relevant program processing according to the user operation instructions. In other words, the operation instructions formed by the user in the graphical interface are used to control the computer installed with the Android system. However, only the Linux kernel can control the device hardware (such as CPU, memory, etc.). Due to security and other reasons, users cannot directly contact the Linux kernel. At this time, another program needs to be used as a medium to receive the user's operation instructions, and convert and process them to pass the processed operation instructions to the kernel. This method simplifies the user's operation and protects the Linux kernel.

[0035] Specifically, Figure 1 FIG. 1 shows a schematic diagram of a Linux kernel-based operating system provided in an embodiment of the present application. Figure 1 As shown, the operating system 100 may include three parts, namely, an operation instruction acquisition module, a SHELL interpreter, and a Linux kernel. Among them, the operation instruction may be an operation performed by a user on the graphical display interface of the operating system, such as but not limited to clicking on an icon, long pressing an icon, etc. The SHELL interpreter may be used to receive the user operation instruction acquired on the graphical display interface, convert and process the user operation instruction, and pass the processed user operation instruction to the Linux kernel. The Linux kernel may be used to receive the processed user operation instruction sent by the SHELL interpreter, run related programs or call related functions based on the processed user operation instruction, and return the result of the operation to the graphical display interface. It is understandable that the SHELL interpreter may not be limited to the above-mentioned acquisition of user operation instructions and passing the processed operation instructions to the Linux kernel, for example, it may also call other programs or pass data to other programs.

[0036] For example, taking an electronic device with an Android operating system as an example, a user can choose to click on the WeChat application icon on the main interface of the electronic device. After receiving the operation instruction of clicking on the WeChat application icon, the SHELL interpreter converts and processes the operation instruction and passes the processed operation instruction to the Linux kernel. After receiving the processed operation instruction, the Linux kernel can create a related process for the operation instruction and run it, and return the operation result indicating the opening of the WeChat application to the main interface of the electronic device through the SHELL interpreter, so that the electronic device displays the main interface of the WeChat application.

[0037] In the Linux kernel, multiple functions with predetermined functions can be set. After receiving the instruction transmitted by the SHELL interpreter, a process can be created according to the instruction to call the function that can execute the relevant function. For example, the Linux kernel provides a kernel state to call the user state function (call_usermodehelper function). When the Linux kernel calls the kernel state to call the user state function, a working thread will be added to the work queue. After the working thread runs, it can finally start the application program in the user space and return the obtained parameter results to the application program. It can be understood here that the Linux system includes kernel space and user space, wherein the kernel driver runs in the kernel space and the application program runs in the user space. It should be noted that the kernel state calls the user state function with super user authority (root authority), that is, when the user can directly call the kernel state to call the user state function in some way, other programs can be executed using the root authority. Possibly, the user can execute the call of kernel information according to the root authority of the kernel state to call the user state function, and the called kernel information can be obtained by printing and other methods to cause the leakage of kernel information. It is possible that some illegal users can disable the mandatory access control node (Security-Enhanced Linux) based on the root privilege of kernel state calling user state functions to remove access rights to certain important programs. It is possible that some illegal users can also disable the kernel symbol table address hiding function based on the root privilege of kernel state calling user state functions, so that the Linux system can display the symbols corresponding to different functions in the kernel symbol table, thereby realizing arbitrary function calls. It is possible that some illegal users can also trigger some medium- and low-risk vulnerabilities, such as denial of service (DOS), based on the root privilege of kernel state calling user state functions.

[0038] Taking the root privilege of using kernel state to call user state function in the prior art as an example, the method of increasing privilege by bypassing swap space (SMAP) based on Linux system can be to use kernel state to call user state function to execute binary instructions with root privilege.

[0039] It is understandable that since the kernel state calls the user state function with root permissions, the user cannot directly call the kernel state to call the user state function. However, when the user meets certain conditions (such as hijacking the kernel pointer and jumping to the kernel state to call the user state function address through the kernel pointer), the kernel state can be hijacked to call the user state function.

[0040] For the above-mentioned attack method of calling user-mode functions from kernel mode, the existing Linux system does not have a defense mechanism and only relies on the routine checks and restrictions on executable binary files in the native environment. However, this method cannot defend against the attack method of calling user-mode functions from kernel mode.

[0041] In view of the defects of the existing Linux system, this application is explained in detail below.

[0042] See also Figure 2 , Figure 2 A schematic diagram of the architecture of a kernel function hardening system provided in an embodiment of the present application is shown.

[0043] like Figure 2 As shown, the kernel function hardening system 200 may include an electronic device 201 and a control terminal 202, wherein:

[0044] The electronic device 201 may be an electronic device 201 with an Android system installed or multiple electronic devices 201 with an Android system installed. In the Linux kernel inside the Android system, multiple kernel functions of setting functions may be configured, such as but not limited to kernel state calling user state functions with root authority. The electronic device 201 may receive the operation that the user wants to perform on the display interface. For example, if the user wants to use a certain application, he can click the icon of the application in the display interface with his finger. At this time, the electronic device 201 receives the operation instruction of the user clicking the icon of the application, and the operation instruction may be sent to the SHELL interpreter, so that the SHELL interpreter passes the processed operation instruction to the Linux kernel of the electronic device 201. When the Linux kernel executes the corresponding program, the result may be returned to the display interface of the electronic device 201. For example, the electronic device 201 may enter the main interface of the application after receiving the operation instruction of the user clicking the icon of the application.

[0045] Because some kernel functions in the Linux kernel of the electronic device 201 have higher permissions and cannot be executed and called by the user's operation instructions for security reasons, when the Linux kernel receives an execution call kernel function instruction with higher permissions converted and processed by the SHELL interpreter, it can be judged whether the execution call kernel function instruction with higher permissions has the target permission based on the current process created by the execution call kernel function instruction with higher permissions. Among them, the target permission here can be the SHELL permission of the SHELL interpreter, and the SHELL permission can be used to characterize that the instruction received by the Linux kernel is a user instruction. Further, the electronic device can process the current process according to the judgment result of whether the execution call kernel function instruction with higher permissions has the target permission.

[0046] The electronic device 201 involved in the embodiment of the present application can be a smart phone, tablet computer, desktop, laptop, notebook computer, ultra-mobile personal computer (Ultra-mobile Personal Computer, UMPC), handheld computer, netbook, personal digital assistant (Personal Digital Assistant, PDA), routing device, virtual reality device, etc. installed with an Android system.

[0047] The control terminal 202 may be a terminal provided with a SHELL interpreter, which may transmit an instruction to execute and call a kernel function to the Linux kernel of the electronic device 201 based on the SHELL interpreter after establishing a connection with the electronic device 201. The connection method between the control terminal 202 and the electronic device 201 may be, but is not limited to, a data line connection, a wireless connection, or a near field communication connection. Possibly, when the control terminal 202 and the electronic device 201 are connected by a data line, the user may edit the code of the SHELL interpreter at the control terminal 202 so that the SHELL interpreter transmits an instruction to execute and call a kernel function with a higher authority to the Linux kernel of the electronic device 201.

[0048] Possibly, when the control terminal 202 is wirelessly connected to the electronic device 201, the control terminal 202 may first receive an execution call to a kernel function instruction with higher privileges sent by an application installed on the electronic device 201, process the execution call to the kernel function instruction with higher privileges through the SHELL interpreter, and then return the processed execution call to the kernel function instruction with higher privileges to the application, and the application may directly pass the processed execution call to the kernel function instruction with higher privileges to the electronic device 201.

[0049] The control terminal 202 involved in the embodiment of the present application can be a tablet computer, desktop, laptop, notebook computer, ultra-mobile personal computer (UMPC), handheld computer, netbook, personal digital assistant (PDA), routing device, virtual reality device, etc. installed with a SHELL interpreter.

[0050] It should be noted that the structure of the kernel function reinforcement system of the embodiment of the present application can be directly composed of electronic devices in addition to being based on the control terminal 202 and the electronic device 201 mentioned above. The electronic device can be installed with an application for sending execution instructions for calling kernel functions with higher permissions to the Linux kernel of the electronic device. Possibly, when the user runs the application, the application can first upload the execution instructions for calling kernel functions with higher permissions to the background server corresponding to the application, and the SHELL interpreter set by the background server processes the execution instructions for calling kernel functions with higher permissions, and passes the processed execution instructions for calling kernel functions with higher permissions to the Linux kernel of the electronic device to call the kernel function with higher permissions.

[0051] Possibly, the application may pass the preset stored processing execution call higher privilege kernel function instruction to the Linux kernel of the electronic device at runtime to call the higher privilege kernel function.

[0052] It is understandable that, after being installed by the user, the application may also directly pass the execution instruction of calling a kernel function with higher permissions to the Linux kernel of the electronic device, but the embodiments of the present application are not limited to this.

[0053] See also Figure 3 , Figure 3 A flow chart of a kernel function hardening method provided in an embodiment of the present application is shown, and the method is applied to an electronic device installed with an Android system.

[0054] like Figure 3 As shown, the kernel function reinforcement method specifically includes the following steps:

[0055] Step 301: When a triggering target kernel function instruction is detected, determine whether the triggering target kernel function instruction has target permissions based on the current process.

[0056] Specifically, when the Linux kernel of the electronic device detects the triggering of the target kernel function instruction, it will create a current process according to the triggering of the target kernel function instruction, and can determine whether the target kernel function instruction has the target permission based on the current process. Exemplarily, the target permission can be a SHELL permission for transmitting a SHELL interpreter that represents the execution of the call target kernel function instruction. Among them, the target kernel function can be a kernel function with higher permissions in the Linux kernel, such as but not limited to kernel mode calling user mode function.

[0057] It is understandable that, it is possible that the current process can be the first process of a process group, that is, the group leader process. It is possible that the current process can also be the last process of a process group, that is, a child process directly hatched from the previous process (parent process). Any process in a process group has permissions. If there are at least two processes in the process group, the permissions of any two adjacent processes may be associated. For example, the permissions of the previous process are equal to the permissions of the next process hatched. It is also possible that the next process hatched may reduce permissions according to needs. In this case, the permissions of the previous process are greater than the permissions of the next process hatched.

[0058] Step 302: Process the current process according to the result of determining whether the instruction that triggers the target kernel function has the target permission.

[0059] Specifically, after determining whether the instruction that triggers the target function has the target permission, the electronic device may process the current process based on the judgment result, and different judgment results may correspond to different processing methods for the current process.

[0060] In an embodiment of the present application, the electronic device can determine whether the detected instruction to trigger the target kernel function has the target permission. If it is determined that it has the target permission, the instruction to trigger the target kernel function can be prevented from executing the call to the target kernel function, thereby providing a detection mechanism for the target kernel function that is different from the native environment, thereby avoiding hazards such as information leakage caused by permissions.

[0061] To better understand the current process and process group, please refer to Figure 4 A schematic diagram of process incubation based on a Linux system provided in an embodiment of the present application is shown.

[0062] like Figure 4 As shown, the process hatching diagram may include process group 1 and process group 2, wherein process group 1 includes process A, process B and process C, process B is directly hatched by process A based on the fork interface (equivalent to process A being the parent process of process B), process C is directly hatched by process B based on the fork interface (equivalent to process B being the parent process of process C), and the values ​​corresponding to the current process identification number of process A (which can be represented by pid) and the group leader process identification number (which can be represented by tgid) are both 43, the values ​​corresponding to the pid and tgid of process B are both 42, and the values ​​corresponding to the pid and tgid of process C are both 41, that is, it can be understood that process A, process B and process C can each serve as the group leader process. It should be noted that in process group 1, process A does not necessarily represent the group leader process of all processes in process group 1. For example, the source of process group 1 is obtained from the init process (the first process created by the Linux system).

[0063] Process group 2 includes process B, process b1 and process b2. Process b1 is directly hatched by process B based on the new interface (equivalent to process B being the parent process of process b1). Process b2 is directly hatched by process b1 based on the new interface (equivalent to process b1 being the parent process of process b2). The values ​​corresponding to pid and tgid of process B are both 42, the values ​​corresponding to pid of process b1 are 44 and the values ​​corresponding to tgid are 42, the values ​​corresponding to pid of process b2 are 46 and the values ​​corresponding to tgid are 42. That is, in process group 2, if process b2 is the current process, process b1 is the parent process and process B is the group leader process.

[0064] Possibly, if the current process in this embodiment is Figure 4 If the process C in the figure is a group leader process, it means that process C can also be represented as a group leader process, and process C has a parent process (process B). Further, it can be determined whether the instruction that triggers the target kernel function has the target permission based on the permissions of process B and process C.

[0065] Possibly, if the current process in this embodiment is Figure 4 If there is process b2 in the process, it means that process b1 is the parent process and process B is the group leader process. Further, it can be determined whether the instruction that triggers the target kernel function has the target permission based on the permissions of process b2, the permissions of process b1 and the permissions of process B.

[0066] It can be understood that based on the current process and process group proposed above, the embodiments of the present application may then provide detailed descriptions of the situations where the current process only includes the group leader process, the current process at least includes the group leader process and the parent process in the same process group as the group leader process, and the current process does not include the group leader process.

[0067] As an embodiment of the present application, please refer to Figure 5 A flowchart of another kernel function reinforcement method provided by an embodiment of the present application is shown, wherein the structure of the current process includes the current process identification number and the group leader process identification number;

[0068] like Figure 5 As shown, the kernel function reinforcement method specifically includes the following steps:

[0069] Step 501: When a triggering target kernel function instruction is detected, determine whether the current process identification number is equal to the group leader process identification number.

[0070] Step 502: When the current process identification number is not equal to the group leader process identification number, determine that the current process has a group leader process, and obtain the structure of the group leader process.

[0071] Step 503: Based on the structure of the group leader process and the structure of the current process, determine whether the instruction to trigger the target kernel function has the target permission.

[0072] Step 504: Process the current process according to the result of determining whether the instruction that triggers the target kernel function has the target permission.

[0073] The leader process and the current process are in a first process group, the first process group includes the leader process and the current process, and the current process is obtained by the leader process.

[0074] Specifically, when the electronic device determines whether the trigger target kernel function instruction has the target permission based on the current process, it can give priority to determining whether the first process group where the current process is located has a leader process. The judgment method can be to determine the values ​​corresponding to the current process identification number (pid) and the leader process identification number (tgid) in the structure of the current process, and determine whether the value corresponding to the current process identification number is equal to the value corresponding to the leader process identification number. If they are not equal, it means that there is a leader process in the first process group where the current process is located. It can be understood that if the first process group where the current process is located has a leader process, the current process is hatched by the leader process. In other words, the permission of the leader process is equal to the permission of the current process when the current process does not reduce the permission according to the demand, and is greater than the permission of the current process when the current process reduces the permission according to the demand.

[0075] It should be noted that, when it is determined that the process group to which the current process belongs has a leader process, it can be indicated that the process group to which the current process belongs includes at least the current process and the leader process. Possibly, taking the case that the process group to which the current process belongs includes four processes A, B, C and D, the leader process can be represented by A, and the current process can be represented by D. It should be noted that the parent process of the current process can be represented by C. Possibly, taking the case that the process group to which the current process belongs includes two processes A and B, the leader process can be represented by A, and the current process can be represented by B, and at this time the parent process is equivalent to the leader process (the current process is directly hatched by the parent process).

[0076] In this embodiment, the first process group where the current process is located includes only the current process and the leader process as an example. Further, the leader process identification number can be input into a specific native function of the Linux kernel to obtain the structure of the leader process. Among them, the structure of the leader process can be consistent with the structure of the current process, for example, it can include the current process identification number (pid) and the leader process identification number (tgid) with the same corresponding values, where the pid of the leader process corresponds to the leader process identification number.

[0077] Furthermore, when the structure of the team leader process is obtained, it can be determined whether the instruction to trigger the target kernel function has the target permission based on the permissions of the structure of the team leader process and the permissions of the structure of the current process.

[0078] In an embodiment of the present application, for the case where the current process has a leader process and the process group to which the current process belongs only includes the current process and the leader process, it can be determined whether the instruction that triggers the target kernel function has the target permissions based on the permissions of the leader process and the permissions of the current process. This can expand the scope of processes that detect whether they have the target permissions, thereby enhancing the defense capabilities against the target kernel function.

[0079] As another embodiment of the present application, please refer to Figure 6 A flow chart of another kernel function hardening method provided by an embodiment of the present application is shown, wherein the structure of the current process includes a current process identification number and a group leader process identification number.

[0080] like Figure 6 As shown, the kernel function reinforcement method specifically includes the following steps:

[0081] Step 601: When a triggering target kernel function instruction is detected, determine whether the current process identification number is equal to the group leader process identification number.

[0082] Step 602: When the current process identification number is not equal to the group leader process identification number, determine that the current process has a group leader process, and obtain the structure of the group leader process and the structure of the first parent process generated based on the first interface.

[0083] Step 603: Based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process, determine whether the instruction that triggers the target kernel function has the target permission.

[0084] Step 604: Process the current process according to the result of determining whether the instruction that triggers the target kernel function has the target permission.

[0085] Among them, the group leader process, the first parent process and the current process are in the second process group, the second process group at least includes the group leader process, the first parent process and the current process, and the current process is obtained from the first parent process, and the first parent process is obtained from the group leader process.

[0086] Specifically, when the electronic device determines that the second process group where the current process is located has a leader process, this embodiment takes the second process group where the current process is located as an example, which includes at least the current process, the leader process and the first parent process. On the basis of obtaining the structure of the leader process by inputting the leader process identification number into a specific native function of the Linux kernel, the structure of the first parent process generated based on the first interface is also obtained. Among them, the first interface can be a new interface specifically used by the Linux system to create processes, the first parent process can be hatched by the leader process based on the new interface, and the current process can be directly hatched by the first parent process based on the new interface. It should be noted here that, in the second process group, other processes except the leader process are hatched based on the new interface. Referring to the above-mentioned method of obtaining the structure of the leader process, the current process identification number of the current process can be input into other specific native functions of the Linux kernel to obtain the parent process structure corresponding to the current process.

[0087] Furthermore, when the structure of the group leader process and the structure of the parent process are obtained, it can be determined whether the instruction to trigger the target kernel function has the target permissions based on the permissions of the structure of the group leader process, the permissions of the structure of the first parent process, and the permissions of the structure of the current process.

[0088] In an embodiment of the present application, when the current process has a group leader process and a parent process, it can be determined whether the instruction that triggers the target kernel function has the target permissions based on the permissions of the group leader process, the parent process, and the current process. This can expand the scope of processes that detect whether they have the target permissions, thereby improving the defense capabilities against the target kernel function.

[0089] As another embodiment of the present application, please refer to Figure 7 A flow chart of another kernel function hardening method provided by an embodiment of the present application is shown, wherein the structure of the current process includes a current process identification number and a group leader process identification number.

[0090] like Figure 7 As shown, the kernel function reinforcement method specifically includes the following steps:

[0091] Step 701: When a triggering target kernel function instruction is detected, determine whether the current process identification number is equal to the group leader process identification number.

[0092] Step 702: When the current process identification number is equal to the group leader process identification number, determine that the current process does not have a group leader process, and obtain the structure of the second parent process generated based on the second interface.

[0093] Step 703: when the structure of the second parent process is detected, judging whether the instruction to trigger the target kernel function has the target permission based on the structure of the second parent process and the structure of the current process; wherein the second parent process and the current process are in a third process group, the third process group includes at least the second parent process and the current process, and the current process is obtained by the second parent process; or

[0094] In the case where the structure of the second parent process is not detected, it is determined whether the instruction triggering the target kernel function has the target permission based on the structure of the current process.

[0095] Step 704: Process the current process according to the result of determining whether the instruction that triggers the target kernel function has the target permission.

[0096] Specifically, when the electronic device determines whether the triggering target kernel function instruction has the target permission based on the current process, if the current process identification number is equal to the group leader process identification number, it can be determined that the current process does not have an additional group leader process. In other words, the current process can be used as the group leader process of the process group in which it is located, and the process group has only one process.

[0097] It should be noted that the current process here, as the group leader process, has not hatched other processes based on the new interface mentioned above, but the current process may still be hatched by other processes based on other interfaces specifically used to create processes in the Linux system, for example, by other processes based on the fork interface specifically used to create processes in the Linux system, which means that the current process has a parent process in the process group formed by hatching based on the fork interface, and the parent process here is hatched based on the fork interface.

[0098] Further, when it is determined that the current process does not have a leader process (that is, the current process can be used as a leader process), the structure of the second parent process generated based on the second interface can be obtained, and the second interface here can be the fork interface mentioned above. Possibly, when the structure of the second parent process is not detected, it indicates that the current process has neither a leader process nor a parent process, and whether the instruction to trigger the target kernel function has the target permission can be directly determined based on the permissions of the current process.

[0099] If possible, when the structure of the second parent process is detected, it indicates that the current process has a parent process, then it can be determined whether the instruction that triggers the target kernel function has the target permission based on the permissions of the current process and the permissions of the second parent process. Figure 4It can be known that the current process and the second parent process are processes in the third process group obtained based on the fork interface. The third process group does not necessarily include only the current process and the second parent process. When the current process is determined as the group leader process in the process group obtained based on the new interface, it is only necessary to consider whether there is a second parent process of the current process obtained based on the fork interface.

[0100] It is understandable that this embodiment is not limited to obtaining the second parent process of the current process. For example, the source process (also referred to as the group leader process in the process group) in the third process group including the current process and the second parent process may be obtained to further expand the scope of processes for detecting whether they have target permissions. Of course, if the source process is the init process mentioned above, there is no need to obtain the source process.

[0101] In an embodiment of the present application, if the current process does not have a group leader process, a second parent process of the current process can be obtained based on different interfaces, and the detection result of the second parent process can be combined with the current process to determine whether the instruction to trigger the target kernel function has the target permission. This can maximize the scope of processes that detect whether they have the target permission, thereby improving the defense capabilities against the target kernel function.

[0102] Combined with the above-mentioned several embodiments, the method of judging whether the triggering target kernel function instruction has the target permission based on the current process can be specifically referred to in Figure 8 A flowchart of another kernel function hardening method provided in an embodiment of the present application is shown.

[0103] like Figure 8 As shown, the kernel function reinforcement method specifically includes the following steps:

[0104] Step 801: When a triggering target kernel function instruction is detected, determine whether the current process identification number is equal to the group leader process identification number.

[0105] Step 802: When the current process identification number is not equal to the group leader process identification number, determine that the current process has a group leader process, and obtain the group leader process structure.

[0106] Step 803: Based on the structure of the group leader process and the structure of the current process, determine whether the instruction that triggers the target kernel function has the target permission.

[0107] It is possible that if the numerical value corresponding to the current process identification number in the structure of the current process is not equal to the numerical value corresponding to the group leader process identification number, the group leader process identification number can be input into a specific native function of the Linux kernel to obtain the structure of the group leader process corresponding to the current process, and based on the permissions of the two processes, the structure of the group leader process and the structure of the current process, it is determined whether the instruction to trigger the target kernel function has the target permission.

[0108] Step 804: When the current process identification number is not equal to the group leader process identification number, determine that the current process has a group leader process, and obtain the structure of the group leader process and the structure of the first parent process generated based on the first interface.

[0109] Step 805: Based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process, determine whether the instruction that triggers the target kernel function has the target permission.

[0110] Possibly, if the numerical value corresponding to the current process identification number in the structure of the current process is not equal to the numerical value corresponding to the group leader process identification number, the group leader process identification number can be input into a specific native function of the Linux kernel to obtain the structure of the group leader process corresponding to the current process, and the current process identification number can be input into other specific native functions of the Linux kernel to obtain the first parent process structure corresponding to the current process, and based on the permissions of the three processes, namely the structure of the group leader process, the structure of the first parent process and the structure of the current process, it is determined whether the instruction to trigger the target kernel function has the target permission.

[0111] As another embodiment of the present application, the structure of the leader process includes the leader process identification number, the structure of the first parent process includes the first parent process identification number, and the structure of the current process includes the current process identification number;

[0112] Based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process, it is determined whether the triggering target kernel function instruction has the target permission, including:

[0113] Determine whether any one of the group leader process identification number, the first parent process identification number, and the current process identification number meets a preset condition;

[0114] When any one of the group leader process identity number, the first parent process identity number and the current process identity number meets the preset condition, determining that the judgment result is that the target permission is possessed; or

[0115] When the group leader process identity number, the first parent process identity number and the current process identity number do not meet the preset conditions, it is determined that the judgment result is that the target permission is not possessed.

[0116] It should be noted that the SHELL permissions of the instructions passed to the Linux kernel by the SHELL interpreter can be represented by an identity identification number (UID), and the SHELL permissions of the SHELL interpreter are fixed values, which can be represented as UID equal to 2000.

[0117] Specifically, when the electronic device determines that the current process has a group leader process and a first parent process, it can determine whether any one of the group leader process identity number, the first parent process identity number and the current process identity number meets a preset condition, and the preset condition can be set as the above-mentioned UID equal to 2000. In other words, the structure of the group leader process, the structure of the first parent process and the structure of the current process all have their own corresponding identity numbers, and each identity number can correspond to a numerical value. By determining whether any one of the numerical values ​​of the group leader process identity number, the first parent process identity number and the current process identity number is equal to 2000, the judgment result of whether the triggering target kernel function instruction has the target permission is determined.

[0118] It is possible that if it is detected that the value corresponding to any one of the group leader process identity number, the first parent process identity number and the current process identity number is equal to 2000, it means that at least one of the three structures of the group leader process, the first parent process and the current process has SHELL permission, and the judgment result can be determined to have the target permission.

[0119] It is possible that if it is detected that the numerical value corresponding to any of the group leader process identity number, the first parent process identity number and the current process identity number is not equal to 2000, it means that none of the three structures of the group leader process, the first parent process and the current process has the SHELL permission, and the judgment result can be determined as not having the target permission.

[0120] It can be understood here that if the current process only has a group leader process, it can be detected whether the value corresponding to any one of the group leader process identity number and the current process identity number is equal to 2000. If it is detected, it means that at least one of the two structures of the group leader process and the current process has SHELL permissions, and then the judgment result can be determined to have the target permission. If it is not detected, it means that none of the two structures of the group leader process and the current process has SHELL permissions, and then the judgment result can be determined to not have the target permission.

[0121] In an embodiment of the present application, whether the instruction to trigger the target kernel function has the target permission can be judged by combining whether the values ​​corresponding to the identity identification numbers in the three structures of the group leader process, the first parent process and the current process are equal to 2000. The accuracy of the judgment result can be improved while maximizing the scope of the process that detects whether it has the target permission, thereby further enhancing the various defense capabilities against the target kernel function.

[0122] Step 806: When the current process identification number is equal to the group leader process identification number, it is determined that the current process does not have a group leader process, and a structure of a second parent process generated based on the second interface is obtained.

[0123] Step 807: When the structure of the second parent process is detected, determine whether the instruction to trigger the target kernel function has the target permission based on the structure of the second parent process and the structure of the current process.

[0124] It is possible that if the numerical value corresponding to the current process identification number in the structure of the current process is equal to the numerical value corresponding to the group leader process identification number, and the structure of the second parent process corresponding to the process obtained based on the fork interface is obtained, it can be determined whether the instruction to trigger the target kernel function has the target permission based on the permissions of the two processes, the structure of the second parent process and the structure of the current process.

[0125] As another embodiment of the present application, the structure of the second parent process includes the second parent process identification number, and the structure of the current process includes the current process identification number;

[0126] Based on the structure of the second parent process and the structure of the current process, it is determined whether the instruction that triggers the target kernel function has the target permission, including:

[0127] Determine whether any one of the second parent process identity number and the current process identity number meets a preset condition;

[0128] When any one of the second parent process identity number and the current process identity number meets a preset condition, determining that the judgment result is that the target permission is possessed; or

[0129] When neither the second parent process identity number nor the current process identity number satisfies the preset condition, it is determined that the judgment result is that the target permission is not possessed.

[0130] Specifically, when the electronic device determines that the current process does not have a group leader process and has a second parent process generated by the second interface, the electronic device can judge the structure of the second parent process and the structure of the current process according to the preset judgment process order. If possible, it can be determined first whether the second parent process identity number meets the preset conditions. If the preset conditions are met, the judgment is terminated and the judgment result is determined to have permission. If the preset conditions are not met, it is determined whether the current process identity number meets the preset conditions. If the preset conditions are met, the result is determined to have permission. If the preset conditions are not met, the judgment result is determined to have no permission.

[0131] It is possible to prioritize whether the current process identity number satisfies the preset conditions. If so, the judgment is terminated and the judgment result is determined to be permission granted. If not, the second parent process identity number is judged to be whether it satisfies the preset conditions. If so, the result is determined to be permission granted. If not, the judgment result is determined to be not permission granted.

[0132] In an embodiment of the present application, the electronic device can make an orderly judgment on whether the instruction that triggers the target kernel function has the target authority according to a preset judgment process sequence. This can improve the detection efficiency while ensuring the multi-faceted defense capabilities of the target kernel function, thereby bringing a better experience to users.

[0133] Step 808: If the structure of the second parent process is not detected, determine whether the instruction that triggers the target kernel function has the target permission based on the structure of the current process.

[0134] It is possible that if the numerical value corresponding to the current process identification number in the structure of the current process is equal to the numerical value corresponding to the group leader process identification number, and the structure of the corresponding second parent process in the process obtained based on the fork interface is not detected, it indicates that the current process does not have any parent process and can be used as a group leader process. Based on the permissions of the structure of the current process, it can be directly judged whether the instruction to trigger the target kernel function has the target permissions.

[0135] As another embodiment of the present application, the structure of the current process includes the current process identification number;

[0136] Based on the structure of the current process, determine whether the instruction that triggers the target kernel function has the target permission, including:

[0137] When the current process identity number meets the preset conditions, the judgment result is determined to have the target permission; or

[0138] When the current process identity number does not meet the preset condition, it is determined that the judgment result is that the target permission is not possessed.

[0139] Specifically, when the electronic device determines that the current process does not have a group leader process and a second parent process generated by a second interface, it determines whether the current process identity identification number meets a preset condition. If the preset condition is met, the judgment result is determined to be that the process has the authority; if the preset condition is not met, the judgment result is determined to be that the process does not have the authority.

[0140] In an embodiment of the present application, the electronic device can make an orderly judgment on whether the instruction that triggers the target kernel function has the target authority according to a preset judgment process sequence. This can improve the detection efficiency while ensuring the multi-faceted defense capabilities of the target kernel function, thereby bringing a better experience to users.

[0141] Step 809: Process the current process according to the result of determining whether the instruction that triggers the target kernel function has the target permission.

[0142] It should be noted that any one of the above-mentioned steps 802, 804 and 806 can be selected for execution. This embodiment does not impose too many restrictions.

[0143] In an embodiment of the present application, a variety of methods are proposed for determining whether the instruction that triggers the target kernel function has the target permission, based on whether the current process has a group leader process and whether it has a parent process. The judgment result can be effectively judged based on the process actually created to ensure the accuracy of the detection result.

[0144] As another embodiment of the present application, it is determined whether any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets the preset conditions. If any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets the preset conditions, the judgment result is determined to have the target authority specifically as follows:

[0145] In accordance with the preset order, determine whether the group leader process identity number, the first parent process identity number and the current process identity number meet the preset conditions. When the currently determined identity number meets the preset conditions, end the determination of the next identity number and determine that the determination result is the specific target permission.

[0146] Specifically, when the electronic device determines that the current process includes a leader process and a first parent process, it can judge whether the leader process identity number, the first parent process identity number and the current process identity number meet preset conditions according to a preset process judgment order.

[0147] It is possible that the preset judgment process sequence is to first judge whether the identity identification number of the group leader process meets the preset conditions. If the preset conditions are met, the judgment is terminated and the judgment result is determined to be authorized. If the preset conditions are not met, then judge whether the identity identification number of the first parent process meets the preset conditions. If the preset conditions are met, the judgment is terminated and the judgment result is determined to be authorized. If the preset conditions are not met, then judge whether the identity identification number of the current process meets the preset conditions. If the preset conditions are met, the judgment result is determined to be authorized. If the preset conditions are not met, the judgment result is determined to be not authorized.

[0148] Specifically, taking the above judgment process sequence as an example, please refer to Fig. 9 The overall flow chart of a kernel function reinforcement method provided by an embodiment of the present application is shown. The kernel function reinforcement method can be applied to the situation where the current process has a group leader process and a first parent process.

[0149] like Fig. 9 As shown in the figure, the overall process of the kernel function hardening method includes:

[0150] Step 901: When a triggering target kernel function instruction is detected, a structure of a group leader process and a structure of a first parent process generated based on a first interface are obtained.

[0151] Step 902, determine whether the group leader process identity number meets the preset conditions, if so, go to step 906, if not, go to step 903.

[0152] Step 903, determine whether the first parent process identity number meets the preset conditions, if so, proceed to step 906, if not, proceed to step 904.

[0153] Step 904, determine whether the current process identity number meets the preset conditions, if so, go to step 906, if not, go to step 905.

[0154] Step 905: The result of the judgment is that the target permission is not possessed.

[0155] Step 906: The result of the judgment is that the target permission is obtained.

[0156] Step 907: If the result of the judgment is that the target permission is obtained, interception processing is performed; or if the result of the judgment is that the target permission is not obtained, triggering the target kernel function instruction is executed.

[0157] Specifically, when determining that the current process has a group leader process and a first parent process, the electronic device may first determine whether the identity number of the group leader process meets the preset conditions. If the preset conditions are met, the electronic device may end the determination and determine that the determination result is that the process has the authority. If the preset conditions are not met, the electronic device may then determine whether the identity number of the first parent process meets the preset conditions. If the preset conditions are met, the electronic device may end the determination and determine that the process has the authority. If the preset conditions are not met, the electronic device may then determine whether the identity number of the current process meets the preset conditions. If the preset conditions are met, the electronic device may determine that the process has the authority. If the preset conditions are not met, the electronic device may further determine that the process does not have the authority. Further, when the determination result is that the process has the target authority, the electronic device may respond in a timely manner or intercept the process. When the determination result is that the process does not have the target authority, the electronic device may execute an instruction to trigger a target kernel function.

[0158] It is possible that the preset judgment process sequence is to first judge whether the identity identification number of the group leader process meets the preset conditions. If the preset conditions are met, the judgment is ended and the judgment result is determined to be authorized. If the preset conditions are not met, then judge whether the identity identification number of the current process meets the preset conditions. If the preset conditions are met, the judgment is ended and the judgment result is determined to be authorized. If the preset conditions are not met, then judge whether the identity identification number of the first parent process meets the preset conditions. If the preset conditions are met, the result is determined to be authorized. If the preset conditions are not met, the judgment result is determined to be not authorized.

[0159] It should be noted here that when judging the process order from the current process to the first parent process, it indicates that neither the current process nor the group leader process has the target permissions, but because the current process is directly hatched by the first parent process, the permissions of the first parent process are greater than or equal to the permissions of the current process. If the permissions of the current process do not meet the preset conditions, it is impossible to determine whether the first parent process meets the preset conditions, and if the first parent process has the target permissions, it will also execute the instruction to trigger the target kernel function.

[0160] It is possible that the preset judgment process sequence is to first judge whether the identity identification number of the current process meets the preset conditions. If the preset conditions are met, the judgment is terminated and the judgment result is determined to be authorized. If the preset conditions are not met, whether the identity identification number of the first parent process meets the preset conditions. If so, the judgment is terminated and the judgment result is determined to be authorized. If the preset conditions are not met, whether the identity identification number of the group leader process meets the preset conditions. If the preset conditions are met, the result is determined to be authorized. If the preset conditions are not met, the judgment result is determined to be not authorized.

[0161] The embodiments of the present application may not be limited to the judgment process sequence mentioned above. The specific judgment method can be found above and will not be elaborated here.

[0162] It can also be understood that if the current process has a group leader process and the process group including the group leader process has at least four processes, in other words, the process group includes the current process, the group leader process, the first parent process and other processes, you can also refer to the above Fig. 9 The kernel function reinforcement method shown. Specifically, taking the process group including four processes as an example, they can be the leader process, other processes, the first parent process and the current process, wherein the other processes can be directly hatched by the leader process, and the first parent process can be directly hatched by other processes. After obtaining the structure of the leader process and the structure of the first parent process, the electronic device can also first determine whether the identity identification number of the leader process meets the preset conditions. If the preset conditions are met, the judgment is terminated and the judgment result is determined to have authority. If the preset conditions are not met, the identity identification number of the first parent process is determined to meet the preset conditions. If the preset conditions are met, the judgment is terminated and the judgment result is determined to have authority. If the preset conditions are not met, the identity identification number of the current process is determined to meet the preset conditions. If the preset conditions are met, the judgment result is determined to have authority. If the preset conditions are not met, the judgment result is determined to have no authority. Further, when the judgment result is that the target authority is present, the electronic device can react in time or intercept the process. When the judgment result is that the target authority is not present, the electronic device can execute the instruction to trigger the target kernel function.

[0163] In an embodiment of the present application, the electronic device can make an orderly judgment on whether the instruction that triggers the target kernel function has the target authority according to a preset judgment process sequence. This can improve the detection efficiency while ensuring the multi-faceted defense capabilities of the target kernel function, thereby bringing a better experience to users.

[0164] It should be noted that when the trigger target kernel function instruction detected by the electronic device is directly sent by an application installed on the electronic device, that is, the reinforcement system architecture of the current kernel function is directly composed of the electronic device, since the identity identification number corresponding to the instruction sent by the application belongs to a specific preset range, the preset condition mentioned above can be changed to the preset range here. Among them, the specific preset range can be that the value of UID is greater than 10000, that is, the preset condition can be changed to UID greater than or equal to 10000.

[0165] Possibly, when the electronic device determines that the current process does not have a group leader process based on the current process identification number and the group leader process identification number of the current process, it can determine whether the value corresponding to the identity identification number of the current process is greater than or equal to 10000. If the identity identification number of the current process satisfies the requirement of being greater than or equal to 10000, it can be determined that the judgment result has the target permission. If the identity identification number of the current process does not satisfy the requirement of being greater than or equal to 10000, it can be determined that the judgment result does not have the target permission. It can be understood that the present embodiment can also obtain the structure of the second parent process generated based on the second interface, and determine whether the value corresponding to the identity identification number of the second parent process is greater than or equal to 10000 when the second parent process structure is detected. If the identity identification number of the current process satisfies the requirement of being greater than or equal to 10000, it can be determined that the judgment result has the target permission. If the identity identification number of the current process does not satisfy the requirement of being greater than or equal to 10000, it can be determined that the judgment result does not have the target permission.

[0166] Possibly, when the electronic device determines that the current process has a leader process based on the current process identification number and the leader process identification number of the current process, the leader process identification number can be obtained, and the value corresponding to the leader process identification number can be determined to be greater than or equal to 10000. If the leader process identification number satisfies the requirement of being greater than or equal to 10000, the judgment result can be determined to have the target authority. If the leader process identification number does not satisfy the requirement of being greater than or equal to 10000, the judgment result can be determined to not have the target authority. It can be understood that the embodiment here may not limit the order of the processes to be judged, that is, if any one of the leader process identification number, the first parent process identification number, and the current process identification number satisfies the requirement of being greater than or equal to 10000, the target authority can be determined. If any one of the leader process identification number, the first parent process identification number, and the current process identification number does not satisfy the requirement of being greater than or equal to 10000, the target authority can be determined to be not possessed.

[0167] This embodiment is not limited to setting the preset condition to be equal to 2000 or greater than or equal to 10000 alone. For example, the preset condition can be set to be greater than or equal to 2000 and less than or equal to 10000. Possibly, when the electronic device determines that the current process does not have a leader process based on the current process identification number and the leader process identification number of the current process, it can be determined based on the value corresponding to the identity identification number of the current process whether it is greater than or equal to 2000 and less than or equal to 10000. If the identity identification number of the current process satisfies the condition of being greater than or equal to 2000 and less than or equal to 10000, it can be determined that the judgment result has the target permission. If the identity identification number of the current process does not satisfy the condition of being greater than or equal to 2000 and less than or equal to 10000, it can be determined that the judgment result does not have the target permission.

[0168] It is possible that when the electronic device determines that the current process has a leader process based on the current process identification number and the leader process identification number of the current process, the identity identification number of the leader process can be obtained, and based on the numerical value corresponding to the identity identification number of the leader process, it can be determined whether it is greater than or equal to 2000 and less than or equal to 10000. If the identity identification number of the leader process satisfies the requirement of being greater than or equal to 2000 and less than or equal to 10000, the judgment result can be determined as having the target authority. If the identity identification number of the leader process does not satisfy the requirement of being greater than or equal to 2000 and less than or equal to 10000, the judgment result can be determined as not having the target authority.

[0169] As another embodiment of the present application, please refer to Fig.10 A flowchart of another kernel function hardening method provided in an embodiment of the present application is shown.

[0170] like Fig.10 As shown, the kernel function reinforcement method specifically includes the following steps:

[0171] Step 1001: When a triggering target kernel function instruction is detected, determine whether the triggering target kernel function instruction has target permissions based on the current process.

[0172] Step 1002: If the result of the judgment is that the target permission is possessed, the current process is recorded and reported.

[0173] Specifically, when the electronic device determines that the judgment result has the target authority, it indicates that the current trigger target kernel function instruction may be dangerous, and the current process created based on the trigger target kernel function instruction can be recorded, and the record can be stored and reported to the background server corresponding to the electronic device, and the background staff can track and process the initiator of the trigger target kernel function instruction. Among them, the content represented by the record can include the value corresponding to the identity number of any one of the current process, the parent process or the group leader process is equal to 2000, and the target kernel function instruction is triggered with SHELL authority. For example, taking the target kernel function as the kernel state calling the user state function as an example, the record can be represented as the value corresponding to the identity number of the current process is equal to 2000, and the kernel state calling the user state function is executed with SHELL authority. It can be understood that this embodiment is not limited to recording only a process whose identity number corresponds to 2000. For example, the record can also be represented as the value corresponding to the identity number of the current process is equal to 2000, and the value corresponding to the identity number of the parent process is equal to 2000, and the current process and the parent process are both executed with SHELL authority to call the kernel state calling the user state function.

[0174] Step 1003: When the result of the judgment is that the target permission is possessed, the current process is intercepted.

[0175] Specifically, when the electronic device determines that the judgment result is that it has the target permission, it indicates that the current triggering target kernel function instruction may be dangerous. The current process created based on the triggering target kernel function instruction can be stopped or an error function can be returned to prevent the current process from executing normally, thereby effectively preventing the target kernel function from being called.

[0176] Step 1004: When the result of the judgment is that the target permission is possessed, the current process is recorded, reported, and intercepted.

[0177] Specifically, when the electronic device determines that the judgment result is that it has the target permission, it indicates that the current triggering target kernel function instruction may be dangerous, and the current process created based on the triggering target kernel function instruction can be recorded, and the record can be stored and reported to the background server corresponding to the electronic device. At the same time, the current process created based on the triggering target kernel function instruction can be stopped or the error function can be returned. It can be understood that the content recorded here is not limited to including the value corresponding to the identity identification number of at least one process in the current process, parent process or group leader process is equal to 2000, and the target kernel function instruction is triggered with SHELL permission, and can also include the content indicating that the current process is intercepted.

[0178] Here, any one of the above-mentioned steps 1002, 1003 and 1004 may be selected for execution. This embodiment does not impose too many restrictions.

[0179] It should be noted that the above-mentioned recorded content exists in the electronic device in the form of a character string, which will not be elaborated here.

[0180] Step 1005: If the result of the judgment is that the target permission is not possessed, trigger the target kernel function based on the current process.

[0181] Specifically, when the electronic device determines that the judgment result is that it does not have the target permission, it indicates that there is no danger in the current instruction to trigger the target kernel function, and the instruction to trigger the target kernel function can continue to be executed based on the current process to call the target kernel function normally.

[0182] In an embodiment of the present application, when the judgment result is that the target permission is obtained, the instruction to trigger the target kernel function can be promptly processed as required, thereby effectively and quickly ensuring the security of the target kernel function, thereby achieving the effect of strengthening the protection of the target kernel function.

[0183] As another embodiment of the present application, after processing the current process according to the result of determining whether the current process has the target permission, the method further includes:

[0184] Displays prompt information corresponding to the target permissions.

[0185] Specifically, when the electronic device determines that the judgment result is that the target permission is obtained, it indicates that the current instruction to trigger the target kernel function may be dangerous, and prompt information that the target kernel function is called can be fed back to the user of the electronic device in a timely manner, so that the user can make corresponding processing in the first time. Among them, the type of prompt information here is not limited to short message prompts, interface pop-up prompt box prompts or voice prompts.

[0186] For details, please refer to Fig.11 A schematic diagram showing the effect of an electronic device displaying prompt information provided by an embodiment of the present application is shown.

[0187] like Fig.11 As shown, when the electronic device determines that the judgment result is that the target permission is possessed, a prompt dialog box 1101 may pop up on the current display interface 1100, and a text message "There is an illegal instruction!" is displayed on the prompt dialog box 1101, and an interception control 1102 and a reporting control 1103 are set below the text message. When the user receives the prompt dialog box 1101, he or she may choose to click the interception control 1102 or the reporting control 1103 according to the needs, so as to perform defense processing on the instruction that triggers the target kernel function.

[0188] See also Fig.12 , Fig.12 A schematic diagram of the structure of a kernel function hardening device provided in an embodiment of the present application is shown.

[0189] like Fig.12 As shown, the kernel function hardening device 1200 may include at least a first processing module 1201 and a second processing module 1202, wherein:

[0190] The first processing module 1201 is used to determine whether the triggering target kernel function instruction has the target permission based on the current process when the triggering target kernel function instruction is detected;

[0191] The second processing module 1202 is used to process the current process according to the judgment result of whether the instruction that triggers the target kernel function has the target permission.

[0192] In some possible embodiments, the structure of the current process includes the current process identification number and the group leader process identification number;

[0193] The first processing module 1201 includes:

[0194] A first judgment unit, used to judge whether the current process identification number is equal to the group leader process identification number;

[0195] The first processing unit is used to determine that the current process has a group leader process and obtain a structure of the group leader process when the current process identification number is not equal to the group leader process identification number;

[0196] A second judgment unit is used to judge whether the triggering target kernel function instruction has the target permission based on the structure of the group leader process and the structure of the current process;

[0197] The leader process and the current process are in the first process group, the first process group includes the leader process and the current process, and the current process is obtained by the leader process.

[0198] In some possible embodiments, the structure of the current process includes the current process identification number and the group leader process identification number;

[0199] The first processing module 1201 includes:

[0200] A first judgment unit, used to judge whether the current process identification number is equal to the group leader process identification number;

[0201] a second processing unit, configured to determine, when the current process identification number is not equal to the group leader process identification number, that the current process has a group leader process, and to obtain a structure of the group leader process and a structure of the first parent process generated based on the first interface;

[0202] A third judgment unit is used to judge whether the instruction to trigger the target kernel function has the target permission based on the structure of the group leader process, the structure of the first parent process and the structure of the current process;

[0203] Among them, the group leader process, the first parent process and the current process are in the second process group, the second process group at least includes the group leader process, the first parent process and the current process, and the current process is obtained from the first parent process, and the first parent process is obtained from the group leader process.

[0204] In some possible embodiments, the structure of the current process includes the current process identification number and the group leader process identification number;

[0205] The first processing module 1201 includes:

[0206] A first judgment unit, used to judge whether the current process identification number is equal to the group leader process identification number;

[0207] a third processing unit, configured to determine that the current process does not have a group leader process when the current process identification number is equal to the group leader process identification number;

[0208] An acquisition unit, used for acquiring a structure of a second parent process generated based on a second interface;

[0209] a fourth judgment unit, configured to judge whether the instruction to trigger the target kernel function has the target permission based on the structure of the second parent process and the structure of the current process when the structure of the second parent process is detected; wherein the second parent process and the current process are in a third process group, the third process group includes at least the second parent process and the current process, and the current process is obtained by the second parent process; or

[0210] In the case where the structure of the second parent process is not detected, it is determined whether the instruction triggering the target kernel function has the target permission based on the structure of the current process.

[0211] In some possible embodiments, the structure of the leader process includes the leader process identification number, the structure of the first parent process includes the first parent process identification number, and the structure of the current process includes the current process identification number;

[0212] The third judgment unit is specifically used for:

[0213] Determine whether any one of the group leader process identification number, the first parent process identification number, and the current process identification number meets a preset condition;

[0214] When any one of the group leader process identity number, the first parent process identity number and the current process identity number meets the preset condition, determining that the judgment result is that the target permission is possessed; or

[0215] When the group leader process identity number, the first parent process identity number and the current process identity number do not meet the preset conditions, it is determined that the judgment result is that the target permission is not possessed.

[0216] In some possible embodiments, the third judgment unit is specifically configured to:

[0217] In accordance with the preset order, determine whether the group leader process identity number, the first parent process identity number and the current process identity number meet the preset conditions. When the currently determined identity number meets the preset conditions, end the determination of the next identity number and determine that the determination result is the specific target permission.

[0218] In some possible embodiments, the third judgment unit is specifically configured to:

[0219] Determine whether the group leader process identity number meets the preset conditions;

[0220] When the group leader process identity number meets the preset conditions, the judgment result is determined to have the target authority;

[0221] If the group leader process identity number does not meet the preset conditions, determine whether the first parent process identity number meets the preset conditions;

[0222] When the first parent process identity number meets the preset condition, determining that the judgment result is that the target permission is possessed;

[0223] If the first parent process identity number does not meet the preset condition, determine whether the current process identity number meets the preset condition;

[0224] When the current process identity number meets the preset conditions, the judgment result is determined to have the target permission.

[0225] In some possible embodiments, the structure of the second parent process includes the second parent process identification number, and the structure of the current process includes the current process identification number;

[0226] The fourth judgment unit is specifically used for:

[0227] Determine whether any one of the second parent process identity number and the current process identity number meets a preset condition;

[0228] When any one of the second parent process identity number and the current process identity number meets a preset condition, determining that the judgment result is that the target permission is possessed; or

[0229] When neither the second parent process identity number nor the current process identity number satisfies the preset condition, it is determined that the judgment result is that the target permission is not possessed.

[0230] In some possible embodiments, the structure of the current process includes the current process identification number;

[0231] The fourth judgment unit is specifically used for:

[0232] When the current process identity number meets the preset conditions, the judgment result is determined to have the target permission; or

[0233] When the current process identity number does not meet the preset condition, it is determined that the judgment result is that the target permission is not possessed.

[0234] In some possible embodiments, the second processing module is used to:

[0235] If the result of the judgment is that the target permission is possessed, the current process is recorded and reported; or

[0236] If the result of the judgment is that the process has the target permission, the current process is intercepted; or

[0237] If the result of the judgment is that the target permission is possessed, the current process is recorded, reported and intercepted; or

[0238] If the result of the determination is that the target permission is not possessed, the target kernel function is triggered based on the current process.

[0239] In some possible embodiments, the device further includes:

[0240] The display module is used to display prompt information corresponding to the target permission.

[0241] See also Fig.13 , Fig.13 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.

[0242] like Fig.13 As shown, the electronic device 1300 may include: at least one processor 1301 , at least one network interface 1304 , a user interface 1303 , a memory 1305 , a display screen 1306 , and at least one communication bus 1302 .

[0243] The communication bus 1302 may be used to realize the connection and communication among the above-mentioned components.

[0244] The user interface 1303 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0245] The network interface 1304 may include, but is not limited to, a Bluetooth module, an NFC module, or a Wi-Fi module.

[0246] Among them, the processor 1301 may include one or more processing cores. The processor 1301 uses various interfaces and lines to connect various parts within the entire electronic device 1300, and executes various functions and processes data of the routing device 1300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1305, and calling data stored in the memory 1305. Optionally, the processor 1301 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The processor 1301 can integrate one or a combination of CPU, GPU, and modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 1301, but may be implemented separately through a chip.

[0247] Among them, the memory 1305 may include RAM and ROM. Optionally, the memory 1305 includes a non-transitory computer-readable medium. The memory 1305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 1305 may optionally be at least one storage device located away from the aforementioned processor 1301. As Fig.13 As shown, the memory 1305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a kernel function reinforcement application.

[0248] Specifically, the processor 1301 may be used to call the kernel function hardening application stored in the memory 1305, and specifically perform the following operations:

[0249] When a triggering target kernel function instruction is detected, determining whether the triggering target kernel function instruction has the target permission based on the current process;

[0250] The current process is processed according to the judgment result of whether the instruction that triggers the target kernel function has the target permission.

[0251] In some possible embodiments, the structure of the current process includes the current process identification number and the group leader process identification number;

[0252] When the processor 1301 determines whether the instruction to trigger the target kernel function has the target permission based on the current process, it specifically executes:

[0253] Determine whether the current process identification number is equal to the group leader process identification number;

[0254] When the current process identification number is not equal to the group leader process identification number, it is determined that the current process has a group leader process, and the structure of the group leader process is obtained;

[0255] Based on the structure of the group leader process and the structure of the current process, it is determined whether the instruction to trigger the target kernel function has the target permission;

[0256] The leader process and the current process are in the first process group, the first process group includes the leader process and the current process, and the current process is obtained by the leader process.

[0257] In some possible embodiments, the structure of the current process includes the current process identification number and the group leader process identification number;

[0258] When the processor 1301 determines whether the instruction to trigger the target kernel function has the target permission based on the current process, it specifically executes:

[0259] Determine whether the current process identification number is equal to the group leader process identification number;

[0260] When the current process identification number is not equal to the group leader process identification number, determining that the current process has a group leader process, and obtaining a structure of the group leader process and a structure of the first parent process generated based on the first interface;

[0261] Based on the structure of the group leader process, the structure of the first parent process and the structure of the current process, it is determined whether the triggering target kernel function instruction has the target permission;

[0262] Among them, the group leader process, the first parent process and the current process are in the second process group, the second process group at least includes the group leader process, the first parent process and the current process, and the current process is obtained from the first parent process, and the first parent process is obtained from the group leader process.

[0263] In some possible embodiments, the structure of the current process includes the current process identification number and the group leader process identification number;

[0264] When the processor 1301 determines whether the instruction to trigger the target kernel function has the target permission based on the current process, it specifically executes:

[0265] Determine whether the current process identification number is equal to the group leader process identification number;

[0266] When the current process identification number is equal to the group leader process identification number, determining that the current process does not have a group leader process;

[0267] Get the structure of the second parent process generated based on the second interface;

[0268] In the case where the structure of the second parent process is detected, judging whether the instruction to trigger the target kernel function has the target permission based on the structure of the second parent process and the structure of the current process; wherein the second parent process and the current process are in a third process group, the third process group includes at least the second parent process and the current process, and the current process is obtained by the second parent process; or

[0269] In the case where the structure of the second parent process is not detected, it is determined whether the instruction triggering the target kernel function has the target permission based on the structure of the current process.

[0270] In some possible embodiments, the structure of the leader process includes the leader process identification number, the structure of the first parent process includes the first parent process identification number, and the structure of the current process includes the current process identification number;

[0271] When the processor 1301 determines whether the triggering target kernel function instruction has the target permission based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process, the following is specifically performed:

[0272] Determine whether any one of the group leader process identification number, the first parent process identification number, and the current process identification number meets a preset condition;

[0273] When any one of the group leader process identity number, the first parent process identity number and the current process identity number meets the preset condition, determining that the judgment result is that the target permission is possessed; or

[0274] When the group leader process identity number, the first parent process identity number and the current process identity number do not meet the preset conditions, it is determined that the judgment result is that the target permission is not possessed.

[0275] In some possible embodiments, the processor 1301 determines whether any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets the preset condition. When any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets the preset condition, the processor 1301 determines that the judgment result is that the target permission is obtained, and specifically executes:

[0276] In accordance with the preset order, determine whether the group leader process identity number, the first parent process identity number and the current process identity number meet the preset conditions. When the currently determined identity number meets the preset conditions, end the determination of the next identity number and determine that the determination result is the specific target permission.

[0277] In some possible embodiments, the processor 1301 determines in sequence in a preset order whether any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets the preset condition. When the currently determined identity number meets the preset condition, the determination of the next identity number is terminated. When it is determined that the determination result is a specific target permission, the following is specifically performed:

[0278] Determine whether the group leader process identity number meets the preset conditions;

[0279] When the group leader process identity number meets the preset conditions, the judgment result is determined to have the target authority;

[0280] If the group leader process identity number does not meet the preset conditions, determine whether the first parent process identity number meets the preset conditions;

[0281] When the first parent process identity number meets the preset condition, determining that the judgment result is that the target permission is possessed;

[0282] If the first parent process identity number does not meet the preset condition, determine whether the current process identity number meets the preset condition;

[0283] When the current process identity number meets the preset conditions, the judgment result is determined to have the target permission.

[0284] In some possible embodiments, the structure of the second parent process includes the second parent process identification number, and the structure of the current process includes the current process identification number;

[0285] When the processor 1301 determines whether the triggering target kernel function instruction has the target permission based on the structure of the second parent process and the structure of the current process, the processor 1301 specifically executes:

[0286] Determine whether any one of the second parent process identity number and the current process identity number meets a preset condition;

[0287] When any one of the second parent process identity number and the current process identity number meets a preset condition, determining that the judgment result is that the target permission is possessed; or

[0288] When neither the second parent process identity number nor the current process identity number satisfies the preset condition, it is determined that the judgment result is that the target permission is not possessed.

[0289] In some possible embodiments, the structure of the current process includes the current process identification number;

[0290] When the processor 1301 determines whether the triggering target kernel function instruction has the target permission based on the structure of the current process, it specifically executes:

[0291] When the current process identity number meets the preset conditions, the judgment result is determined to have the target permission; or

[0292] When the current process identity number does not meet the preset condition, it is determined that the judgment result is that the target permission is not possessed.

[0293] In some possible embodiments, when the processor 1301 processes the current process according to the result of determining whether the current process has the target permission, the processor 1301 specifically executes:

[0294] If the result of the judgment is that the target permission is possessed, the current process is recorded and reported; or

[0295] If the result of the judgment is that the process has the target permission, the current process is intercepted; or

[0296] If the result of the judgment is that the target permission is possessed, the current process is recorded, reported and intercepted; or

[0297] If the result of the determination is that the target permission is not possessed, the target kernel function is triggered based on the current process.

[0298] In some possible embodiments, after processing the current process according to the result of determining whether the current process has the target permission, the processor 1301 is further configured to execute:

[0299] Displays prompt information corresponding to the target permissions.

[0300] The embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a computer or a processor, the computer or the processor executes the above-mentioned Figure 3 or Figure 5 or Figure 6 or Figure 7 or Figure 8 or Fig.10 One or more steps in the illustrated embodiment. If the components of the electronic device described above are implemented in the form of software functional units and sold or used as independent products, they can be stored in the computer-readable storage medium.

[0301] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted by the computer-readable storage medium. The computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0302] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes. In the absence of conflict, the technical features in this embodiment and the implementation scheme can be combined arbitrarily.

[0303] The embodiments described above are merely preferred embodiments of the present application and are not intended to limit the scope of the present application. Without departing from the design spirit of the present application, various modifications and improvements made to the technical solutions of the present application by ordinary technicians in this field should fall within the protection scope determined by the claims of the present application.

Claims

1. A kernel function reinforcement method, characterized in that: include: In the case of detecting a trigger target kernel function instruction, determining whether the trigger target kernel function instruction has a target permission based on the current process; wherein the target kernel function is a kernel state calling a user state function; the target permission is a shell permission for transmitting a shell interpreter that represents the execution of the call target kernel function instruction, and the shell permission of the shell interpreter is a fixed value; Processing the current process according to a result of determining whether the triggering target kernel function instruction has the target permission; The structure of the current process includes the current process identification number and the group leader process identification number; The determining, based on the current process, whether the triggering target kernel function instruction has the target permission includes: Determine whether the current process identification number is equal to the group leader process identification number; When the current process identification number is not equal to the group leader process identification number, determining that the current process has a group leader process, and obtaining a structure of the group leader process and a structure of a first parent process generated based on a first interface; wherein the first interface is a new interface for creating a process; Determining whether the trigger target kernel function instruction has target permission based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process; The group leader process, the first parent process, and the current process are in a second process group. The second process group includes at least the group leader process, the first parent process, and the current process. The current process is hatched by the first parent process based on the new interface, and the first parent process is hatched by the group leader process based on the new interface. The structure of the group leader process includes the group leader process identification number, the structure of the first parent process includes the first parent process identification number, and the structure of the current process includes the current process identification number; The determining whether the trigger target kernel function instruction has target permissions based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process includes: Determine whether any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets a preset condition; the preset condition is that the identity number is equal to the fixed value.

2. The method according to claim 1, characterized in that The structure of the current process includes the current process identification number and the group leader process identification number; The determining, based on the current process, whether the triggering target kernel function instruction has the target permission includes: Determine whether the current process identification number is equal to the group leader process identification number; When the current process identification number is not equal to the group leader process identification number, determining that the current process has a group leader process, and obtaining a structure of the group leader process; Determine whether the trigger target kernel function instruction has target permission based on the structure of the group leader process and the structure of the current process; The group leader process and the current process are in a first process group, the first process group includes the group leader process and the current process, and the current process is obtained by the group leader process.

3. The method according to claim 1, characterized in that The structure of the current process includes the current process identification number and the group leader process identification number; The determining, based on the current process, whether the triggering target kernel function instruction has the target permission includes: Determine whether the current process identification number is equal to the group leader process identification number; When the current process identification number is equal to the group leader process identification number, determining that the current process does not have the group leader process; Obtaining a structure of a second parent process generated based on a second interface; wherein the second interface is a fork interface for creating a process; When the structure of the second parent process is detected, determining whether the trigger target kernel function instruction has the target permission based on the structure of the second parent process and the structure of the current process; wherein the second parent process and the current process are in a third process group, the third process group includes at least the second parent process and the current process, and the current process is obtained by the second parent process; or In a case where the structure of the second parent process is not detected, it is determined whether the trigger target kernel function instruction has target permission based on the structure of the current process.

4. The method according to claim 1, wherein The determining whether the trigger target kernel function instruction has target permissions based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process includes: If any one of the group leader process identity number, the first parent process identity number, and the current process identity number meets a preset condition, determining that the judgment result is that the target permission is possessed; or When the group leader process identity number, the first parent process identity number, and the current process identity number do not meet the preset conditions, the judgment result is determined to be that the target permission is not possessed.

5. The method according to claim 4, characterized in that The determining whether any one of the group leader process identity number, the first parent process identity number, and the current process identity number satisfies a preset condition, and if any one of the group leader process identity number, the first parent process identity number, and the current process identity number satisfies the preset condition, determining that the determination result is that the process has the target permission is specifically: In accordance with the preset order, determine whether the group leader process identity number, the first parent process identity number and the current process identity number meet the preset conditions. When the currently judged identity number meets the preset conditions, end the judgment of the next identity number and determine that the judgment result is a specific target authority.

6. The method according to claim 5, characterized in that The determining, in a preset order, whether any one of the group leader process identity number, the first parent process identity number, and the current process identity number satisfies a preset condition, and if the currently determined identity number satisfies the preset condition, ending the determination of the next identity number, and determining that the determination result is a specific target permission, includes: Determine whether the group leader process identity number meets the preset conditions; When the group leader process identity number meets the preset condition, determining that the judgment result is that the group leader process identity number has the target permission; If the group leader process identification number does not meet the preset condition, determining whether the first parent process identification number meets the preset condition; If the first parent process identity number meets the preset condition, determining that the judgment result is that the process has the target permission; If the first parent process identification number does not meet the preset condition, determining whether the current process identification number meets the preset condition; When the current process identity number meets the preset condition, the judgment result is determined to be having the target permission.

7. The method according to claim 3, characterized in that The structure of the second parent process includes the second parent process identification number, and the structure of the current process includes the current process identification number; The determining, based on the structure of the second parent process and the structure of the current process, whether the triggering target kernel function instruction has target permissions includes: Determine whether any one of the second parent process identity identification number and the current process identity identification number meets a preset condition; If any one of the second parent process identity number and the current process identity number meets a preset condition, determining that the judgment result is that the target permission is possessed; or When neither the second parent process identity number nor the current process identity number satisfies a preset condition, the judgment result is determined to be that the target permission is not possessed.

8. The method according to claim 3, characterized in that The structure of the current process includes the current process identification number; The determining, based on the structure of the current process, whether the triggering target kernel function instruction has target permissions includes: If the current process identity number satisfies a preset condition, determining that the judgment result is that the process has the target permission; or In a case where the current process identity number does not meet a preset condition, the judgment result is determined to be not having the target permission.

9. The method according to any one of claims 1 to 8, characterized in that The processing of the current process according to the result of determining whether the current process has the target permission includes: If the judgment result is that the process has the target permission, record and report the current process; or If the judgment result is that the process has the target permission, intercept the current process; or If the judgment result is that the process has the target permission, recording, reporting and intercepting the current process; or If the judgment result is that the target permission is not possessed, the target kernel function is triggered based on the current process.

10. The method according to claim 9, characterized in that After processing the current process according to the result of determining whether the current process has the target permission, the method further includes: Display prompt information corresponding to the target permission.

11. A kernel function reinforcement device, characterized in that: include: A first processing module is configured to, upon detecting a triggering target kernel function instruction, determine whether the triggering target kernel function instruction has a target permission based on a current process; wherein the target kernel function is a kernel state calling a user state function; the target permission is a shell permission for transmitting a shell interpreter that represents the execution of the call target kernel function instruction, and the shell permission of the shell interpreter is a fixed value; A second processing module is used to process the current process according to the result of determining whether the trigger target kernel function instruction has the target permission; The structure of the current process includes the current process identification number and the group leader process identification number; The first processing module includes: A first judgment module is used to judge whether the current process identification number is equal to the group leader process identification number; a second processing unit, configured to, when the current process identification number is not equal to the group leader process identification number, determine that the current process has a group leader process, and obtain a structure of the group leader process and a structure of a first parent process generated based on a first interface; wherein the first interface is a new interface for creating a process; a third judging unit, configured to judge whether the trigger target kernel function instruction has target permission based on the structure of the group leader process, the structure of the first parent process, and the structure of the current process; The group leader process, the first parent process, and the current process are in a second process group. The second process group includes at least the group leader process, the first parent process, and the current process. The current process is hatched by the first parent process based on the new interface, and the first parent process is hatched by the group leader process based on the new interface. The structure of the group leader process includes the group leader process identification number, the structure of the first parent process includes the first parent process identification number, and the structure of the current process includes the current process identification number; The third judgment unit is specifically used to: judge whether any one of the group leader process identity number, the first parent process identity number and the current process identity number meets a preset condition; the preset condition is that the identity number is equal to the fixed value.

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

13. An electronic device, characterized in that: including a processor and a memory; The processor is connected to the memory; The memory is used to store executable program code; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the method according to any one of claims 1 to 10.