Secure Flash Controller

By using encrypted TLV record structures and TLV descriptor tables in flash memory, the access, aging and security issues of flash memory devices are solved, extending device life and improving storage efficiency.

CN114153376BActive Publication Date: 2024-10-01MELLANOX TECHNOLOGIES LTD(IL)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111025501.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-09-07
Filing Date
2021-09-02
Publication Date
2024-10-01
Estimated Expiration
2041-09-02

AI Technical Summary

Technical Problem

Flash devices have limitations in access, aging, and security, including asymmetric read and write access, limited erase/program cycles, and vulnerability to security attacks.

Method used

By using type length value (TLV) record structure in flash memory, sensitive fields are encrypted, non-sensitive fields are stored in plain text, and the TLV descriptor table is maintained in the processor to reduce erase cycles and extend the life and reliability of flash memory devices.

Benefits of technology

It achieves secure encrypted data storage in flash memory, reduces erase cycles, extends device life, improves storage throughput and latency, and reduces power consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153376B_ABST
    Figure CN114153376B_ABST
Patent Text Reader

Abstract

A computing device includes a non-volatile memory (NVM) interface and a processor. The NVM interface is configured to communicate with the NVM. The processor is configured to store each TLV record including one or more encrypted fields and one or more non-encrypted fields in an NVM type-length-value (TLV) record, the non-encrypted fields including at least respective validity indicators of the TLV records, to read TLV records including the encrypted fields and the non-encrypted fields from the NVM, and to invalidate selected TLV records by modifying the respective validity indicators of the selected TLV records stored in the non-encrypted fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates generally to computer systems and, more particularly, to methods and systems for handling data storage in computer non-volatile memory. Background Art

[0002] Computer systems often include non-volatile memory (NVM), such as flash memory, for data storage. While providing large storage areas at relatively low cost, flash memory has inherent limitations, including erasing in blocks, limited erase / program cycles, and vulnerability to security attacks.

[0003] PCT International Publication WO 2014 / 123372 describes a flash translation layer (FTL) design framework having logs for data, mappings, and checkpoints, supporting error recovery, including a first log for processing data; a second log for processing mapping information; and a third log for processing checkpoint information, wherein the first log and the second log can recover errors by using the checkpoint information.

[0004] U.S. Patent 8,589,700 describes a system and method for whitening, encrypting, and managing data stored in a non-volatile memory, including a system on a chip (SoC) and a non-volatile memory, wherein the SoC includes an SoC control circuit and a memory interface, which acts as an interface between the SoC control circuit and the non-volatile memory; the SoC may also include an encryption module; the memory interface may instruct the encryption module to whiten all types of data, including sensitive data, non-sensitive data, and memory management data, before storing them in the non-volatile memory. Summary of the invention

[0005] The present invention will be more fully understood through the following detailed description of its embodiments in conjunction with the accompanying drawings, in which: BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Figure 1A is a block diagram schematically illustrating a secure flash memory controller according to an embodiment of the present invention;

[0007] Figure 1B is a block diagram schematically showing a secure flash memory controller according to another embodiment of the present invention;

[0008] Figure 2 is a diagram schematically illustrating a structure of a type-length-value (TLV) record according to an embodiment of the present invention;

[0009] Figure 3 is a flowchart schematically showing a method for constructing a TLV descriptor table in a RAM according to an embodiment of the present invention; and

[0010] Figure 4 is a flow chart schematically illustrating a method of reading, programming, and invalidating TLV records in a flash memory according to an embodiment of the present invention. DETAILED DESCRIPTION

[0011] Overview

[0012] A computer system, which will also be referred to as a computing device, typically includes a processor (e.g., a central processing unit (CPU), a graphics processing unit (GPU), or a microcontroller computer (MCU)), a main memory (e.g., a random access memory (RAM)), and typically a non-volatile memory (NVM) secondary memory, typically used to store program code (e.g., firmware) and data records. A popular type of NVM that provides a large non-volatile storage area at a relatively low cost is flash memory. However, flash memory has some inherent limitations in terms of access, aging, and vulnerability to security attacks.

[0013] Processor (e.g., central processing unit (CPU) or flash controller) access to flash memory is asymmetric in terms of reading and writing, and in terms of writing, is serial and relatively fast in terms of writing logic 0 and writing logic 1, but writing (called programming and erasing) is much slower. In a typical flash memory device, while any bit can be individually programmed to a first binary value (e.g., logic 0), programming a second binary value (e.g., logic 1) must be done on a larger block of memory, which is called a page (programming a page with the second binary value is called erasing the page). Therefore, to program a page in flash memory, the processor typically first erases the page and then programs the desired data.

