Memory management system, memory management method and electronic equipment
By introducing memory allocator and trusted driver module into the memory management system, the physical memory partitions of memory devices are managed and protected separately, which solves the problem that sensitive data cannot be effectively protected in the prior art, and significantly improves the security of memory data.
Patent Information
- Application Number
- CN202311164879.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-03-11
AI Technical Summary
Existing memory management systems cannot effectively distinguish and protect sensitive data, and there is a risk of illegal user intrusion and data leakage.
By introducing memory allocator and trusted driver module into the memory management system, the physical memory partitions of memory devices can be managed and protected separately. The system ensures that only legitimate users can access and modify sensitive data through authentication requests, identity authentication and key matching mechanisms, and hardware-level protection is carried out through protection rules and secure memory modules.
It effectively improves the security of memory data, prevents illegal users from reading or modifying sensitive data, and realizes monitoring and recording of illegal access behavior.
Smart Images

Figure CN119598436A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of storage technology and relates to a management system, and in particular to a memory management system, a memory management method and an electronic device. Background Art
[0002] Memory is an important component of electronic devices, also known as internal memory or main memory, which is used to temporarily store the operation data and program code for the processor, as well as the data exchanged with external memory such as hard disk. Memory is the bridge for external memory to communicate with the processor. Most programs in electronic devices run in memory. Therefore, the security of data stored in memory, especially sensitive data, is extremely important. However, for memory access from the outside, the memory itself cannot distinguish the legitimacy of memory access behavior, nor can it distinguish the sensitivity of data. This gives illegal users an opportunity to take advantage of. Once illegal users invade the memory, there is a possibility of arbitrarily obtaining or modifying sensitive data. Summary of the invention
[0003] The present application provides a memory management system, a memory management method and an electronic device for improving the security of memory data.
[0004] In a first aspect, an embodiment of the present application provides a memory management system, the system comprising: a memory allocator, for receiving a first memory access request for a target partition of a memory device and obtaining authentication information to generate an authentication request, wherein the memory allocator manages one or more physical memory partitions of the memory device, and the target partition is any one of the one or more physical memory partitions; a trusted driver module, for receiving the authentication request, and generating an authentication result based on the authentication information and authorization information obtained from the outside, and returning the authentication result to the memory allocator; the memory allocator is also used to execute the first memory access request when the authentication result is authentication success, and to reject the first memory access request when the authentication result is authentication failure.
[0005] In an implementation of the first aspect, the system further includes a device driver module, and the device driver module is used to configure protection rules for the one or more physical memory partitions respectively to restrict access to each physical memory partition.
[0006] In an implementation of the first aspect, the system also includes a secure memory module; the trusted driver module is also used to call the interface of the device driver module and send the first key to the device driver module when the authentication result is successful authentication; the device driver module is used to match the first key with the second key in the secure memory module, and close the protection rules of the target partition when the match is successful.
[0007] In an implementation manner of the first aspect, the secure memory module is further used to update the second key after the first key is matched with the second key.
[0008] In an implementation of the first aspect, the trusted driver module is also used to call the interface of the device driver module to notify the device driver module to re-enable the protection rules of the target partition after the memory allocator completes executing the first memory access request, and update the first key according to the updated second key.
[0009] In an implementation of the first aspect, the system also includes a secure memory module, which is used to receive a second memory access request for the target partition that is not from the memory allocator, and detect whether the second memory access request conflicts with the protection rules of the target partition, and when a conflict is detected, reject the second memory access request.
[0010] In an implementation manner of the first aspect, the secure memory module is further configured to generate an illegal access record when a conflict is detected.
[0011] In an implementation of the first aspect, the protection rule includes any one or more combinations of the following rules: data is prohibited from being read from the physical memory partition, data is prohibited from being written to the physical memory partition, and access to the physical memory partition is monitored.
[0012] In a second aspect, an embodiment of the present application provides a memory management method, which is applied to a memory management system, the system comprising a memory allocator and a trusted driver module, wherein the memory allocator manages one or more physical memory partitions of a memory device, and the method comprising: the memory allocator receives a first memory access request for a target partition and obtains authentication information to generate an authentication request, wherein the target partition is any one of the one or more physical memory partitions; the memory allocator sends an authentication request to the trusted driver module; the trusted driver module responds to the received authentication request and returns an authentication result to the memory allocator, wherein the trusted driver module generates the authentication result based on the authentication information in the authentication request and the authorization information obtained from the outside; the memory allocator executes the first memory access request when the authentication result is a successful authentication, and rejects the first memory access request when the authentication result is a failed authentication.
[0013] In an implementation of the second aspect, the system further includes a device driver module, and the method further includes: configuring protection rules for the one or more physical memory partitions respectively through the device driver module to restrict access to each physical memory partition.
[0014] In an implementation of the second aspect, the system also includes a secure memory module, and the method also includes: when the authentication result is successful authentication, the trusted driver module calls the interface of the device driver module and sends the first key to the device driver module; the device driver module matches the first key with the second key in the secure memory module, and closes the protection rules of the target partition when the match is successful.
[0015] In an implementation manner of the second aspect, the method further includes: after the first key and the second key are matched, the secure memory module updates the second key.
[0016] In an implementation of the second aspect, the method also includes: the trusted driver module calls the interface of the device driver module to notify the device driver module to re-enable the protection rules of the target partition after the memory allocator executes the first memory access request, and updates the first key according to the updated second key.
[0017] In an implementation of the second aspect, the system also includes a secure memory module, and the method also includes: when the secure memory module receives a second memory access request to the target partition that is not from the memory allocator, detecting whether the second memory access request conflicts with the protection rules of the target partition, and rejecting the memory access request when a conflict is detected.
[0018] In an implementation manner of the second aspect, the method further includes: the secure memory module generating an illegal access record when a conflict is detected.
[0019] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory storing a computer program; a processor communicating with the memory and executing a memory management method when calling the computer program; the memory management method is applied to a memory management system, the system comprising a memory allocator and a trusted driver module, the memory allocator managing one or more physical memory partitions of a memory device, the memory management method comprising: the memory allocator receiving a first memory access request for a target partition and obtaining authentication information to generate an authentication request, wherein the target partition is any one of the one or more physical memory partitions; the memory allocator sending an authentication request to the trusted driver module; the trusted driver module responding to the received authentication request and returning an authentication result to the memory allocator, wherein the trusted driver module generates the authentication result based on the authentication information in the authentication request and the authorization information obtained from the outside; the memory allocator executes the first memory access request when the authentication result is authentication success, and rejects the first memory access request when the authentication result is authentication failure.
[0020] The embodiment of the present application proposes the concept of "partition" management, that is, managing a part of physical memory separately, and providing multiple software and hardware protection mechanisms for the data stored in this part of physical memory through protection rules, identity authentication and keys to prevent illegal users from reading or modifying it. At the same time, the solution of the present application can monitor and record illegal access behaviors. These measures change the situation where the memory device can only act as a passive device, and greatly improve the security of the memory device. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1A Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application.
[0022] Figure 1B Shown is a flowchart of a memory management method in one embodiment of the present application.
[0023] Figure 1C Shown is a schematic diagram of an application scenario of a memory management method in an embodiment of the present application.
[0024] Figure 2 Shown is a flowchart of a memory management method in one embodiment of the present application.
[0025] Figure 3 Shown is an example diagram of authorization information in one embodiment of the present application.
[0026] Figure 4 Shown is a schematic diagram of the response process of the secure memory module to a memory access request in one embodiment of the present application.
[0027] Figure 5 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0029] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0030] In electronic devices, the data required by the processor for operation is mainly stored in the memory. This data may include some sensitive data, such as identity information, keys, session tokens, etc. In some technical solutions, the processor will provide some security features to ensure the security of sensitive data in the memory. However, as a passive storage device, the memory cannot distinguish the sensitivity of the data, nor can it distinguish the legality of memory access. Therefore, when there is a vulnerability in the system and it is exploited by illegal users, the memory device cannot distinguish the legality of data access or modification. Regardless of the data access request from a legitimate user or an illegal user, the memory device will respond and return or update the data. This will cause the leakage of sensitive data in the memory, which is not conducive to data security in the system.
[0031] In addition, from the perspective of the operating system, all memory resources are equal and all memory resources will be used fairly during the application process. Therefore, when processing user memory allocation requests, the operating system will randomly allocate physical memory to the user. For the user's sensitive data, it is usually scattered in different areas of the memory in physical memory, which further increases the difficulty of protecting sensitive data in memory.
[0032] Furthermore, during the application process, the device may have vulnerabilities. Illegal users may use these vulnerabilities to access the data in the memory, thereby threatening the security of the data in the memory.
[0033] At least to address the above-mentioned problems, an embodiment of the present application provides a memory allocator and a memory management system and method based on the memory allocator. The embodiment of the present application can be applied to electronic devices. Figure 1A The structure diagram of the electronic device 100 in the embodiment of the present application is shown. Figure 1A As shown, the electronic device 100 includes a processor 101 connected to one or more storage units. The storage unit may include an external storage device 106 and a memory device 104. The external storage device 106 may be read-only, such as a read-only memory (ROM), or readable and writable, such as a hard disk or a flash memory. The memory device 104 may be a random access memory (RAM). The memory device 104 may be integrated with the processor 101 or may be an independent component. The processor 101 is the control center of the electronic device 100, and is used to execute program codes to implement functions corresponding to the program instructions. Optionally, the processor 101 includes one or more central processing units (CPU), such as Figure 1A Optionally, the electronic device 100 includes more than one processor, for example, Figure 1A The processors 101 and 107 are shown. Both the processors 101 and 107 can be single-core processors or multi-core processors. The term "processor" as used herein includes one or more devices, circuits and / or processing cores for processing data such as computer program instructions.
[0034] The CPU of processor 101 and / or 107 stores the executed program code in memory device 104 or external storage device 106. The program code stored in external storage device 106 can be copied to memory device 104 for execution by the processor. The processor can control the execution of the program, control the communication between the electronic device and the peripheral device, and control the allocation of resources of electronic device 100.
[0035] The electronic device 100 may further include a communication interface 105 , and the electronic device 100 may communicate with another device or system via the communication interface 105 or an external network.
[0036] Optionally, the electronic device 100 may further include an output device 102 and an input device 103. The output device 102 is connected to the processor 101 and can display output information in one or more ways. An example of the output device 102 is a visual display device, such as a liquid crystal display (LCD), a light-emitting diode (LED) display, a cathode ray tube (CRT) or a projector. The input device 103 is connected to the processor 101 and can receive user input in one or more ways. Examples of the input device 103 include a mouse, a keyboard, a touch screen device, a sensing device, etc.
[0037] In some embodiments, the electronic device 100 may also include a secure memory module (not shown in the figure), which has the function of protecting the memory address (i.e., configuring protection rules), and may also have the function of automatic key generation and matching. Its function of protecting the memory address may include: making a certain memory area read-only, hiding a certain memory area, and recording access to a certain memory area (such as read and write operations). Its key generation function includes automatically generating and updating keys for administrators or related modules to read. Key matching is required for some or all operations of the electronic device 100. If the match fails, the electronic device 100 will ignore the user's related operations; if the match is successful, the user can operate the electronic device 100. After completing the relevant operations, the administrator or the relevant module can read the new key again and save it for the next key matching operation.
[0038] The above elements of the electronic device 100 may be connected to each other via any one or more combinations of buses such as a data bus, an address bus, a control bus, an extension bus, and a local bus.
[0039] The electronic device 100 may be a general electronic device or a specific electronic device. As an example, the electronic device 100 may be a storage array, an application server, a supercomputer, a desktop computer, a notebook computer, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a telecommunication device, or a computer having a plurality of Figure 1A Any other device with similar structure as shown. However, the present application is not limited to any particular type of electronic device.
[0040] The memory allocator provided by the present application and the memory management system and method based on the memory allocator will be described in detail below.
[0041] The memory allocator in the embodiment of the present application can manage a portion of physical memory independently, and combine with the trusted module to provide a software protection mechanism for the data stored in this portion of physical memory, and provide a system-compatible interface to the user for user access; at the same time, the memory allocator can cooperate with the secure memory module (hardware module) in the system to provide the user with a hardware protection mechanism.
[0042] See also Figure 1B In some implementations, the memory management method may include:
[0043] S11, when the system is initialized, based on a user's request, a portion of physical memory is divided from the physical memory of the memory device and managed by a memory allocator, wherein the portion of physical memory includes one or more physical memory partitions.
[0044] Specifically, in an embodiment of the present application, a user can partition the physical memory of a memory device according to his or her needs. In some embodiments, a user can reserve a portion of the physical memory from the physical memory of a memory device during system initialization and hand it over to a memory allocator for management, while the remaining physical memory is still managed by the operating system. In other words, the entire physical memory of the memory device is divided into two major parts, one part is managed by the operating system, and the other part is managed by the memory allocator. It can be understood that for the physical memory area managed by the memory allocator, the user cannot access it through the operating system, that is, the physical memory area managed by the memory allocator is not visible to the operating system. In order to distinguish it from the physical memory area managed by the operating system, the physical memory area managed by the memory allocator will be referred to as the secure memory area below.
[0045] In some implementations, the user can further partition the secure memory area as needed, such as Figure 1C As shown, the secure memory area is divided into N physical memory partitions with continuous addresses (also referred to as "partitions"), where N is a positive integer. The sizes of these partitions can be equal or unequal, and the embodiments of the present application do not limit this. Dividing the secure memory area into multiple physical memory partitions allows users to classify and store data in different physical memory partitions according to the characteristics of the data (such as type, security level, etc.), which is conducive to data management.
[0046] In an embodiment of the present application, a user can configure protection rules for a secure memory area as required, and the protection rules can be, for example, prohibiting reading data, prohibiting writing data, monitoring access operations, etc. In other words, a user can prohibit a certain type or several types of memory access behaviors by configuring protection rules, thereby providing protection for data stored in the secure memory area, preventing data from being read or modified by illegal users, etc. In some embodiments, when the secure memory area is divided into multiple partitions, the user can configure different protection rules for these partitions as required, thereby providing different types of protection for data in different partitions. In some embodiments, the user can set protection rules through a software driver module (hereinafter referred to as a device driver module) corresponding to the secure memory module.
[0047] S12, generating corresponding access paths for one or more physical memory partitions respectively.
[0048] Specifically, in an embodiment of the present application, after the user divides the secure memory area into N partitions, the file system of the memory allocator can initialize each partition to generate an access path for each partition, and the user can access the corresponding partition through the access path. In some embodiments, during the process of initializing the physical memory partition by the file system, the user can specify the access path for each partition. In some embodiments, the access path can be presented to the user in the form of a file or a file directory, and the user can directly access the corresponding partition under the file or file directory.
[0049] S13, receiving and processing, through the memory allocator, a first memory access request sent via the access path.
[0050] Specifically, after the access path is generated, the user can send a memory access request to the memory allocator through the access path, and the memory allocator will respond according to the user's memory access request. The response process of the memory allocator will be specifically described below.
[0051] See also Figure 1C , Figure 1C The structure diagram of the memory management system provided by the embodiment of the present application is shown. Figure 1C As shown, the memory management system includes a memory allocator, a trusted driver module, a device driver module and a secure memory module. The secure memory module is a hardware module, and the device driver module is a software driver module corresponding to the secure memory module.
[0052] After receiving the memory access request, the memory allocator generates an authentication request and sends the authentication request to the trusted driver module for authentication to confirm whether the user has access rights or is a trusted user.
[0053] The trusted driver module is used to respond to the authentication request sent by the memory allocator and feed back the authentication result to the memory allocator.
[0054] When the trusted driver module succeeds in authentication, it can call the interface of the device driver module to disable the protection rules of the target partition, and call the interface of the device driver module again to re-enable the protection rules of the target partition after the access to the target partition ends. The target partition is the physical memory partition corresponding to the memory access request.
[0055] Figure 2 The flowchart of the memory management method in one embodiment of the present application is shown. The memory management method can be applied to Figure 1C The memory management system shown in Figure 1 is as follows. Figure 2 As shown, the memory management method provided in the embodiment of the present application includes:
[0056] S21, the memory allocator receives a memory access request for a target partition and obtains authentication information to generate an authentication request, wherein the target partition is any one of the one or more physical memory partitions managed by the memory allocator. The memory access request may be sent by a user through an application.
[0057] S22, the memory allocator sends an authentication request to the trusted driver module.
[0058] After receiving the memory access request, the memory allocator may obtain authentication information and generate an authentication request based on the authentication information. In some embodiments, the authentication information may include user information and process information, wherein the user information includes the identity information of the user who issued the memory access request, for example Figure 3 User 1 and User 2 in the process information may include information about the application (App) that issues the memory access request, such as Figure 3 App1 and App2 in the memory allocator. When receiving a memory access request, the memory allocator may obtain user information and process information from the context of the operating system kernel. In other embodiments, the authentication information may further include information of a target partition, and the information of the target partition includes information of a partition corresponding to the memory access request, such as Figure 3 Partition 1 and partition 2. In some other implementations, the authentication information may further include operation information, and the operation information includes the operation type corresponding to the memory access request, such as write, read, etc. The target partition information and the operation information may be obtained from the memory access request.
[0059] S23, the trusted driver module responds to the received authentication request and returns the authentication result to the memory allocator.
[0060] Specifically, the trusted driver module receives the authentication request sent by the memory allocator, and generates an authentication result according to the authentication information in the authentication request and the authorization information obtained from the outside to confirm whether the user has access rights or is a trusted user.
[0061] In some embodiments, the trusted driver module may obtain authorization information and match the authentication information in the authentication request with the authorization information. The authorization information may be stored in a storage space outside the memory device. For example, when the memory device is a PCI device, the external storage space may be a storage space based on the PCI protocol. In some embodiments, the authorization information may include authorized user information, authorized program information, authorized partition information, and / or authorized operation information. Figure 3 A form of authorization information is shown. Figure 3 Each line of information in represents a permission information. For example, the first line of information indicates that user 1 has the right to access partition 1 through App 1. The trusted driver module can Figure 3 If the authentication information matches the information in one of the rows, it means that the current user has access rights and is a trusted user; if the information in the authentication request does not match the information in any row, it means that the current user does not have access rights and is an illegal user. It should be understood that Figure 3 The physical memory partition authorization information shown is only an example of the present application, and the present application is not limited thereto. For example, in some embodiments, a user can define more fine-grained authorization information, such as whether a user or an application has read and write permissions for a physical memory partition.
[0062] When the authentication information fails to match the authorization information, the trusted driver will return the authentication result of the authentication failure to the memory allocator. When the authentication information matches the authorization information successfully, the trusted driver will return the authentication result of the authentication success to the memory allocator. In some embodiments, the secure memory setting is also used to update the key and perform key matching. Specifically, when the authentication information matches the authorization information successfully, the trusted driver module will also call the interface of the device driver module and transmit the key it saves to the device driver module so that the device driver module can match the key with the key in the secure memory module. When the key matches successfully, the device driver module will turn off the protection rules of the target partition, so that the memory access request of the trusted user is not subject to the constraints of the protection rules. After the key matches, the secure memory module will update the key for the next key match.
[0063] S24, the memory allocator executes the memory access request when the authentication result is authentication success, and rejects the memory access request when the authentication result is authentication failure.
[0064] In addition, as described above, in some embodiments, the device driver module will turn off the protection rules of the target partition when the authentication is successful, so that the memory access request of the trusted user is not subject to the protection rules. When the memory allocator completes the execution of the memory access request, it will notify the trusted driver module. At this time, the trusted driver module will call the interface of the device driver module again to read the updated key in the secure memory module and save it. At the same time, the device driver module will re-enable the protection rules of the target partition. In other words, after each memory access request is executed, the protection rules will be restored and the key will be updated, which is conducive to improving the security of the system.
[0065] from Figure 1C As can be seen from the figure, illegal users may access the target partition in two ways. The first way is to send a memory access request to the memory allocator (such as Figure 1C The path corresponding to the illegal user 2 in ), as mentioned above, this approach requires authentication and the memory access request will only be executed when it is confirmed that the user is a trusted user. The second approach is to bypass the memory allocator and directly access the target partition (such as Figure 1C ). This method requires illegal users to obtain system administrator privileges to be implemented, because the physical memory managed by the memory allocator cannot be accessed through the operating system. Moreover, for the second method, in the case of key matching, since the user fails to pass identity authentication and cannot obtain the key, the system will not close the protection rules through key matching. In other words, the protection rules of the target partition will always be enabled, so these illegal users cannot access the target partition at will. This method is conducive to further protecting the data security in the target partition. The process of illegal users bypassing the memory allocator and directly accessing the target partition is as follows: Figure 4 shown.
[0066] S41, the secure memory module detects whether there is a conflict between the memory access request and the protection rules enabled by the target partition. If the secure memory module detects that there is a conflict between the memory access request and the protection rules enabled by the target partition, the process proceeds to step S42; if the secure memory module detects that there is no conflict between the memory access request and the protection rules enabled by the target partition, the process proceeds to step S43.
[0067] In some embodiments, based on the protection rules enabled by the target partition, the operation that can currently be performed on the target partition can be determined as the first operation. Based on the memory access request, the operation that the user wants to perform on the target partition can be determined as the second operation. In step S41, it can be determined whether the memory access request conflicts with the protection rules based on the first operation and the second operation. If the second operation is included in the first operation, it is determined that the memory access request does not conflict with the protection rules. If the second operation is not included in the first operation, it is determined that the memory access request conflicts with the protection rules. In other embodiments, the operation corresponding to the memory access request can be directly compared with the protection rules of the target partition to determine whether the memory access request conflicts with the protection rules of the target partition.
[0068] S42, the secure memory module rejects the memory access request and generates an illegal access record.
[0069] S43, the secure memory module executes a memory access request on the target partition.
[0070] Specifically, when an illegal user bypasses the memory allocator and directly accesses the target partition, since the protection rule of the target partition is enabled, if the secure memory module detects that the memory access request conflicts with the protection rule enabled by the target partition, the secure memory module will reject the corresponding memory request and generate an illegal access record. For example, if the memory access request wants to perform a write operation on the target physical memory, and the protection rule enabled by the target partition is to prohibit reading and writing, then the memory access request conflicts with the protection rule enabled by the target partition, and the secure memory module will reject the memory access request and generate an illegal access record.
[0071] In some embodiments, the illegal access record can be read and reported periodically by the device driver module, or can be reported in real time by the device driver module. In addition, in the embodiment of the present application, a corresponding interface can also be provided for the administrator. After the device driver module reads the illegal access record, the administrator can be notified in time through the interface.
[0072] In one embodiment of the present application, the target partition is invisible to the operating system, and the memory allocator completely controls the target partition. In this way, the memory space used by different programs can be effectively isolated, thereby preventing conflicts or interference between programs. At the same time, malicious programs can also be prevented from illegally accessing or modifying the memory space, thereby ensuring the security of the system.
[0073] In one embodiment of the present application, the memory access request includes a memory application request, a memory release request, a memory mapping request, a memory data attribute modification request and / or a memory data read and write request.
[0074] The memory allocator is a program module that dynamically allocates memory space. It can allocate the physical memory it manages to the application program for use based on the user's application to meet the application program's memory requirements. In some embodiments, the memory allocator divides its physical memory into multiple physical memory partitions of different sizes and maintains an allocation status table for multiple physical memory partitions. When the application program needs to allocate memory, the memory allocator searches for the available physical memory partitions in the allocation status table and allocates them to the application program for use. When the application program releases memory, the memory allocator adds the physical memory area to the list of available physical memory partitions for use in the next memory allocation.
[0075] The memory release request is used to release the memory in the target partition. Specifically, when the memory allocator receives a legitimate memory release request, it will release a piece of physical memory that has been allocated on the corresponding target partition back to the available memory of the target partition.
[0076] The memory mapping request is used to map the memory in the target partition. Specifically, when the memory allocator receives a legitimate memory mapping request, it maps the data of the file in the corresponding memory partition to the address space of the process. The memory data attribute modification request is used to modify the attributes of the data in the target partition. When the memory allocator receives a legitimate memory data attribute modification request, it modifies the corresponding management data.
[0077] The memory data read and write request is used to perform a read operation or a write operation on the data in the target partition.
[0078] The protection scope of the memory management method described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0079] The embodiment of the present application also provides a memory management system. The memory management system includes a memory allocator and a trusted driver module. The memory allocator is used to receive a memory access request for a target partition of a memory device and obtain authentication information to generate an authentication request, wherein the memory allocator manages one or more physical memory partitions of the memory device, and the target partition is any one of the one or more physical memory partitions. The trusted driver module is used to receive the authentication request, and generate an authentication result based on the authentication information and the authorization information obtained from the outside, and return the authentication result to the memory allocator. The memory allocator is also used to execute the memory access request when the authentication result is authentication success, and reject the memory access request when the authentication result is authentication failure.
[0080] In some embodiments, the memory management system further includes a device driver module and a secure memory module, wherein the secure memory module is a hardware module and the device driver module is a software driver module corresponding to the secure memory module. The device driver module is used to configure protection rules for one or more physical memory partitions to restrict access to each physical memory partition.
[0081] In some embodiments, the trusted driver module is also used to call the interface of the device driver module and send the first key to the device driver module when the authentication result is successful authentication; the device driver module is used to match the first key with the second key in the secure memory module, and turn off the protection rules of the target partition when the match is successful.
[0082] In some embodiments, the secure memory module is further configured to update the second key after the first key is matched with the second key.
[0083] In some embodiments, the trusted driver module is also used to call the interface of the device driver module after the memory allocator completes the execution of the first memory access request to notify the device driver module to re-enable the protection rules of the target partition and update the first key according to the updated second key.
[0084] In some embodiments, the system also includes a secure memory module, which is used to receive a second memory access request to the target partition that is not from the memory allocator, and detect whether there is a conflict between the second memory access request and the protection rule of the target partition, and reject the second memory access request when a conflict is detected.
[0085] In some embodiments, the secure memory module is further configured to generate an illegal access record when a conflict is detected.
[0086] In some implementations, the protection rules include any one or more combinations of the following rules: data reading from a physical memory partition is prohibited, data writing to a physical memory partition is prohibited, and access to a physical memory partition is monitored.
[0087] An embodiment of the present application also provides an electronic device. Figure 5 The structure diagram of the electronic device 5 provided in the embodiment of the present application is shown. Figure 5 As shown, the electronic device 5 provided in the embodiment of the present application includes a memory 51 and a processor 52.
[0088] The memory 51 is used to store computer programs; preferably, the memory 51 includes: ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk, etc., various media that can store program codes.
[0089] Specifically, the memory 51 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The electronic device 5 may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 51 may include at least one program product having a set (e.g., at least one) of program modules, which are configured to perform the functions of the various embodiments of the present application.
[0090] The processor 52 is connected to the memory 51 and is used to execute the computer program stored in the memory 51 so that the electronic device 5 executes the memory management method provided in any embodiment of the present application.
[0091] Optionally, the processor 52 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices.
[0092] Optionally, the electronic device 5 in this embodiment may further include a display 53. The display 53 is communicatively connected with the memory 51 and the processor 52, and is used to display a related interface of the memory management method.
[0093] The embodiment of the present application proposes the concept of "partition" management, that is, managing a part of physical memory separately, and providing multiple software and hardware protection mechanisms for the data stored in this part of physical memory through protection rules, identity authentication and keys to prevent illegal users from reading or modifying it. At the same time, the solution of the present application can monitor and record illegal access behaviors. These measures change the situation where the memory device can only act as a passive device, and greatly improve the security of the memory device.
[0094] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A memory management system, characterized in that: The system comprises: A memory allocator, configured to receive a first memory access request for a target partition of a memory device and obtain authentication information to generate an authentication request, wherein the memory allocator manages one or more physical memory partitions of the memory device, and the target partition is any one of the one or more physical memory partitions; A trusted driver module, used for receiving the authentication request, generating an authentication result according to the authentication information and authorization information obtained from the outside, and returning the authentication result to the memory allocator; The memory allocator is further configured to execute the first memory access request when the authentication result is authentication success, and to reject the first memory access request when the authentication result is authentication failure.
2. The memory management system according to claim 1, characterized in that: The system further comprises a device driver module, and the device driver module is used to configure protection rules for the one or more physical memory partitions respectively, so as to restrict access to each physical memory partition.
3. The memory management system according to claim 2, characterized in that: The system also includes a secure memory module; The trusted driver module is further used to call the interface of the device driver module and send the first key to the device driver module when the authentication result is successful authentication; The device driver module is used to match the first key with the second key in the secure memory module, and close the protection rule of the target partition when the match is successful.
4. The memory management system according to claim 3, characterized in that: The secure memory module is further configured to update the second key after the first key matches the second key.
5. The memory management system according to claim 4, characterized in that: The trusted driver module is also used to call the interface of the device driver module to notify the device driver module to re-enable the protection rule of the target partition after the memory allocator completes executing the first memory access request, and update the first key according to the updated second key.
6. The memory management system according to claim 2, characterized in that: The system also includes a secure memory module, which is used to receive a second memory access request to the target partition that is not from the memory allocator, and detect whether the second memory access request conflicts with the protection rules of the target partition, and reject the second memory access request when a conflict is detected.
7. The memory management system according to claim 6, characterized in that: The secure memory module is also used to generate an illegal access record when a conflict is detected.
8. The memory management system according to claim 2, characterized in that: The protection rule includes any one or more combinations of the following rules: data is prohibited from being read from the physical memory partition, data is prohibited from being written to the physical memory partition, and access to the physical memory partition is monitored.
9. A memory management method, characterized in that: Applied to a memory management system, the system includes a memory allocator and a trusted driver module, wherein the memory allocator manages one or more physical memory partitions of a memory device, and the method includes: The memory allocator receives a first memory access request for a target partition and obtains authentication information to generate an authentication request, wherein the target partition is any one of the one or more physical memory partitions; The memory allocator sends an authentication request to the trusted driver module; The trusted driver module responds to the received authentication request and returns an authentication result to the memory allocator, wherein the trusted driver module generates the authentication result according to the authentication information in the authentication request and the authorization information obtained from the outside; The memory allocator executes the first memory access request when the authentication result is authentication success, and rejects the first memory access request when the authentication result is authentication failure.
10. The memory management method according to claim 9, characterized in that: The system further includes a device driver module, and the method further includes: The device driver module is used to configure protection rules for the one or more physical memory partitions respectively, so as to restrict access to each physical memory partition.
11. The memory management method according to claim 10, characterized in that: The system further includes a secure memory module, and the method further includes: When the authentication result is successful, the trusted driver module calls the interface of the device driver module and sends the first key to the device driver module; The device driver module matches the first key with the second key in the secure memory module, and closes the protection rule of the target partition when the match succeeds.
12. The memory management method according to claim 11, characterized in that: The method further comprises: The secure memory module updates the second key after the first key matches the second key.
13. The memory management method according to claim 12, characterized in that: The method further comprises: The trusted driver module calls the interface of the device driver module after the memory allocator completes executing the first memory access request to notify the device driver module to re-enable the protection rule of the target partition, and updates the first key according to the updated second key.
14. The memory management method according to claim 10, characterized in that: The system further includes a secure memory module, and the method further includes: When the secure memory module receives a second memory access request to the target partition that is not from the memory allocator, it detects whether the second memory access request conflicts with the protection rule of the target partition, and rejects the memory access request when a conflict is detected.
15. The memory management method according to claim 14, characterized in that: The method further comprises: The secure memory module generates an illegal access record when a conflict is detected.
16. An electronic device, characterized in that: The electronic device comprises: A memory storing a computer program; a processor, communicatively connected to the memory, and executing a memory management method when calling the computer program; The memory management method is applied to a memory management system, the system includes a memory allocator and a trusted driver module, the memory allocator manages one or more physical memory partitions of a memory device, and the memory management method includes: The memory allocator receives a first memory access request for a target partition and obtains authentication information to generate an authentication request, wherein the target partition is any one of the one or more physical memory partitions; The memory allocator sends an authentication request to the trusted driver module; The trusted driver module responds to the received authentication request and returns an authentication result to the memory allocator, wherein the trusted driver module generates the authentication result according to the authentication information in the authentication request and the authorization information obtained from the outside; The memory allocator executes the first memory access request when the authentication result is authentication success, and rejects the first memory access request when the authentication result is authentication failure.