METHOD OF SECURE MEMORY ADDRESSING
20190065407 ยท 2019-02-28
Inventors
Cpc classification
G06F12/145
PHYSICS
G06F9/3013
PHYSICS
G06F12/1491
PHYSICS
G06F9/468
PHYSICS
G06F12/14
PHYSICS
G06F9/30145
PHYSICS
Y02D10/00
GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
International classification
G06F12/14
PHYSICS
G06F9/30
PHYSICS
Abstract
Problem
The problem to be solved is to seek an alternative to known addressing methods which provides the same or similar effects or is more secure.
Solution
The problem is solved by a method (40) of addressing memory in a data-processing apparatus (10) comprising, when a central processing unit (11), while performing a task (31, 32, 33, 34) of the apparatus (10), executes an instruction involving a pointer (57) into a segment (r, d, h, f, o, i, c) of the memory: decoding the instruction by means of an instruction decoder (12), generating an address (45) within the memory by means of a safe pointer operator (41) operating on the pointer (57), augmenting the address (45) by an identifier (43) of the task (31, 32, 33, 34) and an identifier (44) of the segment (r, d, h, f, o, i, c), said identifiers (43, 44) being hardware-controlled (42), and, based on the augmented address (45), dereferencing the pointer (57) via a memory management unit (13).
Claims
1. A method (40) of addressing memory in a data-processing apparatus (10) comprising: when a central processing unit (11), while performing a task (31, 32, 33, 34) of the apparatus (10), executes an instruction involving a pointer (57) to or a direct memory address located in a segment (r, d, h, f, o, i, c) of the memory or in unsegmented memory: decoding the instruction by means of an instruction decoder (12), generating an address (45) within the memory of said task by means of a safe pointer operator (41) operating on the pointer (57) or using a direct memory address (45), augmenting the address (45) by an identifier (43) of the task (31, 32, 33, 34) or an identifier (44) of the segment (r, d, h, f, o, i, c), or both identifiers (43, 44), said identifier or identifiers being hardware-controlled (42); and translating the augmented address (46) by a memory management unit (MMU) to a corresponding physical address.
2. The method (40) of claim 1 wherein the apparatus (10) maintains a working stack (r), and the central processing unit (11), when executing the instruction involving a pointer, extracts the pointer (57) from a pointer word (50) on said working stack (r), the pointer word (50) further comprising type information (56) to be processed by the hardware and/or an operating system (11, 12, 13) of the apparatus (10).
3. The method (40) of claim 2 comprising: upon dereferencing the pointer (57) for data load to the stack, loading onto the stack a binary data word (61) referenced by the pointer (57); and complementing the data word (61) with a type word (52), the type word (52) being copied from the pointer (57) and henceforth indicating to the hardware and/or operating system (11, 12, 13) the type of the data word (61).
4. The method (40) of claim 3 wherein the data word (61) is referenced by means of a handle (53) referring to a page within one of the segments (r, d, h, f, o, i, c) or within unsegmented memory and an index (54) referring, within the page, to a data record holding the data word (61).
5. The method (40) of claim 2 wherein a type word (52) comprising the tvyc information (56) indicates whether the data word (61) contains data by value or contains a pointer (57) referencing either data by value or a further pointer or contains a descriptor belonging to a pointer and whether that either contained or referencing data is of an elementary or composite type.
6. The method (40) of claim 5 wherein, if the type word (52) indicates that the type is an elementary data word, the type word (52) also indicates any or all of the following: a width of the data expressed in a unit of information such as bits, whether the data constitutes a vector of multiple data points preferably to be processed with a single instruction of the central processing unit (11), whether the data is of a standard ornullableinterval type, whether the data is of a numeric type, such as a floating-point or either unsigned or signed integer number, or is user-defined or otherwise special, such as a character, index of a pointer, function pointer, semaphore or inter-task communication channel, whether the data has been loaded into the stack from a buffer or cache memory or such a load is pending, whether the data has been added to or changed on the stack since last its last load from buffer or cache memory.
7. The method (40) of claim 5 wherein, if the type word (52) indicates that the data word (61) contains the further pointer (57), the pointer word (50) further comprises information for safeguarding memory accesses from hazards such as dangling pointers or for organizing inter-task channel communications.
8. The method (40) of claim 5 wherein, if the type word (52) further indicates that the type is a descriptor belonging to a pointer, the data word (61) contains a descriptor (55) which describes any or all of the following: the pointer arithmetic in terms of being either linear (array pointer) or cyclic (ring buffer pointer), a stride, preferably expressed as a multiple of the increment, a base address and a size of the range allowed for access by the pointer (57).
9. A data-processing apparatus (10) having: memory, a central processing unit (11), an instruction decoder (12), a low-level operating system (LLOS) layer comprising at least task, process, and memory management facilities and implemented in software, in hardware, or in a mixture of both (13), and means adapted to execute the steps of the method (40) of claim 1.
10. The data-processing apparatus (10) of claim 9 wherein the instruction decoder (12) and the LLOS layer (13) are arranged such that the instruction decoder (12) entirely isolates the LLOS layer (13) from any direct software access.
11. The data-processing apparatus (10) of claim 10 wherein the software comprises: multiple layers (14); and an application (15) based upon the layers (14).
12. A computer readable medium having instructions stored thereon, wherein when executed by a processor, the instructions execute the steps of the method (40) of claim 1.
13. (canceled)
14. A computer-implemented data structure (30) for use in the method (40) of claim 1, the structure (30) having a virtually at least two-dimensional grid layout of columns and rows of memory pages, the grid being arranged such that the memory pages are manageable, particularly isolable, by the memory management unit (13), each among the columns being uniquely associated with one among several tasks (31, 32, 33, 34) of the apparatus (10) and each among the rows being uniquely associated with one among several segments (r, d, h, f, o, I, c) of the memory such as a preferably hardware-controlled return stack (s), working stack (r), data stack (d), heap (h), file (f), channel output (o), channel input (i), or code (c) segment.
15. The data structure (30) of claim 14 wherein, for each task (31, 32, 33, 34) among the tasks (31, 32, 33, 34), the column associated with that task (31, 32, 33, 34) comprises multiple levels, each being associated with an execution thread of the respective task (31, 32, 33, 34).
Description
BRIEF DESCRIPTION OF DRAWINGS
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
DESCRIPTION OF EMBODIMENTS
[0018] Referring to
[0019] Where the data-processing apparatus (10) takes the form of a concurrent system, this approach allows for a virtual memory layout (30) as exemplified in
[0020] Vertically, the grid of the present example comprises eight rows, each row being uniquely associated with a memory segment. For any among the tasks (31, 32, 33, 34), one such segment remains hidden to and inaccessible for the software itself, and contains a stack (s) exclusively dedicated to subroutine return addresses and controlled by hardware. Especially in a stack machine, that task (31, 32, 33, 34) may also entail a working stack (r) that stores subroutine contexts, call, return, and local variables, and intermediate computational results. An ancillary data stack (d) is optional. Finally, the task (31, 32, 33, 34) could possess any number of heap (h), file (f), write-only channel output (o), or read-only channel input (i) segments as needed.
[0021] A mandatory code (c) segment, hidden to and inaccessible for the software itself, serves as read-only input to the instruction decoder (12), otherwise being protected from reading and writing. This feature may be considered an implementation of the Harvard computer architecture as it imposes distinct code and data address spaces, rendering the memory layout (30) invulnerable to code injection.
[0022] Attention is now directed to
[0023] Once generated, the virtual address (45) is augmented, such as through concatenation, by an identifier (43) of the task (31, 32, 33, 34) and an identifier (44) of the memory segment (r, d, h, f, o, i, c), both identifiers being essentially hardware-controlled (42), identifier (43) by the scheduler, and identifier (44) by the safe pointer operator (41). Based on this augmented virtual address (46), the pointer may finally be dereferenced via the memory management unit (MMU) and its data accessed safely and securely. By design, each task (31, 32, 33, 34) thus benefits from its own data privacy sphere as well as full memory access integrity and control flow integrity and hence resides in what in the art is known as a trust zone that is maintained by a per-task virtual processing scheme (as opposed to known coarserand more vulnerabletwo-virtual-processor schemes).
[0024] In a preferred embodiment explained regarding
[0025] The eminent benefit of the type word (52) is best gathered from
[0026] Since type information is henceforth contained in data space (r) as opposed to code space (c), CPU execution may be guided by type, reducing the required instruction set to a minimum. The resulting ability to use universal standard code for alleven vector or otherwise specialdata types confers extreme flexibility to the data processing apparatus (10). In programming languages and type theory, such provision of a single interface to entities of different types is known as polymorphism.
[0027]
[0028] In the draft at hand, bit 9 of the type word (52) marks thecontained or referencingdata as being either of an elementary or composite, further structured type. In the former case, the type word (52) may also provide guidance on aspects like the following: [0029] the width of the data expressed in a unit of raw information such as bits (bits 6, 7, 8), [0030] whether the data constitutes a vector unit or sub-unit of multiple data points (bit 5) preferably to be processed with a parallel single SIMD instruction of the central processing unit (11), [0031] whether the data type is standard or apreferably nullableinterval type (bit 4), [0032] whether the data is a floating-point or an unsigned or signed integer number or otherwise specialsuch as a character, index of a pointer, function pointer, semaphore or inter-task communication channel(bits 2, 3), [0033] whether the data has been loaded from a buffer or cache memory into the stackand hence is validor such load is pending (lazy loading bit 1), and [0034] whether the data has been newly added to or changed on the stack since last loaded from buffer or cache memoryand hence is out-of-sync with said buffer or cache memory (dirty bit 0).
INDUSTRIAL APPLICABILITY
[0035] The invention may be applied, inter alia, throughout the semiconductor industry.