[0014] To change a portion of a page in flash memory, the processor typically copies the page to random access memory (RAM), modifies the portion to be programmed, erases the page, and then reprograms the erased page from RAM.

[0015] Aging (also called "wear") is typically defined as the number of times a Flash cell can be reliably programmed / erased ("P / E cycles"). A typical limit might be 100,000 P / E cycles. If the same page is repeatedly programmed and erased, the lifecycle of that page may terminate (and therefore the Flash device is considered non-functional) even though the P / E cycle counts for other pages may be low. When one or more Flash pages approach the P / E cycle limit, the reliability of the Flash device can be severely degraded.

[0016] Vulnerable to security attacks. RAM generally loses storage space once power is lost and is therefore not vulnerable to security attacks; in contrast, flash memory can be read and / or written when the system is turned off; in particular, flash memory external to a computer system (e.g., a flash memory device plugged into a computer system via a Universal Serial Bus (USB) connector) must be protected by cryptographic techniques, which may include encryption and / or authentication.

[0017] To mitigate access and aging limitations, flash memory data can be stored in type-length-value (TLV) records, where the type typically includes a TLV status indication field and a data type, the length is the length of the TLV record, and the value is the TLV data ("data value"). The indication field allows multiple new records to be added and obsolete records to be invalidated using a programming operation, thereby minimizing the number of erase cycles.

[0018] To provide security, the processor can encrypt the TLV record before programming. However, when the TLV record is encrypted, the above mechanism may fail because data encryption increases the entropy of the encrypted data and may change all bits.

[0019] Embodiments according to the present invention provide methods and systems in which data is securely encrypted when stored in flash memory and still maintains the TLV record structure, reducing the number of erase cycles and thereby extending the life and reliability of the flash memory device.

[0020] In the disclosed embodiment, each TLV record includes one or more encrypted fields and one or more non-encrypted fields. In an embodiment, the sensitive fields of the TLV record may be encrypted, while the non-sensitive fields may be stored unencrypted (will be referred to as "plaintext fields"; non-encrypted data will be referred to as "plaintext" and stored in "plaintext fields"). In an embodiment, the encrypted fields include data values ​​and data types, while the plaintext fields include indicator fields, lengths, and sometimes some attributes.

[0021] In particular, processors typically do not encrypt the bits that indicate whether a TLV record is valid or invalid. When using this format, the processor is able to invalidate obsolete TLV records and verify the validity of TLV records, using traditional flash operations and without decrypting the information. More generally, encrypting data while keeping metadata as plain text helps simplify management tasks for the processor.

[0022] Thus, the disclosed technology extends the life of flash memory devices by reducing the number of erase cycles while maintaining critical data protection. Since fewer encryption and decryption operations are performed, storage throughput and latency can be improved, and power consumption can be reduced.

[0023] System Description

[0024] Figure 1A1 is a block diagram schematically illustrating a secure flash controller 100 according to an embodiment of the present invention. The flash controller 100, sometimes referred to as a computing device, includes a processor 102 (e.g., a CPU, GPU, or MCU); a random access memory (RAM) 104 configured to temporarily store data and / or program code; and a flash interface 108. The flash interface 108 is configured to communicate with a non-volatile memory 106, such as flash memory, which stores data records.

[0025] according to Figure 1A In the example embodiment shown, the processor 102 communicates with the flash memory 106 via the flash memory interface circuit 108; in some embodiments, the flash memory 106 supports only atomic operations, and the flash memory interface 108 can be used to convert flash memory erase, program, and read operations into atomic flash memory operations (for example, a processor flash memory programming operation can be converted by the flash memory control circuit into a series of program and verify operations that are transparent to the processor).

[0026] The flash memory map 114 on the right hand side of the figure shows the structure of the TLV record in the flash memory 106. Each TLV record 116 includes one or more non-encrypted plaintext fields 118, and one or more encrypted data fields 120. The encrypted data fields are encrypted when written and decrypted when read using, for example, Advanced Encryption Standard (AES) 256. In an embodiment, the plaintext fields store non-sensitive data, while the encrypted fields store sensitive data.

[0027] For fast and secure encryption and / or decryption, the flash controller 100 may also include an encryption / decryption circuit 130; the processor sends plaintext data and a key to the encryption / decryption circuit, and the encryption / decryption circuit encrypts the plaintext data and sends the encrypted data back to the processor; for decryption, the processor sends the encrypted data and the key, and receives the plaintext data.

