Method of protecting computer program code
AssigneeMetaforic Limited
InventorsNeil William Stewart, Graeme Kerr Harkness, Douglas McPherson Little
Life of this patent
Estimating the term…
Abstract
Program code is modified to execute correctly only when code and data memory accesses/fetches are synchronised, i.e. data and code accesses/fetches are routed to identical physical addresses in computer memory. This indirectly defeats the MMU attack, in which code and data memory accesses/fetches to the same logical address are routed to different physical addresses. The program code is modified such that one or more sections of the code (“repair targets”) are deliberately broken so that the program code will not execute correctly, the repair targets being replaced at run time with correct code before the repair targets are executed.
Claims19
A computer implemented method of protecting a computer program executable on a computer comprising a memory management unit configured to route data and code accesses/fetches to a same logical address either to different or to identical physical addresses in computer memory when executing a program, the method comprising:
- modifying a repair target code section of program code stored in computer memory so the program code of the repair target code section will not execute correctly;
- and
- inserting, into the program code in the computer memory, a plurality of repair probe code sections,
- wherein each of the repair probe code sections is configured to, at runtime,
- replace the repair target code section with a respective distinct correct code portion, only when the memory management unit routes the data and code accesses/fetches to the same logical address to identical physical addresses in computer memory, and
- call the respective distinct correct code portion at the repair target code section, each of the respective distinct correct code portions performing, at runtime, a respective distinct action, and a return to continue program execution at the repair probe code section calling the respective distinct correct code portion.
A computer implemented system for protecting computer program code, the computer implemented system comprising a computer configured to:
- modify a repair target code section of a program code stored in computer memory so that program code stored in the repair target code section will not execute correctly;
- and
- insert, into the program code, in the computer memory a plurality of repair probe code sections, each of the repair probe code sections configured to
- replace program code in the repair targets code section, at runtime, with a respective distinct correct code portion, before the repair target code section is executed, only if data and code accesses/fetches to the same logical address are routed to identical physical addresses in computer memory, and
- call the respective correct code portion at the repair target code section, each of the respective correct code portions performing, at runtime, a respective distinct action and returning to continue program execution at the repair probe code section that replaced program code in the repair target code section, wherein the computer stores the modified computer code on a non-transitory storage medium.
A non-transitory computer readable medium storing program code that, when executed, causes a machine to at least create:
- a repair target section comprising program code that will not execute correctly;
- and
- a plurality of repair probe sections each replacing the repair target section, at runtime, with a respective correct code portion, before the repair target section is executed, only when code and data memory accesses/fetches are synchronized, such that data and code accesses/fetches to a same logical address are routed to identical physical addresses in computer memory,
- wherein each repair probe section is configured to, at runtime, replace the repair target section with its respective correct code portion and call the respective correct code portion at the repair target section, each of the respective correct code portions performing, at runtime, a respective distinct action and returning to continue program execution at the calling repair probe section.
A non-transitory computer readable medium storing a computer program that comprises:
- a repair target code section that will not execute correctly;
- and
- a plurality of repair probe code sections that, when executed, at runtime, of the computer program, cause a processor to, when data and code accesses/fetches to a same logical address are routed to identical physical addresses in computer memory,
- replace code stored in the repair target code section with a respective correct code portion before the repair target code section is executed, and
- call the respective correct code portion at the repair target code section, each of the correct code portions performing, at runtime, a respective distinct action and returning to continue program execution at the repair probe section that called the repair target code section.
A computer comprising
- a processor;
- and
- a non-transitory computer readable medium storing a computer program having:
- a repair target code section that will not execute correctly, and
- a plurality of repair probe code sections each associated with a respective correct code portion for performing, at runtime, a respective distinct action,
- wherein data and code accesses/fetches to a same logical address may be routed to different physical addresses in computer memory when executing the computer program, and
- wherein each of the plurality of repair probe code sections is configured to, when executed and when data and code accesses/fetches to a same logical address are routed to identical physical addresses in computer memory, cause the processor to at least:
- replace code in the repair target code section with its respective correct code portion before the repair target section is executed,
- call the respective correct code portion at the repair target section, and
- return to continue program execution at the calling repair probe section.
Dependencies are inferred from the claim text.