System and method for correction of memory errors
11475170 · 2022-10-18
Assignee
Inventors
Cpc classification
H04L9/32
ELECTRICITY
G06F21/79
PHYSICS
G06F21/64
PHYSICS
H04L9/3242
ELECTRICITY
G06F21/76
PHYSICS
H04L2209/34
ELECTRICITY
G11C29/52
PHYSICS
G06F11/1048
PHYSICS
G11C2029/4402
PHYSICS
G11C29/883
PHYSICS
International classification
G06F21/00
PHYSICS
G06F21/76
PHYSICS
G06F11/10
PHYSICS
H04L9/32
ELECTRICITY
Abstract
A self-correcting memory system comprising an integrated circuit including memory and memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and error correction functionality which is operative to apply at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, call said authentication for application to the possibly correct word entity, and if the authentication's output is “authentic”, to replace said erroneous word entity in said memory, with said possibly correct word entity thereby to yield error correction at a level of confidence derived from the level of confidence associated with the authentication.
Claims
1. A self-correcting memory system comprising: an integrated circuit including: memory and memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and error correction functionality which is operative to apply at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, call said authentication for application to the possibly correct word entity, and if the authentication's output is “authentic”, to replace said erroneous word entity in said memory, with said possibly correct word entity, wherein said authentication functionality is operative to perform cryptographically strong authentication, wherein said authentication functionality is also operative to perform word-authentication, wherein said strong authentication yields a single value that vouches for a body of data within which at least one erroneous word is replaced with its proposed correction, and wherein said word-authentication is performed on said word replaced with its proposed correction.
2. The system according to claim 1 wherein said error correction functionality is configured for: applying at least one possible correction to at least one erroneous word in said memory, yielding a possibly correct word, calling said word-authentication for application to the possibly correct word, if the word-authentication's output is “authentic”, subsequently calling said strong authentication for application to an entire memory image/chunk including the possibly correct word, and if the strong-authentication's output is “authentic”, to replace said erroneous word in said memory, with said possibly correct word, thereby to yield error correction at a level of confidence derived from the level of confidence associated with the strong authentication and/or word-authentication.
3. The system according to claim 1 wherein said erroneous word is detected by word-authentication applied to at least one word in said memory and wherein any word which yields a “non-authentic” output is considered erroneous and any word which yields an “authentic” output is considered non-erroneous.
4. The system according to claim 1 wherein said correction comprises a flip of at least one bit in the erroneous word entity from 0 to 1 or from 1 to 0.
5. The system according to claim 1 wherein possible corrections are applied to plural erroneous words yielding plural possibly correct words, and wherein said strong authentication is called once for application to a revised memory image/chunk in which all of said plural erroneous words are replaced with said possibly correct words respectively, rather than calling said strong authentication plural times for application to memory images/chunks respectively including said plural possibly correct words respectively, thereby to save memory and/or correction time.
6. The system according to claim 1 wherein at least first and second possible corrections are applied to at least one erroneous word and wherein any bit in the erroneous word which is flipped in the first correction is unflipped before the second possible correction is applied to said erroneous word, thereby to undo the first possible correction of the erroneous word before applying the second possible correction to the same erroneous word.
7. The system according to claim 6 wherein all possible corrections are applied to at least one erroneous word.
8. The system according to claim 7 wherein said erroneous word to which all possible corrections are applied comprises an erroneous word for which none of the possible corrections tried results in correct word authentication, until the last possible correction is tried, in which case the erroneous word is regarded as uncorrectable.
9. The system according to claim 6 wherein at least one heuristic is employed to determine a subset of possible corrections including less than all possible corrections and wherein only possible corrections in the subset are applied to at least one erroneous word, even if none of the possible corrections in the subset results in correct word authentication.
10. The system according to claim 1 wherein said authentication functionality, operative to compare content to be authenticated to a standard, is operative to apply strong auth to said content to be authenticated which is stored at a given memory location, at a time t2, thereby to yield a “computed” auth value, and to compare said computed auth value to a stored result, aka expected auth value, generated by applying strong auth to content of said memory, at said given memory location, at a previous time t1 earlier than t2 at which time the authenticity of memory contents is known to be correct.
11. The system according to claim 10 wherein said previous time t1 is a time at which a firmware update of said memory occurred.
12. The system according to claim 1 wherein said error correction functionality is operative to apply at least one possible correction to at least one erroneous word in said memory, yielding a possibly correct word, to call said authentication for application to the possibly correct word, and if the authentication's output is “authentic”, to replace said erroneous word in said memory, with said possibly correct word.
13. The system according to claim 1 wherein said error correction functionality is operative to apply at least one possible correction to at least one erroneous word entity's word auth, yielding a possibly correct word entity, to call said authentication for application to the possibly correct word entity, and if the authentication's output is “authentic”, to replace said erroneous word auth in said memory, with said possibly correct word auth.
14. The system according to claim 1 wherein at least one heuristic is employed to order the possible corrections such that possible corrections ordered earlier would have greater a priori chances to be correct than possible corrections ordered later, thereby to shorten expected overall correction time.
15. The system according to claim 1 wherein said memory content authentication functionality performs cryptographic authentication of memory content.
16. The system according to claim 1 wherein said erroneous word entity includes multiple bits and wherein said at least one possible correction comprises plural possible corrections each comprising a flip of at least one of said erroneous word entity's multiple bits, thereby to define plural flips, each of said plural flips flipping at least one of said erroneous word entity's multiple bits.
17. The system according to claim 16 wherein each of said plural flips is operative to flip exactly one of said erroneous word entity's multiple bits.
18. The system according to claim 16 wherein each of said plural flips is operative to flip no more than two of said erroneous word entity's multiple bits.
19. A method for providing a self-correcting memory system, the method comprising: providing an integrated circuit including memory and memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and applying at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, calling said authentication for application to the possibly correct word entity, and, each time the authentication's output is “authentic”, replacing said erroneous word entity in said memory, with said possibly correct word entity, wherein said authentication functionality is operative to perform cryptographically strong authentication, wherein said authentication functionality is also operative to perform word-authentication, and wherein said strong authentication yields a single value that vouches for a body of data within which at least one erroneous word is replaced with its proposed correction, and wherein said word-authentication is performed on said word replaced with its proposed correction.
20. The method according to claim 19 which provides error correction functionality for memory content which resides on an integrated circuit's target (non-volatile or volatile) memory, the method comprising at least once: detecting an error in memory content residing in target memory searching, through at least some bit-permutations constituting respective possible fixes of the error, for at least one on-the-fly signature match, thereby to define a proposed fix which achieves successful strong auth if at least one on-the-fly signature match is found, using overall authentication as a final verification for said proposed fix, and if verified, correct said code, using a power-fail safe code recovery update process, thereby to provide error correction for said target memory without taking the target memory to a lab.
21. The method according to claim 20 and also comprising providing an output indication that memory recovery is needed e.g. by taking at least the target memory to a lab for secured, complete reprogramming, because memory content correction has failed.
22. The method according to claim 21 wherein, before providing said output indication, said searching is performed only over single-bit permutations of said error.
23. The method according to claim 21 wherein, before providing said output indication, said searching is performed over all single-bit and double-bit permutations of said error.
24. The method according to claim 21 wherein, before providing said output indication, said searching is performed over all single-bit permutations of said error and if no match is found, then said searching is again performed, this time over at least some double-bit permutations of said error.
25. The method according to claim 21 wherein, before providing said output indication, said searching is performed at least one more time over single-bit permutations of said error.
26. The method according to claim 20 and also comprising protecting memory content residing on target memory, before said detecting, both by strong-auth performed once and by on-the-fly word auth.
27. The method according to claim 26 wherein said strong-auth performed once comprises strong-auth performed just after the integrated circuit wakes up from a less active state.
28. The method according to claim 27 wherein said strong-auth performed once comprises strong-auth performed just after the integrated circuit powers-up.
29. The method according to claim 27 wherein said strong-auth performed once comprises strong-auth performed just after the integrated circuit exits a sleep state.
30. The method according to claim 20 wherein said memory content comprises code stored in the target memory.
31. The method according to claim 20 which yields error correction at a level of confidence derived from the level of confidence associated with the authentication.
32. The system according to claim 19 and wherein said strong authentication authenticates at a higher level of confidence than said word-authentication.
33. A self-correcting memory system comprising: an integrated circuit including: a memory; and memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and error correction functionality which is operative to apply at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, call said authentication for application to the possibly correct word entity, and if the authentication's output is “authentic”, to replace said erroneous word entity in said memory, with said possibly correct word entity wherein at least first and second possible corrections are applied to at least one erroneous word and wherein any bit in the erroneous word which is flipped in the first correction is un-flipped before the second possible correction is applied to said erroneous word, thereby to undo the first possible correction of the erroneous word before applying the second possible correction to the same erroneous word.
34. A self-correcting memory system comprising: an integrated circuit including: a memory; memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and error correction functionality which is operative to apply at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, call said authentication for application to the possibly correct word entity, and if the authentication's output is “authentic”, to replace said erroneous word entity in said memory, with said possibly correct word entity, wherein said erroneous word entity includes multiple bits and wherein said at least one possible correction comprises plural possible corrections each comprising a flip of at least one of said erroneous word entity's multiple bits, thereby to define plural flips, each of said plural flips flipping at least one of said erroneous word entity's multiple bits.
35. A method for providing a self-correcting memory system, the method comprising: providing an integrated circuit including a memory and memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and applying at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, calling said authentication for application to the possibly correct word entity, and, each time the authentication's output is “authentic”, replacing said erroneous word entity in said memory, with said possibly correct word entity, wherein at least first and second possible corrections are applied to at least one erroneous word and wherein any bit in the erroneous word which is flipped in the first correction is unflipped before the second possible correction is applied to said erroneous word, thereby to undo the first possible correction of the erroneous word before applying the second possible correction to the same erroneous word.
36. A method for providing a self-correcting memory system, the method comprising: providing an integrated circuit including a memory and memory content authentication functionality, which is operative to compare content to be authenticated to a standard and to output “authentic” if the content to be authenticated equals the standard and “non-authentic” otherwise; and applying at least one possible correction to at least one erroneous word entity in said memory, yielding a possibly correct word entity, calling said authentication for application to the possibly correct word entity, and, each time the authentication's output is “authentic”, replacing said erroneous word entity in said memory, with said possibly correct word entity, wherein said erroneous word entity includes multiple bits and wherein said at least one possible correction comprises plural possible corrections each comprising a flip of at least one of said erroneous word entity's multiple bits, thereby to define plural flips, each of said plural flips flipping at least one of said erroneous word entity's multiple bits.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) Certain embodiments of the present invention are illustrated in the following drawings:
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
(11)
(12)
(13)
(14) Methods and systems included in the scope of the present invention may include some (e.g. any suitable subset) or all of the functional blocks shown in the specifically illustrated implementations by way of example, in any suitable order e.g. as shown.
(15) Computational, functional or logical components described and illustrated herein can be implemented in various forms, for example, as hardware circuits such as but not limited to custom VLSI circuits or gate arrays or programmable hardware devices such as but not limited to FPGAs, or as software program code stored on at least one tangible or intangible computer readable medium and executable by at least one processor, or any suitable combination thereof. A specific functional component may be formed by one particular sequence of software code, or by a plurality of such, which collectively act or behave or act as described herein with reference to the functional component in question. For example, the component may be distributed over several code sequences such as but not limited to objects, procedures, functions, routines and programs, and may originate from several computer files which typically operate synergistically.
(16) Any logical functionality described herein may be implemented as a real time application, if and as appropriate, and which may employ any suitable architectural option such as but not limited to ASIC or DSP or any suitable combination thereof. Any hardware component mentioned herein may in fact include either one or more hardware devices e.g. chips, which may be co-located or remote from one another.
DETAILED DESCRIPTION OF CERTAIN EMBODIMENTS
(17) IC makers are eager to secure the contents of their integrated circuits' memories.
(18) The embodiments herein are applicable to memories of many different technologies, hence the term “flash” when used herein is used only by way of example.
(19) A system for ensuring integrity of memory content, in ICs, is described in detail. Typically, access to such memory is controlled; a digest may be used to sign a controlled, hence authorized memory update. Thus, any change in the memory which is not a result of that controlled access, is an undesirable error, whether malicious or, perhaps, due to a transitional physical or electrical failure e.g. of the physical memory itself. The system herein is operative to test possible corrections for errors, reducing “out-of-order” time for the computer or other product in which the integrated circuit is embedded. Typically, (one or more levels of) authentication functionality, which the integrated circuit typically needs for other purposes anyhow, is used to verify or approve possible corrections, such as using word-auth for discovering errors and initially verifying proposed corrections thereof, and using strong-auth for finally verifying proposed corrections.
(20) Certain embodiments provide error detection and recovery (aka error correction) functionality in integrated circuits whether by providing integrated circuits such as that shown in
(21) Certain embodiments provide error detection and recovery functionality in integrated circuits including detection (e.g. based on conventional authentication) for identifying events in which memory contents has been altered, and recovering from these events to enable the IC (and the device e.g. pc in which the IC is embedded) to continue operating as usual with as little as possible overhead for the end-user of the device. This is particularly advantageous because this means that some events, which today cause a PC, for example, which an end-user is working on, to “break”, and necessitates the end-user to take his computer to a lab to fix, will not need this according to certain embodiments described herein, because the component with the memory fault rectifies itself by itself, thereby maintaining the security of the system.
(22) The error correction functionality may be implemented as any suitable combination of HW and FW. the memory is typically configured to support the structure of auth+word auth. Typically, on-the-fly word auth is implemented in hardware (while reading the memory). The strong auth is typically implemented in firmware, typically using suitable crypto HW to accelerate the process. bit flipping+consistency check may be implemented in either FW or HW. The actual update of memory contents to correct an error is typically done by FW, in view of the complex operations, e.g. NVM erase and re-write, which are sometimes involved.
(23) The system of
(24) Access control functionality (e.g. as shown in
(25) Functionality for testing possible error corrections e.g. as per the method of
(26) The system of
(27)
(28) It is appreciated that the term overhead may be used herein to include storage needs engendered by authentication, or by error correction, or other memory management processes which may be stored in any suitable location. For example, in word auth (aka word-level auth) or word ECC, the memory may be produced with a wider word length, thus the auth/ECC may be stored right next to the word, such that when reading the word, the auth/ECC bits are accessed as well. Or, in hardware systems, an additional memory component read may be implemented concurrently with reading the actual payload desired (as opposed to its auth/ecc bits), to allow effectively greater word length since the memory's entire word length may then be devoted to the actual payload, with the payload's auth/ecc bits stored elsewhere.
(29) The method of
(30) 10: Provide an integrated circuit in which memory content e.g. code stored in memory, is protected by both: Power-up ‘strong auth’ (e.g. HMAC or CMAC, say on a large code segment)—e.g., against cold flash content replacement On-the-fly ‘word auth’ (say 128 bit payload+16 bit auth)—e.g., against hot flash content replacement e.g. when executing code straight from flash. on-the-fly encryption, decryption and authentication are described in the following co-pending patent document, the disclosure of which is hereby incorporated by reference: https://patents.google.com/patent/US9525546B2/en
(31) 20: each time on-the-fly word auth fails (e.g. during runtime), the integrated circuit halts (e.g. until next power-up) or is automatically restarted. For example, assume there is code in the memory space that is to be secured. Reading from the memory thus typically means that a processor in the IC is fetching code from that memory space, which in turn typically means that if a word auth failure is identified, the subject processor just fetched altered code. At this point the processor may be halted, to prevent execution of altered code, and recovery typically needs to start. Recovery may include, say, jumping to another code which is known to be 100% secure, e.g. code in ROM, or resetting to restart execution from ROM, which triggers error correction and/or verification e.g. as described herein, whether by software or by hardware.
(32) 30: On next power-up (or as per the above example) all ‘word auth’ are checked as part of the ‘strong auth’ computation already being used to protect the memory content. If a ‘word auth’ fails during power-up auth (as opposed to during runtime), this constitutes error detection, and therefore the integrated circuit attempts to correct the error that has been found in its memory content e.g. by performing all or any subset of operations 140-170 of
(33) 80: if the memory is a code execution memory, a suitable Power-fail safe Code recovery update flow may be executed if error correction e.g. performing all or any subset of operations 140-170 of
(34) The method of
(35) 140: All one bit permutations (say: 128+16 permutations in the illustrated embodiment) of the bad word (word in which error was found e.g. because ‘word auth’ failed for this word, during power-up auth) are checked, searching for a match. It is emphasized that any suitable proportion may exist between the data and authportions; the 128 and 16 bit parameters are merely illustrative.
(36) A dedicated HW or SW may quickly scan all permutations (e.g. on memory or as part of memory control and interface unit without needing to iteratively write-to/read-from memory e.g. flash).
(37) According to certain embodiments, a dedicated buffer holds the data structure of the bad word, where the bad word may be manipulated bitwise. Dedicated firmware code, or a hardware state machine, then scans permutations of the data structure, flipping one bit (see e.g.
(38) It is appreciated, generally, that scanning of permutations may be accomplished by firmware, or, alternatively, may be accomplished by dedicated hardware.
(39) 150: If a match is found, the erroneous data or content as corrected or rectified (e.g. the proposed correction of erroneous content) may be digested as part of the ‘strong auth’ computation. Depending on the auth algorithm and the number of corrected bits, it may be that more than one match may be found. In this case, all permutations of matching bit combinations, aka patterns, may be tried and the one that yields the correct ‘strong auth’ is taken. Correct typically means that the result of strong auth with (or applied to) the rectified code is equal to the pre-computed result of strong auth with (or applied to) the original contents of the memory.
(40) For example, for one-bit errors the method may include flipping a first bit e.g. bit 0 and checking auth; then subsequent bits e.g. bit 1, 2 etc. until a match is found. For 2 bit errors, each pair of bits may be flipped and each possible pair of values for the two bits is typically considered separately.
(41) 160: otherwise, optionally, try to correct more than one error e.g. by searching again, this time over at least some double-bit permutations of the error. It is appreciated that if more than one error (involving more than one bit) can be corrected with high likelihood, but according to some embodiments errors involving plural bits are not corrected because computation is more complicated than for one bit, requiring ˜XA{circumflex over ( )}2/2 (˜144{circumflex over ( )}2/2) checks.
(42) 170: If error cannot be corrected, typically an alert is provided to the end-user e.g. via higher level software as shown in
(43)
(44) The method of
(45) The method of
(46) Operation 210: Identify the flash pages to be corrected. If there is more than one page, for each, keep (an indication of) the words (addresses+data) that needs to be corrected in volatile memory. Next, perform operation 220 to correct immediately, or operation 230, to correct after the next boot.
(47) Operation 220: correct each page that needs to be corrected, e.g. by performing, for each page, all of operations 310-350 in
(48) Operation 230: During boot time, before flash code authentication is performed, the boot code checks if there is a page which is known to be e.g. marked as usable, and if so, the boot code completes all or any subset of operations 310-350 before continuing the boot. Otherwise, some higher level firmware may perform ‘garbage collection’, e.g. condensing memory contents to occupy the smallest possible memory space, thus freeing at least one page for the temporary purpose of error correction.
(49) The method of
(50) Operation 310: Write the flash page address and corrected data (code) in a reserved predefined flash page and verifies that it was written correctly.
(51) Operation 320: Set a bit in the reserved page that indicates e.g. to other firmware that this page carries valid info, or is in use and should not be erased. The bit is also useful in case the system of the present invention is interrupted, e.g. by user power-off, and seeks to resume operation thereafter.
(52) Operation 330: Erase original flash page (that in which error/s was/were found in operation 210 of
(53) Operation 340: Update original flash page with corrected data from the reserved flash page and verify that it was written correctly
(54) Operation 350: Erase the reserved page to enable future use thereof for correction of errors in other pages
(55) Variants re what triggers performance of the error detection/correction method of
(56) I. On the fly: respond to word auth failures by a memory check right away: if a word auth mismatch is found while reading from the target memory, the process is gone through before whatever comes next in the execution sequence of the processor doing the execution.
(57) For example, if code from the memory is being executed, and during code fetch word auth failure is identified, execution typically halts to allow, say, the whole memory space or array to be scanned for failures or errors. Thereafter, the halt is terminated, and whatever comes next in the execution sequence of the processor is executed, or execution may be restarted from the beginning of the code. In the case of data which is not code, there may be an indication of error during data read, in which case, again, the processor may halt and the memory scanning/correction/verification may be triggered.
(58) II. Power-up: triggered by each event of the integrated circuit waking up from a less active state e.g. power up, or change of state from sleep to active, the strong auth is recomputed, compared to the pre-computed strong auth, and in case of a mismatch between the re-computed and pre-computed strong auth, the error correction mechanism is invoked as described above.
(59) III. Periodic aka scrubbing: upon occasion, the strong auth is recomputed, compared to the pre-computed strong auth, and in case of a mismatch between the re-computed and pre-computed strong auth, the process of memory error correction as described herein may be invoked. This trigger may be implemented, say, using some programmable timer which gives an indication of a time at which the above is to be performed.
(60) This typically has some penalty because regular operation of the integrated circuit is disturbed and interrupted, but greater protection is achieved.
(61) IV. Initiated: triggered by external event, e.g. if a device aka integrated circuit identifies e.g. using hardware or firmware hack detection which may be present in the IC, an attempt of hacking, or possibly some other functional error, the strong auth is recomputed, compared to the pre-computed strong auth, and in case of a mismatch between the re-computed and pre-computed strong auth, the process of memory error correction as described herein may be invoked.
(62) V. Access-triggered: check the whole target memory each time the memory is accessed; practical e.g. for code which gets executed infrequently. This embodiment is suitable e.g. if the memory is accessed very rarely and real-time data integrity is imperative such that performance overhead is relatively unimportant.
(63) It is appreciated that all or any subset of the above variants may be provided, in any given device.
(64) A flow for operation of the integrated circuit of
(65) Operation 1001—Fill the memory zone with contents, e.g. code, which includes a multiplicity of words. For each word, compute the “word auth” while writing, and store the “word auth” e.g. adjacent to the word.
(66) Operation 1002—Run “strong auth” over the memory contents and store the result somewhere in the memory (may be pre-computed e.g. by an entity preparing the memory image offline, which has the capability of executing strong auth] and provided to the IC in which the secured memory array 2 resides.
(67) It is appreciated that not uncommonly, a memory image is prepared outside an IC and “injected” into the IC for programming together with authentication code attached to the contents.
(68) Operation 1003—Use the memory as usual including performing memory reads. Each memory read includes:
(69) computation of a current aka recomputed “word auth”,
(70) reading from memory, the pre-computed word-auth stored in Operation 1001, and comparing the two.
(71) If recomputed “word auth” equals the pre-computed word-auth read from memory, continue because all is well. Otherwise (not equal), assume an error has been identified, thus enter error correction sequence.
(72) A suitable error correction sequence flow, including testing possible error corrections, is shown in
(73) Operation 1006—perform error correction on content to be corrected including the word and its associated word auth, combined e.g. concatenated thereby to provide a combined string of bits. Error correction includes: scan all bits, flip each bit (if aiming to correct' one-bit errors, and/or each pair of bits, if aiming to correct two-bit errors) in the combined string of bits and recheck the word auth. Do not compare to the word auth stored in memory because the error may be in the word auth, not in the word. Instead, flip a bit, recompute the word auth and compare recomputed word auth e.g. to the word auth that is available on hand. For example, a structure of X bits of data and Y bits of auth may be read from memory. Bits then are flipped in the combined structure. If the bit being flipped is within the X bits of data, re-compute the auth for the corrected X bits of data and compare that re-computed auth to Y bits of auth that were read from the memory.
(74) If the bit being flipped is one of the Y bits of auth, re-compute the auth for the X bits of data read from memory and compare to the corrected Y bits of auth.
(75) If a match is found (comparison finds equality between the compared word auth's), this indicates a “consistent” word and word auth, skip to Operation 1009. If no match is found, flip next bit (or pair thereof) and repeat re-computation and comparison. It is appreciated that here and elsewhere, the term “next” may be physically adjacent or may be a bit deemed sequential or next in sequence by virtue of an ordering between bits defined by any suitable heuristic.
(76) Operation 1008—Reaching this point typically means no bit-flip (or pair thereof, for two-bit errors) yielded a workable correction thus error correction has failed on the word-level; thus flag uncorrectable memory contents, e.g. by alerting higher-level software as shown in
(77) Operation 1009—Do “strong auth” including computing a digest e.g. HMAC for the whole memory zone, thereby to yield a strong-auth result. Typically, strong auth yields a digest/MAC/signature.
(78) Operation 10010—Compare the strong auth result to the pre-computed pre-computed strong-auth result stored in memory in Operation 1002. If the results are equal, there is a strong-auth match; otherwise (unequal) there is a strong-auth mismatch.
(79) Operation 10011—If there is a strong auth match—memory contents is qualified after correction, continue using memory as usual e.g. go to Operation 1003
(80) Operation 10012—else i.e. If there is a strong auth mismatch—perform mismatch process e.g. as in
(81) A suitable flow for the mismatch process in Operation 10012, is shown in
(82) Operation 10012.5: scan the whole memory 2 in
(83) Operation 10013—redo strong auth by redoing Operations 1009-11.
(84) Operation 10014—If strong auth now fails (i.e. mismatch) assume unable to correct thus higher level of recovery may be needed; thus flag uncorrectable memory contents, e.g. by alerting higher-level software as shown in
(85) The functionality for testing possible error corrections e.g. as per the method of
(86) Hardware implementation of all or most of the above, would typically yield best performance e.g. because if the entire flow is in hardware, on-the-fly verification is performed by hardware while using the memory, translating into no performance penalty if there is no error.
(87) If almost all implementation is in firmware, on-the-fly word auth may be omitted, instead making do with memory scanning periodically and/or on occasion to check for errors, and then performing correction and verification (e.g. operations 6-12 above) in case an error is found.
(88) If all implementation is in firmware, an existing aka legacy IC may be employed. An existing IC typically has an existing aka legacy memory structure, which may then be rearranged or managed logically in software, to store the word auths computed in the error correction process described herein. In such cases, error detection and correction would typically not be carried out on-the-fly but rather off-line, upon a certain trigger as described above.
(89) Any suitable implementation may be employed to ensure that the functionality for testing possible error corrections interfaces with or gets “auth services” from, the auth functionality, even in an existing or legacy IC in which the legacy auth is configured to compare memory contents to a certain standard (a digest computed right after the most recent authorized memory update, for example). The implementation typically ensures that the auth compares a proposed error to be tested, to that standard; this may be ensured e.g. as follows: i—FW may read data word+word auth from the memory. ii—FW may compute the auth for the data word, either itself or using some hardware dedicated for this purpose. iii—FW may compare the results of the computation to the auth value read from memory, and see whether the data structure is consistent, or has an error. iv—If the FW identifies an error, the FW may go through the bit flipping process described herein, computing the auth as in operation ii above. v—Once error correction is done through the memory, the FW may digest the whole memory contents, either by itself, or using some hardware which accelerates or eases the execution of whatever MAC algorithm the designer of the system has chosen for this purpose.
(90) An advantage of certain embodiments herein is error correction which engenders no extra overhead above the overhead for (strong and word, typically) auth which is needed anyway.
(91) Another advantage of certain embodiments herein is that speculative correction of errors (testing various possible error corrections) as described herein sets no hard limit on the number of bits. In contrast, convention error correction implements some kind of error correction code. For a given data size of X bits, to correct a certain, pre-decided number of errors, the number of binary combinations, and the method selected, dictate the numbers of bits required for error correction code. Once implemented, only the pre-decided number of bit errors, and no larger, can be rectified. The practical complexity of correcting errors typically grows with the number of bits one attempts to fix. However, if desired, very strong auth may be used to verify any number of errors corrected, enabling any number of bit errors to be corrected, if reasonable for a given use-case.
(92) Another advantage of certain embodiments herein is that utilization of authentication for verification yields error correction which truly is correct, at a high level of confidence. For example, if strong auth is used to verify proposed corrections, this typically means that once the result of the strong auth on the “rectified data” aka proposed correction, shows a match with (e.g. is equal to) the expected strong auth, this implies cryptographic-level confidence that the rectified data is truly correct.
(93) Another advantage of certain embodiments herein is protection against malicious content change as opposed to prior art systems which implement ECC (error correction code). However, a malicious attack may replace both the data and the error correction code, in a mutually consistent manner, such that the error appears to have been rectified, whereas in fact the content or code is bad or malicious. In contrast, by virtue of using auth for error correction as described herein, an attacker becomes unable to maliciously replace the data and the auth code as above, because the method herein is cryptographically strong.
(94) It is appreciated that use of on-the-fly authentication may be particularly advantageous since performance remains unimpaired (authentication takes place in parallel) and/or data that has been read can be used right away, without delay, unless it is found to contain error/s.
(95) Any memory e.g. code execution memory or large data blobs which are persistent or not often changed and/or especially if access to the memory content is controlled e.g. memory content which changes only via a secured or controlled (firmware) update, can benefit from the flow of
(96) It is appreciated that various solutions exist for controlled access to memory, other than secured (firmware) updates. In particular, various technologies are known which allow access to memory content to be tightly controlled, such as but not limited to memory whose content can only be executed aka execute-only memory, or memory whose content can only be read, and which can only be updated or written to via a dedicated gateway after obtaining certain access privilege or authenticating, or memory that can only be written to after changing access control settings which are alterable only when having a certain access privilege.
(97) Re memory content not often changed: For example, some memory content may be known to change typically at a frequency which is low enough, to cause the overhead engendered by the system and method described herein, to be cost effective. For example, code may be known to change only once every few months, say due to software updates occurring periodically or occasionally. Or, certain data may be known to change only once every few days or weeks, or may be known to change on average at those intervals. In contrast, some data may be manipulated by software, hence may change each time a program is executed or run.
(98) Many variations are possible.
(99) For example, according to some embodiments, an error is rectified aka corrected as soon as it is encountered, and the memory is then immediately repaired; after which whatever processes were being run, continue running.
(100) Alternatively or in addition, an overlay patch may be provided to enable the device to continue running, by deferring actual memory content repair until later. This may be advantageous because NVM handling, which may be lengthy rather than causing delays as the device attempts to get this done online, is instead taken off line and done later, such that the device is able to continue running. The cached in dedicated override patch (NV or volatile) may reside in any computer memory, typically on the same IC, which is accessible to whichever processor/s are using the target memory, so as to be pulled out in case of need for target memory recovery.
(101) Another example of possible variations is that any suitable authentication may be used to test possible error corrections, including but not limited to strong and word level auth, separately or in any suitable combination. It is even possible to detect errors based on strong auth over the whole memory, albeit inefficient in many contexts, if the flow demands going through the strong auth to just identify that an error exists in the memory, and once the error has been identified to exist, each memory bit may be flipped and then strong auth may be used to verify bit flips (or pairs thereof). Yet, although strong auth is a heavy, i.e. long and resource consuming, operation, this may be a perfectly viable implementation for small memory zones, for which there may be no need to provide two levels of auth.
(102) In many use cases, use of 2 levels (termed herein word and strong, and more generally differing in heaviness i.e. the former being less long and/or consuming less resources and the latter being longer and/or consuming more resources) is useful to ensure the process is efficient.
(103) For large memory zones, having the word auth, which is quite common, typically results in a much more efficient process, because errors may be detected on a word basis aka on the word level, and basic verification of proposed aka speculative corrections may also occur at the word level, thus strong auth to qualify or verify the correction need not be run too often, relative to embodiments in which the word-level auth is omitted.
EXAMPLES
(104) Example i: speculate a proposed correction, apply the proposed correction, then strong auth to verify the correction. If this fails, try again—speculate another correction, etc.
(105) Example ii: speculate a proposed correction, check word auth, if fails—speculate another proposed correction and again use word auth to check; continue until obtaining successful word auth. Then, use strong auth to finally verify the correction. Workable also without word auth.
(106) Another possible variation is that any suitable method may be used to actually make a verified proposed correction, on memory contents. For example, if the memory content is code, a power-fail safe code recovery update process may be used to correct the code to apply the verified proposed correction to the code which, e.g. by having failed authentication, was found to be erroneous.
(107) Variations may be designed, depending on performance-area-runtime-reliability tradeoffs, such as but not limited to:
(108) A. Larger ‘on-the-fly code word’ yields: Smaller flash area & fetch throughput overhead (for a given ‘redundancy’ width) Larger bit correction time (to scan all bits) Larger fetch latency (if waiting for check before execute, the method of US20140082721 may be used; this co-pending patent document (https://patents.google.com/patent/US20140082721A1/en?oq=13%2f965%2c256) whose disclosure is hereby incorporated by reference describes a computing device, comprising: a. an input bridge, coupled to receive a sequence of data items for use by the device in execution of a program; and an output bridge; b. a processing core, coupled to receive the data items from the input bridge and execute the program so as to cause the output bridge to output a signal in response to a given data item in the sequence; and c. authentication logic, coupled to receive and authenticate the data items while the processing core executes the program, and to inhibit output of the signal by the output bridge until the given data item has been authenticated.
(109) B. Larger ‘on-the-fly redundancy word’ yields the following, relative to a smaller choice: More secured, more reliable, faster correction Larger flash area & fetch throughput overhead
(110) C. Larger ‘strong auth’ size (in bits) yields the following, relative to a smaller choice: More secured i.e. greater confidence that the authenticated original or corrected content of the memory is correct. Larger flash area overhead (typically negligible) SHA256-512 HMAC seems like a good choice
(111) D. Smaller code segmentation (when dividing code into segments with ‘strong auth’ for each) yields the following, relative to a larger choice: Larger area overhead Faster correction time Boot/cycle runtime may be maintained if the HASH is accumulative, i.e., use one HASH for the whole code while keeping intermediate results to speed up the correction process.
(112) One recommendation is dynamically determining tradeoff parameter/s e.g. choosing different (larger or smaller) ‘on-the-fly redundancy words’ and/or different (larger or smaller) ‘strong auth’ size and/or different (larger or smaller) segmentation (when dividing code into segments with ‘strong auth’ for each), per flash statistics and/or per wear level. e.g. as the target memory gets old, change the aforementioned tradeoff parameters towards faster and more robust correction than the speed and/or robustness of error correction used when the target memory was younger (e.g. due to slower operation of an older and/or more worn flash, relative to a younger and/or less worn flash).
(113) According to some embodiments, on-the-fly ‘word auth’ with statistic correction is provided. Rather than performing brute-force aka dumb scanning of all single bit flip options (possible corrections) throughout whole target memory, instead, if error is detected in a given word, take a “short cut” (vs. the dumb embodiment) by:
(114) trying to rectify just the given word, again by scanning or searching all one-bit flips of just that word, and
(115) if/when the payload word can be corrected to be consistent with the auth word, invoke the strong auth as the supreme verification of memory contents integrity.
(116) Thus, embodiments of this invention include inter alia:
(117) A. a method for combined authentication/error correction, including:
(118) invoking strong auth as verification of integrity of at least a portion of target memory contents, including scanning of at least some single bit flip options throughout at least some of target memory. b. (“dumb” embodiment:) a method according to embodiment a wherein the scanning is performed for the entire target memory c. (on-the-fly ‘word auth’ with statistical correction embodiment:) a method according to embodiment a wherein word auth is employed and wherein, if auth error is detected in a given word, the scanning is performed for just that given word rather than for the entire target memory, thereby to try to rectify just the given word, and
(119) if/when the payload word is brought to consistency with the auth word, invoke the strong auth as the supreme verification of memory contents integrity.
(120) It is appreciated that in statistical correction, there is no guarantee of success in correcting the memory contents.
(121) In
(122) Re scanning (“Flip one bit”) in
(123) Re “compute auth” in
(124) Firmware, if used to implement certain embodiments herein, may be held in non-volatile memory, e.g. Flash or ROM.
(125) Alternatively, certain embodiments described herein may be implemented partly or exclusively (i.e. without firmware) in hardware in which case some or all of the variables, parameters, sequential operations and computations described herein may be in hardware.
(126) It is appreciated that terminology such as “mandatory”, “required”, “need” and “must” refer to implementation choices made within the context of a particular implementation or application described herewithin for clarity and are not intended to be limiting, since, in an alternative implementation, the same elements might be defined as not mandatory and not required, or might even be eliminated altogether.
(127) Features of the present invention, including operations, which are described in the context of separate embodiments, may also be provided in combination in a single embodiment. For example, a system embodiment is intended to include a corresponding process embodiment and vice versa. Features may also be combined with features known in the art and particularly, although not limited to those described in the Background section or in publications mentioned therein. Conversely, features of the invention, including operations, described for brevity in the context of a single embodiment or in a certain order may be provided separately or in any suitable sub-combination, including with features known in the art (particularly although not limited to those described in the Background section or in publications mentioned therein) or in a different order. “e.g.” is used to denote an example not intended to be limiting. Each method may comprise some or all of the operations illustrated or described, suitably ordered e.g. as illustrated or described herein.