Data row protection method, device, equipment and storage medium for dynamic random access memory
By identifying the attacked data rows and their associated data rows and transferring them to a secure area, the impact of RowHammer attack on memory performance is solved, and data protection is achieved while maintaining efficient memory read and write performance.
Patent Information
- Application Number
- CN202410986052.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-07-22
AI Technical Summary
When the prior art resists RowHammer attacks, frequent refresh operations reduce memory read and write performance and affect memory controller performance.
By identifying the attacked data rows and their associated data rows, after meeting the preset conditions, the data is transferred to an independent security area to avoid RowHammer attacks and reduce the frequency of refresh commands.
Effectively protects data from RowHammer attacks, reduces the overhead of the protection process, and avoids the impact on memory read and write performance.
Smart Images

Figure CN118520521B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data row protection method, device, electronic device and computer-readable storage medium for a dynamic random access memory. Background Art
[0002] RowHammer attack is a memory attack method. RowHammer attack reads and writes a specific data row in the memory at a high frequency, causing bit reversal in the adjacent data rows of the specific data row, thereby achieving attack purposes such as kernel privilege throttling attack, confidential data acquisition, and bypassing memory protection mechanism.
[0003] Currently, memory can rely on refresh commands sent by the memory controller to resist RowHammer attacks. Refresh operations on memory can reduce the probability of bit reversal in the victim data row.
[0004] However, as the design of memory becomes more and more compact, the number of refresh commands that need to be sent in one refresh window is also increasing. Frequent refreshes will affect the normal reading and writing of the memory and reduce the performance of the memory controller. Summary of the invention
[0005] The embodiments of the present application provide a data row protection method, device, electronic device and computer-readable storage medium of a dynamic random access memory to solve the problems in the related art.
[0006] In a first aspect, an embodiment of the present application provides a data row protection method for a dynamic random access memory, the method comprising:
[0007] Identifying a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked;
[0008] If it is determined that data in a second data row associated with the first data row meets a preset condition, generating an exchange request for the second data row;
[0009] The memory controller responds to the exchange request to transfer the data in the second data row to the security area in the storage array.
[0010] In a second aspect, an embodiment of the present application provides a data row protection device for a dynamic random access memory, the device comprising:
[0011] An identification module is used to identify a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked;
[0012] a generating module, configured to generate an exchange request for a second data row associated with the first data row if it is determined that the data in the second data row associated with the first data row meets a preset condition;
[0013] The exchange module is used to respond to the exchange request through a memory controller to transfer the data in the second data row to the security area in the storage array.
[0014] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor;
[0015] a memory for storing instructions executable by the processor;
[0016] The processor is configured to execute the instructions to implement the method of the first aspect.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which, when instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the method of the first aspect.
[0018] In the embodiment of the present application, the first data row in the storage array of the dynamic random access memory that is attacked is identified, and when the data in the second data row associated with the first data row meets the preset conditions, the data in the second data row is transferred to the security area in the storage array for protection. The security area is an independent area, so the initiator of the RowHammer attack cannot perform a Row Hammer attack on the security area, and thus the data stored in the security area is protected. The entire protection process of the embodiment of the present application only requires simple judgment and data transfer operations, and does not require the execution of high-frequency refresh commands, so the overhead is small and will not affect the read and write performance of the dynamic random access memory.
[0019] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1It is a flowchart of the steps of a data row protection method of a dynamic random access memory provided by an embodiment of the present application;
[0022] Figure 2 It is an architectural diagram of a data row protection method of a dynamic random access memory provided in an embodiment of the present application;
[0023] Figure 3 It is a flowchart of the specific steps of a data row protection method of a dynamic random access memory provided by an embodiment of the present application;
[0024] Figure 4 This is a block diagram of a data row protection device for a dynamic random access memory provided in an embodiment of the present application;
[0025] Figure 5 is a block diagram of an electronic device provided by an embodiment of the present invention;
[0026] Figure 6 is a block diagram of another electronic device according to another embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0028] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three kinds of relationships can exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the front and back associated objects are a kind of "or" relationship. In the embodiment of the present application, the term "multiple" refers to two or more, and other quantifiers are similar.
[0029] Figure 1 , is a flowchart of a data row protection method for a dynamic random access memory provided by an embodiment of the present application, such as Figure 1 As shown, the method may include:
[0030] Step 101: Identify a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked.
[0031] In the embodiments of this application, refer to Figure 2 , the memory of the embodiment of the present application may be a dynamic random access memory (DRAM, Dynamic Random Access Memory), which is a semiconductor memory. The main working principle is to use the amount of charge stored in the capacitor to represent whether a binary bit is 1 or 0; because in reality, transistors have leakage current, the amount of charge stored on the capacitor is not enough to correctly distinguish the data, resulting in data corruption. Therefore, for dynamic random access memory, periodic charging is an inevitable requirement. Due to this characteristic of requiring regular refresh, it is called "dynamic" memory. The advantage of dynamic random access memory is its simple structure, that is, each bit of data only requires one capacitor and one transistor to process, so the dynamic random access memory can have a very high density, and due to its high capacity per unit volume, the cost is low. Since the data stored in DRAM will disappear soon after the power is cut off, it is a volatile memory device.
[0032] Specifically, the dynamic random access memory may include one or more storage arrays ( Figure 2 ), each storage array is composed of rows and columns. Each storage array includes a normal area (data rows 1-n), a buffer area and a security area.
[0033] The row tracker is used to efficiently, real-time and accurately detect the attack row (first data row) in the storage array and submit it to the software system. The attack row is the data row that is attacked, and the attack behavior can be a Row Hammer attack behavior.
[0034] The user can initiate an access request to the dynamic random access memory through the user interface, and perform relevant configuration to the software system through the user interface.
[0035] The memory controller is a controller that specifically manages memory. Since the processor cannot directly operate various hardware, there will be controllers corresponding to various hardware. These controllers are basically integrated on the motherboard. The controller is a special hardware that acts as an intermediary between the processor and the hardware device, translating the processor's instructions, transmitting device signals, and performing data exchange, etc. The memory controller is generally integrated inside the processor. Each memory controller can control multiple channels and receive memory read and write requests from the processor. Usually, the instructions sent by the processor to the memory controller are in units of cache blocks. The memory controller is responsible for compatibility with the frequency, voltage, storage array number, timing and other parameters of different memory devices.
[0036] For processing the attack behavior, the first data row (attack row) targeted by the attack behavior can be identified first, and then the second data row (victim row) associated with the first data row can be identified.
[0037] Reference Figure 1 In this step, the row tracker can detect the data rows in the storage array in real time, thereby detecting the first data row (attack row). The first data row is the data row attacked by the attack behavior. The specific implementation of the row tracker can be deployed in a dynamic random access memory or a memory controller, and the detected first data row can be provided to the software system for further processing. For example, Figure 2 The BOC tracker detected data row 3 as the attack row.
[0038] Step 102: When it is determined that data in a second data row associated with the first data row meets a preset condition, generate an exchange request for the second data row.
[0039] Optionally, the attack behavior includes a Row Hammer attack.
[0040] Optionally, the second data row associated with the first data row includes: a data row adjacent to the first data row, or a data row separated from the first data row by a target number of data rows, where the target number is less than or equal to a preset number threshold.
[0041] In the embodiment of the present application, with the continuous improvement of the integration process of dynamic random access memory, the distance between adjacent memory cells in the dynamic random access memory is getting closer and closer, which reduces the storage cost while also increasing the interference between adjacent memory cells, bringing about storage security issues. The purpose of the Row Hammer attack is to exploit the above-mentioned vulnerability and perform high-frequency reading and writing of a data row, thereby causing bit reversal in the adjacent data rows of the attacked data row, such as bit 1 becoming bit 0 or bit 0 becoming bit 1, wherein the data row with high frequency access is called the attack row, and the adjacent data row with bit reversal is called the victim row. The harm of the Row Hammer attack is very serious. For example, when the victim row stores permission data, the bit reversal sent by the victim row will cause the permission to change from 1 to 0 or from 0 to 1, thereby creating the risk of hijacking permissions.
[0042] Therefore, after determining the first data row that has received the attack behavior in step 101, the second data row associated with the first data row can be further determined, and when the data in the second data row meets the preset condition, an exchange request for the second data row can be generated; the preset condition can be a condition for determining whether the data in the second data row is important data, that is, when the data in the second data row is determined to be important data, it is determined that the data in the second data row has a need to be protected, so that an exchange request for the second data row can be generated.
[0043] In one case, the second data row may be a data row adjacent to the first data row. In another case, the Row Hammer attack may have a certain attack radius, and the second data row may be a data row separated from the first data row by a target number of data rows, where the target number is less than or equal to a preset number threshold, for example, the preset number threshold may be any value in the interval [2, 3, 4, 5, 6].
[0044] For example, Figure 2 If the bank tracker detects that data row 3 is an attack row, data row 4 adjacent to data row 3 may be used as a victim row if the data in data row 4 meets a preset condition.
[0045] Step 103: Respond to the exchange request through a memory controller to transfer the data in the second data row to a secure area in the storage array.
[0046] In the embodiments of this application, refer to Figure 2 ,The generated exchange request can be sent by the software system to the memory controller, and the memory controller responds to the exchange request and executes the operation of transferring the data in the second data row (the victim row) to the safe area.
[0047] Specifically, each storage array is divided into a normal area (data rows 1-n), a buffer area, and a security area. The security area is an independent area, and the address space of the security area is not open to the user state, so the outside world cannot directly access the data in the security area, so the initiator of the Row Hammer attack cannot perform a Row Hammer attack on the security area, so the data stored in the security area is protected.
[0048] In response to the exchange request, the memory controller may transfer the data in the second data row to the secure area in the storage array for protection, thereby preventing the Row Hammer attack from affecting the data in the second data row.
[0049] During the data transfer process, since at most one data row of a storage array of the dynamic random access memory can be activated at the same time, the storage array cannot provide services for normal read and write requests during the process of transferring the swapped data to the security area. For the memory controller working under a benign load, the performance loss caused by this swap row data transmission can be ignored. Therefore, the entire protection process of the embodiment of the present application only requires simple judgment and data transfer operations, with low overhead and no impact on the read and write performance of the dynamic random access memory.
[0050] In summary, in the embodiment of the present application, the first data row in the storage array of the dynamic random access memory that is attacked is identified, and when the data in the second data row associated with the first data row meets the preset conditions, the data in the second data row is transferred to the security area in the storage array for protection. The security area is an independent area, so the initiator of the Row Hammer attack cannot perform a Row Hammer attack on the security area, and thus the data stored in the security area is protected. The entire protection process of the embodiment of the present application only requires simple judgment and data transfer operations, and does not require the execution of high-frequency refresh commands, so the overhead is small and will not affect the read and write performance of the dynamic random access memory.
[0051] Figure 3 , is a flowchart of the specific steps of a data row protection method of a dynamic random access memory provided by an embodiment of the present application, such as Figure 3 As shown, the method may include:
[0052] Step 201: Identify a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked.
[0053] This step may specifically refer to the above step 101, which will not be described in detail here.
[0054] Optionally, the storage array includes a security area, a buffer area, and other areas except the security area and the buffer area; the buffer area is located between the security area and the other areas; and the buffer area is not used to store data.
[0055] In the embodiments of this application, refer to Figure 2It can be seen that a buffer area is divided between the normal area (data rows 1-n) and the security area of the storage array. No data is stored in the buffer area, and the buffer area only serves to isolate the normal area from the security area. Since the Row Hammer attack has an adverse effect on the adjacent or similar data rows of the attack row, the distance between the normal area and the security area can be increased by isolating the normal area from the security area through the buffer area, thereby ensuring that the security area will no longer be affected by the Row Hammer attack. The size of the buffer area can be set according to actual needs, and the size of the buffer area can exceed the attack radius of the Row Hammer attack.
[0056] It should be noted that, in addition to the solution of dividing the security zone in the storage array, the embodiment of the present application can also add a storage medium independent of the dynamic random access memory (such as an additional DRAM memory bar) as a security zone, so as to isolate the security zone from the normal access memory space at the physical level. Under this optimization measure, the setting of the buffer zone can be cancelled. In addition, the security zone can also be set to be shared by all storage arrays of the dynamic random access memory.
[0057] Step 202: When it is determined that the data in the second data row associated with the first data row meets a preset condition, generate an exchange request for the second data row.
[0058] This step may be specifically referred to as the above step 102, which will not be described in detail here.
[0059] Optionally, step 202 may specifically include:
[0060] Sub-step 2021: When the security level of the data in the second data row is greater than or equal to a preset level threshold, generate the exchange request.
[0061] In the embodiment of the present application, a security level can be set for the data in the data row. The greater the security level, the higher the importance of the data, and the smaller the security level, the lower the importance of the data. Based on the protection requirements for high-importance data, the embodiment of the present application can determine that the importance of the data in the second data row is high and needs to be further protected when it is determined that the security level of the data in the second data row is greater than or equal to a preset level threshold (such as medium), thereby generating an exchange request to transfer the data in the second data row to the security zone for protection.
[0062] Step 203: Respond to the exchange request through a memory controller to transfer the data in the second data row to a secure area in the storage array.
[0063] This step may refer to the above step 103 and will not be described in detail here.
[0064] Optionally, the memory controller further maintains a correspondence between the data row and the storage location of the data in the data row in the security slice, and the method may further include:
[0065] Step 204: When receiving an access request for the data of the data row included in the corresponding relationship, determine the storage location of the data of the data row in the security slice according to the corresponding relationship and access it.
[0066] The processing priority of the exchange request is higher than the processing priority of the access request.
[0067] In the embodiments of this application, refer to Figure 2 The memory controller may maintain a correspondence between data rows and the storage locations of the data in the security zone. The correspondence may record the exchange mapping relationship in the form of a data table. Each time the memory controller responds to an exchange request, the mapping relationship of the exchange may be recorded or updated in the correspondence.
[0068] In actual applications, after the data of the second data row is saved in the security zone, these data still need to be accessed. In order to meet this need, the embodiment of the present application can find the storage location of the data of the data row to be accessed in the security zone and access it according to the above correspondence when receiving an access request for the data in the security zone.
[0069] For example, assuming that the data in data row 4 is transferred to the secure zone, the address of data row 4 and the storage location of the data in data row 4 in the secure zone are recorded in the correspondence of the memory controller. If a read request for the address of data row 4 is subsequently received, the storage location of the data in data row 4 in the secure zone can be found based on the correspondence, thereby realizing the reading of the data in data row 4 in the secure zone, that is, achieving the purpose of mapping the access request for the exchanged data to the secure zone for access, and ensuring the normal data access on the basis of security protection of the data.
[0070] Optionally, the method may further include:
[0071] Step 205: Receive an input operation, and determine a third data row selected by the input operation in the storage array.
[0072] On the basis of step 205, step 202 may specifically include:
[0073] Sub-step 2022: if it is determined that the second data row associated with the first data row and the third data row are the same data row, generate the exchange request.
[0074] In the embodiments of this application, refer to Figure 2 The user can make relevant configurations to the software system through the user interface. In the scenario of the embodiment of the present application, the configuration process can be the configuration of the third data row (protection row) storing important data based on actual needs by the user. The user can select some third data rows in the storage array of the dynamic random access memory through the configuration operation.
[0075] After the configuration is completed, the row tracker can detect in real time whether there is an attack row (first data row) in the storage array that is attacked. When the row tracker detects an attack row and the second data row (victim row) associated with the attack row happens to be a third data row configured by the user, it is considered that the important data that the user is concerned about is at risk of being attacked. The data in the victim row can be determined as data that needs to be protected, and a swap request for the victim row can be further generated so that the data in the victim row can be transferred to the security area for protection.
[0076] For example, suppose a batch of important data that needs to be protected is passed from the user interface, and the corresponding protection row information and security levels are: level 1 protection row A, level 2 protection row B, level 3 protection row C. The higher the security level, the more important the data that needs to be protected. The software system updates the protection row information record table and writes protection row A, protection row B, and protection row C into the table. If the current software system receives the information of attack row D, and obtains that attack row D is adjacent to protection row B by comparing the row address, then protection row B becomes the victim row, that is, protection row B will be attacked by Row Hammer at this time. After receiving the above information, the software system immediately generates an exchange request to inform the hardware that the data b in protection row B needs to be exchanged to a row in the security area, thereby ensuring the security of important data.
[0077] Optionally, the memory controller further maintains a correspondence between a data row, a storage location of the data of the data row in the security slice, and a security level of the data row; the exchange request further includes: a security level assigned to the second data row; after step 202, the method may further include:
[0078] Step 206: When the corresponding relationship includes the corresponding item of the second data row, update the corresponding item of the second data row.
[0079] Step 207: When the corresponding relationship does not include the corresponding item of the second data row and there is a free item in the corresponding relationship, a corresponding relationship among the second data row, the storage location allocated for the data of the second data row in the security zone, and the security level of the second data row is established in a free item.
[0080] In an embodiment of the present application, for important data that needs to be protected (i.e., the data in the second data row targeted by the interactive request), a corresponding security level can be set for it. The more important the data, the higher the security level, so as to achieve the purpose of dividing the data according to different importance levels, and make the data stored in the security zone have the corresponding security level, that is, each data in the security zone has a security level division. When the memory controller updates the corresponding relationship according to the interactive request, if the corresponding relationship contains the corresponding item of the second data row, the corresponding item of the second data row is directly updated; if the corresponding relationship does not contain the corresponding item of the second data row, and there is a spare item in the corresponding relationship, then establish a corresponding relationship between the second data row, the storage location allocated for the data of the second data row in the security zone, and the security level of the second data row in a spare item. Thereby achieving the purpose of the memory controller maintaining the corresponding relationship in real time.
[0081] Optionally, the method may further include:
[0082] Step 208: If the corresponding item of the second data row is not included in the corresponding relationship and there is no empty item in the corresponding relationship, clear the corresponding item with the lowest security level, and restore the data corresponding to the corresponding item with the lowest security level in the security area to the original second data row before the transfer.
[0083] Step 209: Establish a correspondence between the second data row, the storage location allocated for the data of the second data row in the security slice, and the security level of the second data row in the cleared corresponding item.
[0084] In the embodiment of the present application, since the data has a corresponding security level, each data in the security zone has a security level division. However, the space of the security zone is limited, and there may be a situation where the security zone is full and cannot store the data to be transferred. In order to solve this problem, in the embodiment of the present application, if the corresponding item of the second data row is not included in the corresponding relationship, and there is no free item in the corresponding relationship, then a corresponding item with the lowest security level can be cleared, and the data corresponding to the corresponding item with the lowest security level in the security zone can be restored to the original second data row before transfer. Then, in the cleared corresponding item, a corresponding relationship between the second data row, the storage location allocated for the data of the second data row in the security zone, and the security level of the second data row is established, so that when the security zone is full, the storage demand of the current transferred data can be met by clearing the data row storing the lowest security level.
[0085] For example, suppose there are 4 storage arrays in the dynamic random access memory, and the highest 4 rows of each storage array are reserved as the security area, and the 2 rows adjacent to the security area are used as the buffer area, and the remaining rows can be read and written by users normally. The correspondence table in the memory controller can record a maximum of 16 items, 4 items for each storage array, and each item records the mapping relationship between the swap row and the security area, as well as the security level of the swap row. After receiving the exchange request for the secondary row B, the memory controller first updates the corresponding relationship table: if the corresponding storage array has a free item in the corresponding relationship table, the row B exchange request is directly written into the corresponding relationship table; if the corresponding storage array already has a primary exchange row D, a secondary exchange row E, a tertiary exchange row F, and a quaternary exchange row G, at this time, there is no available item for the storage array in the corresponding relationship table, and the exchange row D with a lower security level is replaced according to the principle of security level priority: first, the data in the security area of the corresponding storage array is written back to row D, that is, row D cancels the exchange, and then the row B exchange request is written into the corresponding relationship table; if the corresponding storage array already has a tertiary exchange row H, a tertiary exchange row I, a quaternary exchange row J, and a quaternary exchange row K, at this time, there is no available item for the storage array in the corresponding relationship table, and a row is randomly selected from the exchange rows H and I with the lowest security level for replacement: first, the data of the replaced row is written back to the original address from the security area, and then the row B exchange request is written into the corresponding relationship table. After completing the update of the corresponding relationship table, the memory controller writes the data b in the row B of the storage array corresponding to the exchange request into the safe area, and the row B becomes the exchange row.
[0086] Optionally, the method may further include:
[0087] Step 210: at the end of each refresh window of the dynamic random access memory, the corresponding relationship is reset, and each data in the security area is restored to the original second data row before the transfer.
[0088] In an embodiment of the present application, at the end of each refresh window of the dynamic random access memory, the corresponding relationship can be reset (i.e., the data therein can be cleared), and each data in the security area can be restored to the original second data row before the transfer, thereby ensuring the operational stability of the dynamic random access memory.
[0089] In summary, in the embodiment of the present application, the first data row in the storage array of the dynamic random access memory that is attacked is identified, and when the data in the second data row associated with the first data row meets the preset conditions, the data in the second data row is transferred to the security area in the storage array for protection. The security area is an independent area, so the initiator of the Row Hammer attack cannot perform a Row Hammer attack on the security area, and thus the data stored in the security area is protected. The entire protection process of the embodiment of the present application only requires simple judgment and data transfer operations, and does not require the execution of high-frequency refresh commands, so the overhead is small and will not affect the read and write performance of the dynamic random access memory.
[0090] Figure 4 : is a block diagram of a data row protection device of a dynamic random access memory provided by an embodiment of the present application, the device comprising:
[0091] The identification module 301 is used to identify a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked;
[0092] A generating module 302, configured to generate an exchange request for a second data row associated with the first data row if it is determined that the data in the second data row associated with the first data row meets a preset condition;
[0093] The exchange module 303 is used to respond to the exchange request through a memory controller to transfer the data in the second data row to the security area in the storage array.
[0094] Optionally, the memory controller further maintains a correspondence between the data row and the storage location of the data in the data row in the security slice; and the device further includes:
[0095] an access module, configured to, upon receiving an access request for the data of the data row included in the corresponding relationship, determine the storage location of the data of the data row in the security slice according to the corresponding relationship and perform access;
[0096] The processing priority of the exchange request is higher than the processing priority of the access request.
[0097] Optionally, the device further comprises:
[0098] An input module, configured to receive an input operation and determine a third data row selected by the input operation in the storage array;
[0099] The generating module 302 includes:
[0100] The first generating submodule is configured to generate the exchange request when it is determined that the second data row associated with the first data row and the third data row are the same data row.
[0101] Optionally, the generating module 302 includes:
[0102] The second generating submodule is configured to generate the exchange request when the security level of the data in the second data row is greater than or equal to a preset level threshold.
[0103] Optionally, the memory controller further maintains a correspondence between a data row, a storage location of the data in the data row in the security slice, and a security level of the data row; the exchange request further includes: a security level assigned to the second data row;
[0104] The device also includes:
[0105] A first updating module, configured to update the corresponding item of the second data row if the corresponding relationship includes the corresponding item of the second data row;
[0106] A second update module is used to establish a correspondence between the second data row, the storage location allocated for the data of the second data row in the security area, and the security level of the second data row in a free item when the corresponding relationship does not contain a corresponding item of the second data row and there is a free item in the corresponding relationship.
[0107] Optionally, the device further comprises:
[0108] a clearing module, configured to clear a corresponding item with the lowest security level when the corresponding relationship does not contain a corresponding item of the second data row and there is no free item in the corresponding relationship, and restore the data corresponding to the corresponding item with the lowest security level in the security slice to the original second data row before the transfer;
[0109] An establishing module is used to establish a corresponding relationship among the second data row, the storage location allocated for the data of the second data row in the security zone, and the security level of the second data row in the cleared corresponding item.
[0110] Optionally, the device further comprises:
[0111] The reset module is used to reset the corresponding relationship at the end of each refresh window of the dynamic random access memory, and restore each data in the security area to the original second data row before the transfer.
[0112] Optionally, the second data row associated with the first data row includes: a data row adjacent to the first data row, or a data row separated from the first data row by a target number of data rows, where the target number is less than or equal to a preset number threshold.
[0113] Optionally, the attack behavior includes a Row Hammer attack.
[0114] Optionally, the storage array includes a security area, a buffer area, and other areas except the security area and the buffer area; the buffer area is located between the security area and the other areas; and the buffer area is not used to store data.
[0115] In summary, in the embodiment of the present application, the first data row in the storage array of the dynamic random access memory that is attacked is identified, and when the data in the second data row associated with the first data row meets the preset conditions, the data in the second data row is transferred to the security area in the storage array for protection. The security area is an independent area, so the initiator of the Row Hammer attack cannot perform a Row Hammer attack on the security area, and thus the data stored in the security area is protected. The entire protection process of the embodiment of the present application only requires simple judgment and data transfer operations, and does not require the execution of high-frequency refresh commands, so the overhead is small and will not affect the read and write performance of the dynamic random access memory.
[0116] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0117] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0118] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0119] An embodiment of the present application provides a data row protection device for a dynamic random access memory, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to include methods for performing one or more of the methods described in the above-mentioned embodiments.
[0120] Figure 5is a block diagram of an electronic device 600 according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0121] Reference Figure 5 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .
[0122] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.
[0123] The memory 604 is used to store various types of data to support the operation of the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, multimedia, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0124] The power supply component 606 provides power to the various components of the electronic device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.
[0125] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0126] The audio component 610 is used to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.
[0127] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0128] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0129] The communication component 616 is used to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0130] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement the methods provided in the embodiments of the present application.
[0131] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0132] Figure 6 is a block diagram of an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be provided as a server. Figure 6 The electronic device 700 includes a processing component 722, which further includes one or more processors, and a memory resource represented by a memory 732 for storing instructions that can be executed by the processing component 722, such as an application. The application stored in the memory 732 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 722 is configured to execute instructions to perform the method provided in the embodiment of the present application.
[0133] The electronic device 700 may also include a power supply component 726 configured to perform power management of the electronic device 700, a wired or wireless network interface 750 configured to connect the electronic device 700 to a network, and an input / output (I / O) interface 758. The electronic device 700 may operate based on an operating system stored in the memory 732, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM or the like.
[0134] An embodiment of the present application further provides a computer program product, including a computer program, which implements the method described in the above embodiment when executed by a processor.
[0135] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0136] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A data row protection method for a dynamic random access memory, characterized in that: The method comprises: Identifying a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked; In the case where it is determined that the data in the second data row associated with the first data row meets the preset condition, generating an exchange request for the second data row; the exchange request further includes: a security level assigned to the second data row; The memory controller responds to the exchange request to transfer the data in the second data row to the security zone in the storage array, and when the correspondence between the data row maintained by the memory controller, the storage location of the data in the data row in the security zone, and the security level of the data row does not contain the corresponding item of the second data row, and there is a free item in the correspondence, a correspondence between the second data row, the storage location allocated for the data in the second data row in the security zone, and the security level of the second data row is established in a free item.
2. The data row protection method of a dynamic random access memory according to claim 1, characterized in that: The method further comprises: When receiving an access request for the data of the data row included in the corresponding relationship, determining the storage location of the data of the data row in the security slice according to the corresponding relationship and accessing the storage location; The processing priority of the exchange request is higher than the processing priority of the access request.
3. The data row protection method of a dynamic random access memory according to claim 1, characterized in that: The method further comprises: receiving an input operation, and determining a third data row selected by the input operation in the storage array; The step of generating an exchange request when it is determined that the data in the second data row associated with the first data row meets a preset condition comprises: In the case where it is determined that a second data row associated with the first data row and the third data row are the same data row, the exchange request is generated.
4. The data row protection method of a dynamic random access memory according to claim 1, characterized in that: The step of generating an exchange request when it is determined that the data in the second data row associated with the first data row meets a preset condition comprises: In a case where the security level of the data in the second data row is greater than or equal to a preset level threshold, the exchange request is generated.
5. The data row protection method of a dynamic random access memory according to claim 1, characterized in that: After generating the exchange request for the second data row, the method further includes: In a case where the corresponding relationship includes the corresponding item of the second data row, the corresponding item of the second data row is updated.
6. The data row protection method of a dynamic random access memory according to claim 5, characterized in that: The method further comprises: If the corresponding item of the second data row is not included in the corresponding relationship and there is no free item in the corresponding relationship, a corresponding item with the lowest security level is cleared, and the data corresponding to the corresponding item with the lowest security level in the security slice is restored to the original second data row before the transfer; A correspondence between the second data row, a storage location allocated for the data of the second data row in the security slice, and a security level of the second data row is established in the cleared corresponding item.
7. The data row protection method of a dynamic random access memory according to claim 2, characterized in that: The method further comprises: At the end of each refresh window of the dynamic random access memory, the corresponding relationship is reset, and each data in the security area is restored to the original second data row before the transfer.
8. The data row protection method of a dynamic random access memory according to any one of claims 1 to 7, characterized in that: The second data row associated with the first data row includes: a data row adjacent to the first data row, or a data row separated from the first data row by a target number of data rows, where the target number is less than or equal to a preset number threshold.
9. The data row protection method of a dynamic random access memory according to any one of claims 1 to 7, characterized in that: The attack behavior includes a Row Hammer attack.
10. The data row protection method of a dynamic random access memory according to any one of claims 1 to 7, characterized in that: The storage array includes a security area, a buffer area, and other areas except the security area and the buffer area; the buffer area is located between the security area and the other areas; and the buffer area is not used for storing data.
11. A data row protection device for a dynamic random access memory, characterized in that: The device comprises: An identification module is used to identify a first data row in a storage array of a dynamic random access memory; the first data row is a data row that is attacked; A generating module, configured to generate an exchange request for a second data row associated with the first data row if it is determined that the data in the second data row associated with the first data row meets a preset condition; the exchange request further comprising: a security level assigned to the second data row; A switching module, for responding to the switching request through a memory controller to transfer the data in the second data row to the security zone in the storage array, and in the case where the correspondence between the data row maintained by the memory controller, the storage location of the data in the data row in the security zone, and the security level of the data row does not contain a corresponding item of the second data row, and there is a spare item in the correspondence, then establishing a correspondence between the second data row, the storage location allocated for the data in the second data row in the security zone, and the security level of the second data row in a spare item.
12. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 10.