[0028] Figure 1B FIG. 1 is a block diagram schematically showing a secure flash controller 100B according to another embodiment of the present invention. Figure 1B The example implementation shown is similar to Figure 1A The example implementation shown differs in that the encryption / decryption circuit is placed between the processor and the flash memory interface; in the flash memory controller 100B, the encryption / decryption only converts between encrypted and plaintext data.

[0029] Therefore, according to the example implementation shown in FIG. 1 , sensitive fields of a TLV record in a flash memory are protected by encryption, while non-sensitive fields, including the indication field, are retained in plain text, allowing the number of erase cycles to be reduced, thereby improving reliability.

[0030] It should be understood that the configuration of the flash controller 100 and its components and the TLV record 116 shown in FIG. 1 are example configurations shown purely for conceptual clarity. Any other suitable configuration may be used in alternative embodiments. For example, in some alternative embodiments, multiple processors and / or multiple RAMs may be used; in embodiments, the processor 102 uses software encryption and / or decryption, reduces the functionality of the encryption / decryption circuit 130, or eliminates the encryption / decryption circuit entirely.

[0031] In an embodiment, data transfer between encryption / decryption circuit 130, RAM 104, and flash interface 108 may be accomplished directly over a shared bus using, for example, direct memory access (DMA) or any other protocol.

[0032] In other embodiments, data encryption / decryption includes authentication, which may be performed using additional circuitry, using encryption / decryption circuitry, or using software.

[0033] The different elements of flash controller 100 including all its components may be implemented using suitable hardware, for example in an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA), using software, or using a combination of hardware and software elements.

[0034] In some embodiments, processor 102 comprises a general purpose programmable processor that is programmed in software to perform the functions described herein. The software may be downloaded to the processor in electronic form, such as over a network, or it may alternatively or additionally be provided and / or stored on a non-transitory tangible medium, such as a magnetic, optical or electronic memory.

[0035] Figure 2 FIG. 1 is a diagram schematically showing the structure of a TLV record 116 according to an embodiment of the present invention. The TLV record (116, FIG. 1) includes a plaintext field 118 and an encrypted field 120. Figure 2 In the example embodiment shown, the non-encrypted plaintext field 118 includes an invalid indication field 200, a programming indication field 202 (the invalid indication field 200 and the programming indication field 202 typically each include one bit), a miscellaneous attribute field 204 that can be used to store record attributes, and a length field 206 that indicates the length of the TLV record (e.g., in 32-bit words). (In some embodiments, the plaintext field is minimized and the miscellaneous attribute field 204 is not used.)

[0036] The encryption field 120 includes a type field 208 that may be used to define a data type (eg, code, table, etc.) and a data structure field 210 that includes the data content of the TLV record.

[0037] When erasing a flash memory page, all bits are set to an initial value (e.g., logic 1), and therefore any TLV records that may have been stored in the page are erased. The erase, program, and invalid indicators have a logic value of 1 and are therefore interpreted as not programmed and not invalid, respectively.

[0038] When the processor checks whether a TLV record is valid, the processor may first verify that the programming indication is set and the invalidation indication is not set. When the processor writes a TLV record, the processor may first verify that the programming indication of the TLV record is not set. When the processor writes a new TLV record that replaces an existing record, the processor programs the invalidation field of the existing record. (Refer to Figure 3 and Figure 4 Describes how to perform the above read and write operations. )

[0039] Understandably, Figure 2 The structure of the TLV record 116 shown in FIG, including its various fields, is an example, which is shown only for the purpose of conceptual clarity. Any other suitable configuration may be used in alternative embodiments. For example, in some embodiments, additional encrypted and / or non-encrypted fields may be used; in other embodiments, some (or all) of the miscellaneous attributes may be encrypted.

[0040] In some embodiments, no programming indication is required. When a page is erased, the length field will be set to zero (in an embodiment, the erase operation sets all bits to logic 1, so the length field uses negative logic). Whenever a page is programmed, the length field is set to a non-zero value. Therefore, a non-zero length field can be used to indicate that a page is programmed.

[0041] According to an embodiment of the present invention, we will now describe a method of managing TLV records 116 in flash memory 106. In an embodiment, for faster operation, processor 102 maintains a TLV descriptor table in RAM 104 (FIG. 1). For each TLV record 116, the table may include a pointer to the location of the TLV in flash memory, a mirror of program and invalid indications (in some embodiments, the descriptor table may also include, for example, a mirror of miscellaneous attribute fields, and a plain text version of the type field). It is assumed that the TLV records are stored contiguously in flash memory.

[0042] Figure 3 3 is a flowchart 300 schematically illustrating a method for building a TLV descriptor table in RAM according to an embodiment of the present invention. The flowchart is typically executed by the processor 102 (FIG. 1) after power-on or other type of hard reset.

[0043] The process begins at a set pointer step 302, where the processor sets a pointer to point to the first TLV record. For example, this location is typically fixed at the beginning of the flash memory address space. Next, at a check programming step 304, the processor reads the programming indicator of the TLV record. If the programming indicator is not set, the current record is the last TLV stored in the flash memory (as described above, according to Figure 3 In the example embodiment shown, the TLV records in the flash memory are consecutive, and the first indication of an unprogrammed TLV means that the previous TLV was the last programmed TLV). If the programming indicator is set, the processor reads the plaintext fields of the TLV record in a read TLV step 306 and enters a check valid step 308, where the processor checks whether the invalid indicator is not set (indicating a valid TLV). If so, the processor will enter a storage step 310, where the processor stores the plaintext of the TLV in the TLV descriptor table, including the pointer and optionally some other plaintext fields (but not including the invalid indicator). The processor will then enter an add length step 312.

[0044] If the processor identifies in step 308 that the TLV is marked as invalid, the processor will skip step 310 and proceed directly to step 312 .

[0045] In step 312, the processor adds the length field to the pointer, which will now point to the next TLV record. After step 312, the processor re-enters step 304 to check for the next TLV record. If in step 304, the program bit is not set (thus, there are no more TLVs programmed in the flash memory), the process ends.

[0046] Figure 4 FIG. 4 is a flow chart 400 schematically illustrating a method of reading, programming, and invalidating TLV records 116 in flash memory 106 according to an embodiment of the present invention. The flow may be executed by processor 102 ( FIG. 1 ).

[0047] The process begins at a check operation step 402, where the processor checks which of the three TLV operations should be performed. If the operation is to read a TLV record, the processor proceeds to a set pointer step 404 and sets the pointer to point to the location of the Nth TLV record in the flash memory (which location is stored in the RAM 104 in the TLV descriptor table). The processor will then read the TLV record from the flash memory at a read TLV step 406; decrypt the encrypted field at a decryption step 408, and end the process.

[0048] If the operation in step 402 is to invalidate the Nth TLV record, the processor proceeds to a set pointer step 410 and sets the pointer to point to the location of the Nth TLV record in the flash memory (read from the TLV descriptor table). The processor will then program the invalid indicator of the TLV record in a set invalid step 412 to indicate that the record is invalid, and modify the descriptor table in a modify descriptor step 414 to indicate that the Nth TLV record is invalid. The processor will then end the process.

[0049] If the operation is programming a new TLV record in step 402, the processor proceeds to a set pointer step 416 and sets the pointer to the location of the first unprogrammed TLV record. The processor then encrypts the encryption field in an encryption step 418 and sets the programming indicator in a set programming step 420 to indicate that the current TLV record is programmed. Next, in a program-TLV step 422, the processor programs the TLV record, including all encrypted and plaintext fields. Finally, at an add descriptor step 424, the processor adds an entry in the TLV descriptor table that includes a pointer to the newly added TLV record, and the process ends.

[0050] In summary, this article refers to Figure 3 and Figure 4 The described method facilitates the safe and reliable use of flash-based TLV records, including maintaining a descriptor table of flash TLV records ( Figure 3 ); and includes reading, programming, and invalidation of TLV records ( Figure 4 ).

[0051] It should be understood that the above reference Figure 3 and Figure 4 The methods shown in the flowcharts 300 and 400 described are cited by way of example. The methods and flowcharts according to the disclosed technology are not limited to the above description. In alternative embodiments, for example, the order of operations can be changed, some steps can be performed in parallel and some steps can be embedded in other steps. In some embodiments, some or all steps of the flowchart can be performed by the flash memory control / interface 108 (Figure 1) or by other circuits.

[0052] In some embodiments, the structure of the descriptor table may vary. In an embodiment, there is no TLV descriptor table and the processor calculates the pointer to the TLV record by serially reading and summing the lengths of consecutive TLV records.

[0053] It should be understood that the above-mentioned embodiments are cited by way of example, and the present invention is not limited to what has been specifically shown and described above. On the contrary, the scope of the present invention includes the combination and sub-combination of the various features described above, as well as changes and modifications that those skilled in the art would think of after reading the foregoing description and are not disclosed in the prior art. The documents incorporated by reference in this patent application should be considered as an integral part of this application, unless any term defined in these incorporated documents in a manner that conflicts with the explicit or implicit definition in this specification, only the definition in this specification should be considered.

[0054] Although the embodiments described herein are primarily directed to secure flash memory, the methods and systems described herein may also be used in other applications, including (but not limited to) any other suitable type of programmable memory (eg, PROM and EFUSE based memory).

[0055] It should therefore be understood that the above embodiments are cited as examples, and the present invention is not limited to the contents specifically shown and described above. On the contrary, the scope of the present invention includes combinations and sub-combinations of the various features described above, as well as changes and modifications that would occur to a person skilled in the art after reading the foregoing description and that are not disclosed in the prior art. The documents incorporated by reference into this patent application should be considered as an integral part of this application, unless any term defined in these incorporated documents in a manner that conflicts with the explicit or implicit definition in this specification, only the definition in this specification should be considered.

Claims

1. A computing device, comprising: a non-volatile memory (NVM) interface configured to communicate with the NVM; and A processor, the processor being configured to: storing each TLV record in the NVM type-length-value (TLV) record, comprising one or more encrypted fields and one or more non-encrypted fields, the non-encrypted fields comprising at least a respective validity indicator of the TLV record; Reading the TLV record including the encrypted field and the non-encrypted field from the NVM; as well as The selected TLV records are invalidated by modifying the respective validity indicators of the selected TLV records stored in the non-encrypted fields. 2 . The computing device of claim 1 , wherein the processor is configured to invalidate the selected TLV record without decrypting any of the encrypted fields. The computing device of claim 1 , wherein the NVM comprises flash memory.

4. The computing device of claim 1, wherein in a given TLV record, the non-encrypted field includes one or more indications that a TLV has been programmed, and one or more indications that the programmed TLV is invalid.

5. The computing device of claim 1 , wherein for a given TLV record, the processor is configured to read only the non-encrypted fields from the NVM and to avoid reading or decrypting the encrypted fields when the non-encrypted fields indicate that the given TLV record has been invalidated.

6. The computing device of claim 1, wherein the encrypted field comprises a data field of the TLV record.

7. The computing device of claim 1, wherein the encrypted field comprises a type field of the TLV record.

8. The computing device of claim 1, wherein the non-encrypted field comprises a length field of the TLV record.

9. The computing device of claim 1 , wherein the processor is configured to encrypt plaintext data stored in the NVM to create one or more TLV records storing the encrypted plaintext data in the encryption field, and to store the one or more TLV records in the NVM.

10. The computing device of claim 1, wherein the processor is configured to read one or more TLV records from the NVM and extract plaintext data from the one or more TLV records by decrypting at least some of the encrypted fields.

11. A method comprising: storing type-length-value (TLV) records in a non-volatile memory (NVM), each TLV record comprising one or more encrypted fields and one or more non-encrypted fields, the non-encrypted fields comprising at least a respective validity indicator of the TLV record; Reading the TLV record including the encrypted field and the non-encrypted field from the NVM; as well as The selected TLV records are invalidated by modifying the respective validity indicators of the selected TLV records stored in the non-encrypted fields.

12. The method of claim 11, wherein the selected TLV record is invalidated without decrypting any of the encrypted fields. The method of claim 11 , wherein the NVM comprises flash memory.

14. The method of claim 11, wherein in a given TLV record, the non-encrypted field includes one or more indications that a TLV has been programmed, and one or more indications that the programmed TLV is invalid.

15. The method of claim 11, wherein reading a given TLV record comprises reading only the non-encrypted fields of the given TLV record from the NVM and avoiding reading or decrypting the encrypted fields when the non-encrypted fields indicate that the given TLV record has been invalidated.

16. The method of claim 11, wherein the encrypted field comprises a data field of the TLV record.

17. The method of claim 11, wherein the encrypted field comprises a type field of the TLV record.

18. The method of claim 11, wherein the non-encrypted field comprises a length field of the TLV record.

19. The method of claim 11, wherein storing the TLV record comprises encrypting plaintext data stored in the NVM to create one or more TLV records storing the encrypted plaintext data in the encryption field, and storing the one or more TLV records in the NVM.

20. The method of claim 11, wherein reading the TLV record comprises reading one or more TLV records from the NVM and extracting plaintext data from the one or more TLV records by decrypting at least some of the encrypted fields.