Apparatus and method for controlling the use of bounded pointers

By introducing revocable bounded pointers and authentication checking mechanisms into the memory allocation circuit, the problem that bounded pointers can still be used after the memory area is deallocated is solved, significantly reducing the risk of use after release and improving system security.

CN112334884BActive Publication Date: 2024-10-22ARM LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980042614.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-08-20
Filing Date
2019-07-05
Publication Date
2024-10-22
Estimated Expiration
2039-07-05

AI Technical Summary

Technical Problem

In the existing technology, after the memory area is deallocated, the bounded pointer can still be used in the processing circuit, causing a 'use after free' problem, which may lead to undefined software behavior, information leakage, or remote code execution.

Method used

Introduce revocable bounded pointers in the memory allocation circuit, use authentication checks to prevent the use of changed tokens when memory addresses are generated, by setting the first token field at the head position of the memory region and modifying its value when deallocating Card value, ensuring bounded pointers are invalid.

Benefits of technology

Significantly reduces the possibility of use-after-free situations, preventing bounded pointers from being used after a memory area has been deallocated, improving system security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112334884B_ABST
    Figure CN112334884B_ABST
Patent Text Reader

Abstract

An apparatus and method for controlling the use of bounded pointers are provided. The apparatus has: a memory allocation circuit for allocating a memory region in a memory; and a bounded pointer generation circuit for generating bounded pointers, the bounded pointers including at least a revocable bounded pointer for accessing the memory region. The revocable bounded pointer provides a pointer value and range information identifying an address range of the memory region. The memory allocation circuit is arranged to provide a header of the memory region at a header position in the memory, the header having a first token field that is initialized to a first token value associated with the memory region. The header position is derived from the range information provided by the revocable bounded pointer. The memory allocation circuit modifies a stored value in the first token field of the header in response to deallocation of the memory region.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present technology relates to the field of data processing. Background Art

[0002] Some data processing devices may support bounded pointers, in which a pointer indicating a specific address is associated with range information indicating the allowed address range of the pointer. For example, such a pointer may be referred to as a "fat pointer".

[0003] In addition to the range information, such a bounded pointer may also have other associated attributes that define one or more restrictions / permissions on the use of the pointer. Thus, using such a bounded pointer may provide strong security by imposing constraints on how the pointer value specified by the bounded pointer may be used.

[0004] When allocating a memory area in a memory, for example, to enable the memory area to be used by a particular process, one or more bounded pointers may be established for use in association with the allocated memory area. Such bounded pointers may include range information that identifies the address range of the allocated memory area. When a process attempts to generate a memory storage address using a bounded pointer, it will be limited to only generating memory addresses that fall within the address range of the allocated memory area.

[0005] A problem that may arise is that when the memory area is later deallocated, the memory space is freed for reallocation, and the bounded pointer may still be available for processing circuitry. The potential use of such a bounded pointer after the associated memory area has been deallocated is known as the "use-after-free" problem. Specifically, if the bounded pointer is used after the associated memory area is deallocated due to a programming error, undefined behavior of the software may result. In addition, when such use of a bounded pointer occurs as an action intentionally caused by a security attacker, this may potentially lead to security leaks of information, and / or remote code execution.

[0006] It would therefore be desirable to provide a technique that alleviates the post-release use problem. Summary of the invention

[0007] In one example configuration, an apparatus is provided, comprising: a memory allocation circuit for allocating a memory region in a memory; and a bounded pointer generation circuit for generating a bounded pointer, the bounded pointer comprising at least a revocable bounded pointer for accessing the memory region, the revocable bounded pointer providing a pointer value and range information identifying an address range of the memory region; wherein the memory allocation circuit is arranged to provide a header for the memory region at a header position in the memory, the header having a first token field, a stored value of the first token field being initialized to a first token value associated with the memory region, the header position being derived from the range information provided by the revocable bounded pointer, and wherein the memory allocation circuit modifies the stored value in the first token field of the header in response to a subsequent deallocation of the memory region; and in response to a request to generate a memory address using the revocable bounded pointer, the use of an authentication check is arranged to prevent the generation of the memory address when it is determined that the stored value in the first token field has been changed.

[0008] In another example configuration, a method of controlling the use of bounded pointers in a device is provided, the device having a memory allocation circuit for allocating a memory region in a memory, and a bounded pointer generation circuit for generating a bounded pointer, the method comprising: arranging the bounded pointer generation circuit to generate at least a revocable bounded pointer for accessing the memory region, the revocable bounded pointer providing a pointer value and range information identifying an address range of the memory region; providing a header for the memory region at a header location in the memory, the header having a first token field, a stored value of the first token field being initialized to a first token value associated with the memory region, the header location being derived from the range information provided by the revocable bounded pointer; causing the memory allocation circuit to modify the stored value in the first token field of the header in response to a subsequent deallocation of the memory region; and in response to a request to generate a memory address using the revocable bounded pointer, causing an authentication check to prevent the generation of the memory address when it is determined that the stored value in the first token field has been changed.

[0009] In yet another example configuration, a device is provided, comprising: a memory allocation device for allocating a memory region in a memory; and a bounded pointer generation device for generating a bounded pointer, the bounded pointer comprising at least a revocable bounded pointer for accessing the memory region, the revocable bounded pointer providing a pointer value and range information identifying an address range of the memory region; wherein the memory allocation device is arranged to provide a header of the memory region at a header position in the memory, the header having a first token field, a storage value of the first token field being initialized to a first token value associated with the memory region, the header position being derived from the range information provided by the revocable bounded pointer, and wherein the memory allocation device modifies the storage value in the first token field of the header in response to a subsequent deallocation of the memory region; and in response to a request to generate a memory address using the revocable bounded pointer, the use of an authentication check is arranged to prevent the generation of a memory address when it is determined that the storage value in the first token field has been changed. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The present technology will be further described by way of illustration only with reference to the examples as shown in the accompanying drawings, in which:

[0011] Figure 1 is a block diagram of an apparatus according to an example;

[0012] Figure 2 An example of an instruction type for which an error may be triggered if an attempt is made to set or access a pointer value within a set of bounded pointer storage elements, where the pointer value is used to specify an address outside of a range indicated by associated range information;

[0013] Figure 3 shows the use of tag bits associated with a bounded pointer according to one example;

[0014] Figure 4 is a flowchart illustrating a memory allocation process according to one example;

[0015] Figure 5 is a flow chart illustrating a bounded pointer creation operation according to one example;

[0016] Figure 6 is a flowchart illustrating a memory deallocation process according to one example;

[0017] 7A to 7C schematically illustrates an allocated memory region, an example header format for the memory region, and a generated bounded pointer according to an example arrangement;

[0018] Figure 8is a flow chart illustrating a usage authentication check operation performed in one example;

[0019] Fig. 9 is a flow chart illustrating encoding operations that may be performed according to one example arrangement;

[0020] Fig.10 is a flow chart illustrating decoding operations that may be performed according to one example arrangement;

[0021] Fig.11 schematically illustrates encoding and decoding of bounded pointers according to an example arrangement;

[0022] Fig. 12A and Fig. 12B schematically illustrates example encoding operations that may be performed; and

[0023] Fig.13 An example use case is shown according to an example arrangement in which a revocable bounded pointer generated by a first device is passed to a second device for use by the second device until an associated memory region is deallocated. DETAILED DESCRIPTION

[0024] Some processing devices may support the use of bounded pointers. For example, a pointer itself may point to or be used to determine the address of a data value to be accessed or an instruction to be executed. However, a pointer may also have associated range information that indicates the allowed address range when using the pointer. For example, this can be used to ensure that addresses determined from a pointer remain within certain boundaries to maintain the safety or functional correctness of behavior. For example, there is increasing interest in capability-based architectures, in which certain capabilities are defined for a given process, and an error is triggered if an attempt is made to perform an operation outside of the defined capabilities. The range information of a bounded pointer may be part of the capability information defined for such an architecture, and in a capability-based architecture, such a bounded pointer (including its associated capability information) may be referred to as a capability.

[0025] Thus, an apparatus may have bounded pointer storage elements for storing pointers with associated range information indicating an allowed address range when using the pointer. Each bounded pointer storage element may be a register, or a memory location in a general purpose memory, such as a location on a stack memory.

[0026] Certain instructions may be used to reference such a bounded pointer storage element to obtain a pointer, which is then used to derive a memory address required during operation of the instruction. The pointer may be used directly to identify a memory address, or may be used to derive a memory address, for example, by adding an offset to the pointer value.

[0027] In one example implementation, such a bounded pointer is associated with a specifically allocated memory region. Thus, once a memory region is allocated, for example, for use with a particular process, one or more bounded pointers may be created for use when accessing the memory region, and the range information associated with the bounded pointers will identify the range of memory addresses that form the memory region. Whenever an address within a memory region needs to be accessed, such a bounded pointer may be referenced to generate the memory address, and the use of bounded pointers will ensure that any generated memory address is restricted to the allowed memory address range that forms the memory region. Specifically, if a bounded pointer is used to generate a memory address outside the allocated memory region, a fault will be detected and the access will be prevented from continuing.

[0028] Although this is very useful for improving security, as previously mentioned, a "use after free" problem may occur, in which a bounded pointer remains accessible after the associated memory area is subsequently deallocated. If such a bounded pointer is used due to a programming error, undefined behavior of the software may result. As another example, if the use occurs as an action intentionally caused by a security attacker, this may potentially lead to security leakage of information, and / or remote code execution. Therefore, it is desirable to prevent the use of bounded pointers after the associated memory area has been deallocated. The technology described herein is intended to provide a mechanism for significantly reducing the likelihood of use after free situations occurring.

[0029] In one example arrangement, an apparatus is provided, comprising: a memory allocation circuit for allocating a memory region in a memory; and a bounded pointer generation circuit for generating a bounded pointer. Specifically, the bounded pointer generation circuit is arranged to at least generate a revocable bounded pointer for accessing the memory region, the revocable bounded pointer providing a pointer value and range information identifying an address range of the memory region.

[0030] Furthermore, the memory allocation circuit (which may be formed by dedicated hardware, or by software running on a general purpose processor) is arranged to provide a header for the memory region at a header position in the memory, wherein the header has a first token field, the stored value of the first token field being initialized to a first token value associated with the memory region. The header position is derived from the range information provided by the revocable bounded pointer, thereby enabling the header to be located when the bounded pointer is used, thereby allowing the header to be referenced for hardware checking before allowing the use of the revocable bounded pointer.

[0031] The memory allocation circuitry, in response to a subsequent deallocation of the memory region, modifies the stored value in the first token field of the header with the result that the first token value will no longer be stored.

[0032] In response to a request to generate a memory address using a revocable bounded pointer, the usage authentication check is arranged to prevent generation of the memory address if it is determined that a stored value in the first token field has been altered.

[0033] In this way, when a revocable bounded pointer is used to generate a memory address, an authentication check will prevent access if the stored value in the first token field of the header has been modified. It has been found that this can provide a simple and effective mechanism for significantly suppressing the possibility of use-after-free situations.

[0034] The usage authentication check may prevent the generation of the memory address in a number of ways. In one example implementation, the usage authentication check is arranged to invalidate the revocable bounded pointer upon determining that the stored value in the first token field has been changed, thereby preventing the generation of the memory address.

[0035] The manner in which the use authentication check may determine whether the stored value in the first token field of the header has been modified may vary depending on the implementation. However, in one example, the revocable bounded pointer is arranged to store the first token value, and in response to a request to generate a memory address using the revocable bounded pointer, the use authentication check is arranged to employ the range information to determine the header location, and in the event of a mismatch between the first token value stored in the revocable bounded pointer and the stored value in the first token field of the header, invalidate the revocable bounded pointer.

[0036] By this approach, when a revocable bounded pointer is used to generate a memory address, a check can be performed in hardware to determine whether the first token value provided within the revocable bounded pointer still matches the contents of the first token field of the header. As is apparent from the above discussion, following deallocation of a memory region this will no longer be the case, and so a situation can be detected where an attempt is made to use a revocable bounded pointer after the associated memory region has been deallocated, at which point the revocable bounded pointer can be invalidated to prevent use of the revocable bounded pointer, thereby preventing the requested access from occurring.

[0037] In alternative embodiments, the first token value may not be regenerated within the revocable bounded pointer itself (e.g., because there is insufficient space within the revocable bounded pointer to accommodate the first token value), and other mechanisms may be used to detect when the stored value in the first token field of the header has been modified. In such embodiments, the first token value may take the form of a token value hereinafter referred to as the second token value, and detection of modification of the token value may be performed in the same manner as discussed in detail hereinafter with respect to the second token value.

[0038] The first token value may be generated in a variety of ways, but in one example embodiment, the apparatus further comprises a token generation circuit for generating the first token value. In one specific example, the token generation circuit is a pseudo-random number generator, and the first token value is then a pseudo-random number generated for use in association with the allocated memory region and the associated revocable bounded pointer(s).

[0039] In some embodiments, the bounded pointer generation circuit may be arranged to generate not only the above-mentioned revocable bounded pointers, but also other bounded pointers that do not utilize the first token value. In order to assist in distinguishing different types of bounded pointers, the bounded pointer generation circuit may be arranged to provide a revocable field in each generated bounded pointer, which is set when the generated bounded pointer is a revocable bounded pointer. When the revocable field is set and the bounded pointer is used to generate a memory address, the above-mentioned use authentication check may be performed in hardware before the revocable bounded pointer is allowed to be used, and if there is a mismatch between the first token value provided by the revocable bounded pointer and the stored value in the first token field of the header of the associated memory area, the revocable bounded pointer is invalidated.

[0040] Bounded pointers may be stored at a plurality of locations within the system. In one example arrangement, the apparatus comprises a set of bounded pointer registers, wherein each bounded pointer register is arranged to store a bounded pointer for generating a memory address. When the processing circuitry of the apparatus is executing instructions, and the execution of those instructions requires the use of bounded pointers to generate a memory address, the relevant bounded pointer may be accessed in a designated one of the bounded pointer registers. The bounded pointer register may be a dedicated register for storing bounded pointers, or a general register that may store various types of data, including bounded pointers.

[0041] In one example, bounded pointers may be moved between bounded pointer registers and memory, or indeed, may be copied from registers to memory and vice versa, such that not all bounded pointers will reside within one of the bounded pointer registers at any particular point in time.

[0042] In an embodiment in which the first token value is stored in a revocable bounded pointer, the size of the first token value is limited by the available space within the revocable bounded pointer that can be used to accommodate the first token value. Specifically, in one example arrangement, the first token value is located within a portion of the bounded pointer that is not otherwise used. In some embodiments, the size of the first token value that can be stored within the bounded pointer can provide a sufficient level of protection to prevent a "use after release" situation. However, the more bits allocated to the token value, the more robust the mechanism is against use after release scenarios. For example, when generating a random token value for use with a particular memory area, the larger the token value, the less likely it is that the same token value will also be generated for use with another previously allocated memory area (for which a bounded pointer may still be active), and therefore, the less likely it is that an existing bounded pointer can be used to access a later allocated memory area after the previously allocated memory area has been deallocated (which is actually another type of use after release access that is expected to be prevented).

[0043] In one example embodiment, if it is desired to increase the effective token size, a second token value may be used in conjunction with the first token value, wherein the header retains both the first token value and the second token value, but the second token value itself is not provided within the revocable bounded pointer due to lack of space to accommodate the second token value.

[0044] Specifically, in one example arrangement, the header also includes a second token field that is arranged to store a second token value associated with the memory region that is not in the revocable bounded pointer generated by the bounded pointer generation circuit, and the use authentication check is arranged to invalidate the revocable bounded pointer when it is determined that the second token value has been changed.

[0045] The use authentication check may determine in a number of ways when the second token value is changed. For example, in one embodiment, the device may include an additional storage device provided in association with the set of bounded pointer registers, wherein when a revocable bounded pointer is stored in a selected bounded pointer register, the additional storage device is arranged to identify the second token value as initialized in the second token field of the header in association with the selected bounded pointer register. Therefore, according to such an embodiment, the second token value is stored in the header area, and the additional storage device is provided in association with a set of bounded pointers, so that when the revocable bounded pointer is stored in one of the bounded pointer registers, the additional storage device can maintain the second token value in association therewith, thereby extending the use authentication check discussed above so that both the first token value and the second token value can be compared with corresponding values ​​maintained in the header, and if any of these token values ​​does not match the corresponding value in the header, the revocable bounded pointer can be invalidated.

[0046] Thus, in one such example arrangement, the use of the authentication check may further be responsive to a request to generate a memory address using the revocable bounded pointer as stored in the selected bounded pointer register to invalidate the revocable bounded pointer in the absence of a match between the second token value stored in the header and the second token value stored in the additional memory device associated with the selected bounded pointer register. Thus, as previously described, both the first token value and the second token value may be referenced in determining whether the revocable bounded pointer should continue to be used or should be revoked.

[0047] The additional storage device may be provided in a variety of ways. For example, if there is a mechanism to associate each second token value stored in the additional storage device with a specific one of the bounded pointer registers, the additional storage device may be physically separate from the storage device that provides the set of bounded pointer registers. Alternatively, the additional storage device may be provided by the same storage structure as that that provides the set of bounded pointer registers, and the additional storage device is considered to provide an extension to each bounded pointer register, so that not only a bounded pointer can be stored therein, but also the associated second token value is stored.

[0048] To improve security, and in particular to mitigate the potential risk of tampering with the second token value, the additional storage device may be arranged to be inaccessible to one or more types of software executed on the device (in one embodiment, this may be any software executed on the device). Thus, the additional storage device will be populated directly under hardware control and will be referenced by the hardware when performing usage authentication checks.

[0049] In alternative embodiments, additional storage may not be required. For example, the apparatus may further include a notification mechanism for identifying when a write operation has been performed on at least one of the first token field and the second token field of the header, thereby enabling the use of an authentication check to invalidate the revocable bounded pointer if the first token value or the second token value has been changed. The notification mechanism may take a variety of forms, but in one embodiment is based on a cache coherence protocol in which the header is cached in a cache of the apparatus.

[0050] In an embodiment employing both a first token and a second token, upon subsequent deallocation of the memory region, the memory allocation circuitry may be arranged to modify not only the value stored in the first token field of the header, but also the value stored in the second token field of the header, such that after the memory region has been deallocated, neither the first token value nor the second token value thereafter matches the information maintained in association with the revocable bounded pointer.

[0051] The second token value may be generated in various ways, but in one embodiment is generated using a token generation circuit that is also arranged to generate the first token value. Thus, in one example embodiment, the second token value is also a pseudo-random number that is generated for use in association with the memory region.

[0052] In an embodiment where a second token value is used in addition to a first token value, a problem arises in how to maintain information indicating the second token value if the revocable bounded pointer is stored back to the memory from the bounded pointer register. As previously mentioned, the second token value itself does not form part of the revocable bounded pointer, and therefore, when the revocable bounded pointer is stored to the memory, the second token value will not form part of the revocable bounded pointer stored in the memory. According to an example embodiment, this problem is solved by using an encoding operation.

[0053] Specifically, in one embodiment, the header is arranged to store a copy of a portion of a revocable bounded pointer, and the apparatus further comprises an encoding control circuit, which is arranged to perform an encoding operation when the revocable bounded pointer is stored to the memory from the selected bounded pointer register, to create an encoded revocable bounded pointer by encoding the portion of the revocable bounded pointer using the second token value in a manner that allows the portion of the revocable bounded pointer to be recreated using the second token value and the encoded revocable bounded pointer, after which the encoded revocable bounded pointer is stored to the memory. Thus, the revocable bounded pointer is stored in the memory in an encoded form. Thereafter, the encoded form can be retrieved from the memory and decoded before being stored in the bounded pointer register. Assuming the decoding operation is successful (which requires decoding the encoded portion of the revocable bounded pointer using the second token value in the header to produce a decoded portion that matches the partial copy of the revocable bounded pointer stored in the header), if an earlier use authentication check is passed, the decoded revocable bounded pointer can be used for subsequent memory access operations.

[0054] It will be appreciated that the copy of the portion of the revocable bounded pointer stored within the header may be stored in any suitable format. Thus, while it may be stored in the original format used within the revocable bounded pointer, it may alternatively be stored in another format if desired (e.g., it may be stored in the revocable bounded pointer as a bitwise inverted version of the corresponding bits).

[0055] The first token value may additionally be used if required during an encoding operation, and if so, referenced when performing a corresponding decoding operation.

[0056] The portion of the revocable bounded pointer that has a copy stored in the header can take a variety of forms, but in one example implementation, is a portion that is common to any bounded pointer generated for the current allocation instance of the memory region. There will be a number of fields in the revocable bounded pointer that are common to any bounded pointer generated for the current allocation instance of the memory region. For example, this will include range information that is used to identify the range of the memory region, but may also include certain permission bits. In one specific example, the portion of the revocable bounded pointer for which a copy is stored in the header includes at least the portion of the range information that is not required for identifying the head position. By not including the portion of the range information that is required to identify the head position, it is possible to identify the head position before performing the required decoding operations.

[0057] The range information can take a variety of forms, but in one embodiment includes a base address and a limit address of the memory region, the header position is determined using one of the base address and the limit address, and the portion of the revocable bounded pointer whose copy is stored in the header identifies the other of the base address and the limit address.

[0058] As previously mentioned, the portion of the revocable bounded pointer whose copy is stored in the header may also include other information, such as information indicating at least one or more permissions specified within the revocable bounded pointer. In fact, in a specific embodiment, for example, if only permission bits are encoded / decoded in an encoding / decoding operation, only the permission information has a copy stored in the header.

[0059] The encoding control circuitry may then be arranged to decode the revocable bounded pointer by performing a decoding operation to decode the encoded portion of the revocable bounded pointer using the value stored in the second token field of the header (and the value stored in the first token field if the first token value was also used in the encoding operation) to generate a recreated portion of the revocable bounded pointer, and then performing a checking operation to determine whether the recreated portion of the revocable bounded pointer matches the copy of the portion of the revocable bounded pointer stored in the header. Specifically, the portion of the range information that has not yet been encoded may be used to identify the header location, thereby enabling the contents of the header to be retrieved, after which the value stored in the second token field (and optionally the first token field) may be used to decode the encoded portion of the revocable bounded pointer. If the value stored in the second token field is still the second token value (and if the first token was also used in the encoding / decoding process, the value stored in the first token field is still the first token value), then the recreated portion should still match the copied portion of the revocable bounded pointer stored in the header. However, if the header has been altered (e.g. because the associated memory area has been deallocated), then the decoding operation will not generate a recreated portion of the revocable bounded pointer that matches the copied portion of the revocable bounded pointer stored in the header. If this occurs, the encoding control circuitry may be arranged to invalidate the revocable bounded pointer. Furthermore, in one embodiment, once the revocable bounded pointer has been decoded, a check is also performed to ensure that the first token value in the revocable bounded pointer matches the stored value in the first token field of the header, and if this is not the case, the revocable bounded pointer is also invalidated.

[0060] The decoding operation may be triggered for a variety of reasons. In one example embodiment, the encoding control circuit is arranged to perform the decoding operation whenever an encoded revocable bounded pointer is loaded from memory into one of the bounded pointer registers. Thus, in such an embodiment, the revocable bounded pointer is always encoded when stored in memory and is always decoded when retrieved from memory into the bounded pointer register.

[0061] However, in an alternative embodiment, the encoded revocable bounded pointer may be retrieved into a bounded pointer register without decoding it. This would allow, for example, bounded pointers to be copied between storage locations without having to perform a decoding step and a corresponding encoding step. However, in such an embodiment, it is necessary to ensure that the encoded bounded pointer cannot be used to perform memory access operations. Therefore, in one such embodiment, each bounded pointer includes an encoding field that is set to indicate when the revocable bounded pointer has been encoded. This therefore enables the processing hardware to distinguish between a revocable bounded pointer that is still in encoded form and is stored in a bounded pointer register (and therefore cannot be used for memory access) and a revocable bounded pointer that is in decoded form (and therefore may be used for memory access if a usage authentication check is passed).

[0062] In such an embodiment, the encoded revocable bounded pointer needs to be decoded by the encoding control circuit before it is used to generate a memory address.

[0063] If the head position can be identified from the range information of the memory region, the physical position of the head relative to the associated memory region can take a variety of forms. In an example embodiment, the head position is arranged relative to the memory region as one of the following: a sequence of memory addresses immediately before the allocated memory region or at a fixed offset before the allocated memory region; a sequence of memory addresses immediately after the allocated memory region or at a fixed offset after the allocated memory region; a sequence of memory addresses at a position determined by performing a calculation based on the address of the memory region.

[0064] Although in one embodiment, the sequence of memory addresses used to hold the header may be software addressable, in alternative embodiments, the header location may be within a portion of the memory that is not addressable by at least some types of software executing on the device. For example, the header may be formed from non-software addressable storage bits (e.g., similar to the manner in which ECC bits are stored in association with data values). If desired, the header location may be accessible to certain privileged software (e.g., the kernel and possibly one or more other software components with an appropriate privilege level), but inaccessible to less privileged software (e.g., user space software).

[0065] As another example, the head location may be represented in an address space separate from the address space containing the allocated memory region. In such an arrangement, the separate address space may still be addressed by software, but in a manner different from that in which the conventional address space is addressed (e.g., addressing the separate address space may require the use of special CPU instructions). In such an arrangement, the head location in the separate address space may still be arranged so that it can be located using the range information of the allocated memory region.

[0066] If the header is within a portion of memory that is not addressable by certain types of software executing on the device, security may be further improved by avoiding any potential risk of that software modifying the header information.

[0067] In one embodiment, the portion of the revocable bounded pointer for which a copy is stored in the header may be predetermined. However, alternatively, a control field may be provided within the header to identify which bits of the revocable bounded pointer have been used to form the copied portion of the revocable bounded pointer stored in the header. This may provide a level of configurability regarding the selection of bits of the revocable bounded pointer maintained within the header for use in the encoding and decoding operations previously described. In a particular embodiment, the control field may be provided at least in part by portions of the first and / or second token fields, such that, for example, a first portion of the first / second token value is used as an "encryption key" when performing encoding / decoding, and another portion (possibly intersecting with the first portion) is used as a control field value to determine which bits of the revocable bounded pointer are to be encoded / decoded.

[0068] It should be noted that when performing a usage authentication check, it is not necessarily necessary to access the memory to obtain the header information. For example, the device may further include a cache structure arranged to maintain a copy of the stored value in the first token field of the header (and optionally, in an embodiment using a second token, the value stored in the second token field), wherein the usage authentication check is arranged to reference the copy maintained in the cache structure when determining whether the stored value in the first token field has changed. In modern data processing systems, cache consistency schemes are used to ensure that the contents maintained by various caches within the system represent the latest version of the data cached therein, so if the contents of the header have been cached and the contents of these caches are still valid when performing the usage authentication check, the contents of these caches can be used to determine whether the stored value in the first token field has changed. Therefore, this can significantly reduce the time spent performing the usage authentication check.

[0069] In fact, in some systems, the core using bounded pointers (which core is referred to as the current core below) can avoid performing a usage authentication check altogether until a cache consistency scheme suggests an update to the cached version of the header, or the current core updates the header. For example, once a bounded pointer is loaded into a bounded pointer register and the corresponding header is stored in the cache, the cache consistency scheme is able to track writes to the header associated with the bounded pointer. Thus, for example, if another core writes to a location containing a header, this will cause a consistency invalidation request to be sent to the current core, so that through this mechanism the current core receives a message indicating a possible change to the header. As a result, this can avoid performing an authentication check until such a consistency invalidation request is received due to an update by another core, or until it is written to the header itself, because it is known that the header has not changed before that time. Once a change is made to the header, the usage authentication check can be arranged to determine that the revocable bounded pointer will be invalidated.

[0070] There are many example use cases where providing a revocable bounded pointer using the above mechanism may be very useful. In one example use case, the device is arranged to provide a revocable bounded pointer to another device to control the other device's access to a memory region, and the other device is arranged to perform a use authentication check, whereby after the device deallocates the memory region, the other device will be prevented from further using the revocable bounded pointer to generate memory addresses. Thus, in this way, a device can create a bounded pointer that can be passed to another device, and the above mechanism ensures that once the device decides to deallocate the associated memory region, the other device will no longer be able to use the provided bounded pointer, and specifically, the bounded pointer will be cancelled when any attempt to use the bounded pointer after the associated memory region has been deallocated.

[0071] Specific examples will now be described with reference to the accompanying drawings.

[0072] Figure 1 An example of a data processing apparatus 2 is schematically shown, including a processing pipeline 4 for processing instructions. In this example, the processing pipeline 4 includes a plurality of pipeline stages, including a fetch stage 6, a decode stage 8, an issue stage 10, an execute stage 12, and a write-back stage 14, but it will be appreciated that other types of stages or combinations of stages may be provided. For example, in some embodiments, a renaming stage for performing register renaming may be included. Instructions to be processed are moved from one stage to another, and while one instruction is pending at one stage, another instruction may be pending at a different stage of the pipeline 4.

[0073] The fetch stage 6 fetches instructions from a level 1 (L1) instruction cache 20. The fetch stage 6 may typically fetch instructions sequentially from consecutive instruction addresses. However, the fetch stage may also have a branch predictor 22 for predicting the outcome of a branch instruction, and if the predicted branch is taken, the fetch stage 6 may fetch instructions from a (non-sequential) branch target address, or if the predicted branch is not taken, from the next sequential address. The branch predictor 22 may include one or more branch history tables for storing information for predicting whether certain branches are likely to be taken. For example, the branch history table may include a counter for tracking the actual outcome of previously executed branches, or for indicating the confidence of a prediction made for a branch. The branch predictor 22 may also include a branch target address cache (BTAC) 24 for caching previous target addresses of branch instructions so that the same branch instruction may be predicted when it is subsequently encountered.

[0074] The fetched instructions are passed to a decode stage 8, which decodes the instructions to generate decoded instructions. The decoded instructions may include control information for controlling the execution stage 12 to perform the appropriate processing operations. For some more complex instructions fetched from the cache 20, the decode stage 8 may map those instructions to multiple decoded instructions, which may be referred to as micro-operations (μops or uops). Therefore, there may not be a one-to-one relationship between the instructions fetched from the L1 instruction cache 20 and the instructions seen by the later stages of the pipeline. Generally, references to "instructions" in this application should be interpreted as including micro-operations.

[0075] The decoded instructions are passed to the issue stage 10, which determines whether the operands required to execute the instructions are available and issues the instructions for execution if the operands are available. Some embodiments may support in-order processing, whereby instructions are issued for execution in an order corresponding to the program order in which the instructions are fetched from the L1 instruction cache 20. Other embodiments may support out-of-order execution, whereby instructions may be issued to the execution stage 12 in an order different from the program order. Out-of-order processing is useful for improving performance because later instructions in the program order for which operands are available may be executed first while earlier instructions are stalled waiting for operands.

[0076] The issue stage 10 issues instructions to the execution stage 12, where the instructions are executed to perform various data processing operations. For example, the execution stage may include a plurality of execution units 30, 32, 34, including an arithmetic / logic unit (ALU) 30 for performing arithmetic or logical operations on integer values, a floating point (FP) unit 32 for performing operations on values ​​represented in floating point form, and a load / store unit 34 for performing load operations to load data values ​​from a level 1 (L1) data cache 36 to a register 40 or performing a store operation to store data values ​​from a register 40 to the L1 data cache 36. It will be appreciated that these are only some examples of the types of execution units that may be provided, and many other types may also be provided. To perform processing operations, the execution stage 12 may read data values ​​from a set of registers 40. The results of the executed instructions may then be written back to the registers 40 by the write-back stage 14.

[0077] The L1 instruction cache 20 and the L1 data cache 36 may be part of a cache hierarchy that includes multiple cache levels. For example, a level 2 (L2) cache 44 may also be provided, and optionally, other levels of cache may be provided. In this example, the L2 cache 44 is shared between the L1 instruction cache 20 and the L1 data cache 36, but other examples may have separate L2 instruction and data caches. When an instruction to be fetched is not in the L1 instruction cache 20, then the instruction may be fetched from the L2 cache 44, and similarly, if the instruction is not in the L2 cache 44, then the instruction may be fetched from the main memory 50. Similarly, in response to a load instruction, if the data is not in the L1 data cache 36, then the data may be fetched from the L2 cache 44, and if necessary, then the data may be fetched from the memory 50. Any known scheme may be used to manage cache hierarchies.

[0078] The addresses used by pipeline 4 to reference program instructions and data values ​​may be virtual addresses, but at least main memory 50, and optionally at least some levels of the cache hierarchy, may be physically addressable. Therefore, a translation lookaside buffer 52 (TLB) may be provided for converting the virtual addresses used by pipeline 4 into physical addresses for accessing cache or memory. For example, TLB 52 may include a plurality of entries, each entry specifying a virtual page address of a corresponding page of a virtual address space, and a corresponding physical page address to which the virtual page address should be mapped, so as to convert the virtual address in the corresponding page into a physical address. For example, the virtual page address and the physical page address may correspond to the most significant portion of the corresponding virtual address and physical address, while the remaining least significant portion remains unchanged when the virtual address is mapped to the physical address. In addition to the address translation information, each TLB entry may also include some information specifying access rights, for example, indicating whether certain address pages may be accessed in certain modes of pipeline 4. In some embodiments, the TLB entry may also define other attributes of the corresponding address page, such as cache policy information that defines which levels of the cache hierarchy are updated in response to read or write operations (e.g., whether the cache should operate in write-back or write-through mode), or information that defines whether data accesses to addresses in the corresponding page can be reordered by the memory system compared to the order in which the data accesses were issued by pipeline 4.

[0079] although Figure 1 A single level TLB 52 is shown, but it should be understood that a hierarchy of TLBs may be provided such that a level 1 (L1) TLB 52 may include TLB entries for translating addresses in multiple recently accessed pages, and a level 2 (L2) TLB may be provided to store entries for more pages. When the required entry is not present in the L1 TLB, it may be fetched from the L2 TLB or other TLBs in the hierarchy. If the required entry for the page to be accessed is not in any TLB, a page table walk may be performed to access the page table in the memory 50. Any known TLB management scheme may be used in the present technology.

[0080] In addition, it will be appreciated that some systems may support multiple levels of address translation, such that, for example, a first TLB (or hierarchy of TLBs) may be used to translate a virtual address into an intermediate address, and a second level of address translation using one or more additional TLBs may then translate the intermediate address into a physical address for accessing a cache or memory. This may be used, for example, to support virtualization, where a first level of address translation may be managed by an operating system and a second level of address translation may be managed by a hypervisor.

[0081] like Figure 1As shown, the device 2 may have a set of bounded pointer registers 60. Although Figure 1 The set of bounded pointer registers is shown in FIG. 4 as being physically separate from a set of general data registers 40 , but in one embodiment the same physical storage device may be used to provide both the general data registers and the bounded pointer registers.

[0082] Each bounded pointer register 60 includes a pointer value 62, which can be used to determine the address of the data value to be accessed, and range information 64, which specifies the allowed address range when using the corresponding pointer 62. The bounded pointer register 60 may also include restriction information 66 (also referred to herein as permission information), which can define one or more restrictions / permissions on the use of the pointer. For example, the restriction 66 can be used to limit the type of instructions that can use the pointer 62, or the mode of the pipeline 4 in which the pointer can be used. Therefore, the range information 64 and the restriction information 66 can be considered to define the capabilities in which the pointer 62 is allowed to be used. When attempting to use the pointer 62 outside the defined capabilities, an error can be triggered. The range information 64 can be used, for example, to ensure that the pointer remains within certain known ranges and does not deviate to other areas of the memory address space that may contain sensitive or security information. In an embodiment in which the same physical storage device is used for both general data registers and bounded pointer registers, then in one embodiment, the pointer value 62 can be, for example, stored in the same storage location as used for the corresponding general register.

[0083] Figure 2 Examples of instruction types for which permitted scopes are used to prevent unauthorized access to data or instructions are shown. Figure 2 As shown at the top of FIG. 1 , a particular bounded pointer register PR1 includes a given pointer value 62 and range information 64, which in this example is specified using a lower bound address 68 (defining the lower bound of the allowed range) and an upper bound address 69 (defining the upper bound of the allowed range). For example, the boundaries 68, 69 are set to define an address range of 80000 to 81000. When certain instructions reference the bounded pointer register PR1 and the address determined from the pointer 62 is outside this range, an error may be triggered.

[0084] For example, Figure 2 As shown in part A of FIG. 1 , in some systems, if an attempt is made to set the value of pointer 62 in pointer register 60 to a value outside the range specified by range information 64, an error may be triggered (here it is assumed that the pointer directly specifies an address). This prevents pointer 62 from taking any value outside the specified range, so that any access using the pointer can be ensured to be safely within the allowed range. Alternatively, as Figure 2As shown in part B of FIG. 1 , when an instruction attempts to access a location identified by the address of pointer 62, an error may be triggered if the address is outside the specified range. Thus, it may still be permitted to set pointer 62 to a value outside the specified range, but once an attempt is made to access data at the pointer address (or an address derived from the pointer), an error may be triggered if the address is outside the permitted range. Other system responses Figure 2 There are two types of instructions shown in Part A and Part B that trigger errors.

[0085] The range information 64 may be set in different ways. For example, a security code, or an operating system or hypervisor, may specify the allowed range for a given pointer. For example, an instruction set architecture may include multiple instructions for setting or modifying the range information 64 for a given pointer 62, and the execution of these instructions may be limited to certain software, or certain modes, or abnormal states of the processor 4. Any known technique for setting or modifying the range information 64 may be used.

[0086] In addition to the set of bounded pointer storage elements 60 that may be used at the execute stage 12 when executing certain instructions that reference pointers, a program counter function (PCC) register 80 may also be used to provide similar functionality at the fetch stage 6 when fetching instructions from the level 1 instruction cache 20. Specifically, the program counter pointer may be stored in field 82, with PCC 80 also providing range information 84 and any appropriate limit information 86, similar to the range and limit information provided for each pointer in the set of bounded pointer storage elements 60.

[0087] Figure 3 Schematically illustrated is how tag bits are used in association with individual data blocks to identify whether those data blocks represent capabilities (i.e., bounded pointers and associated restriction information) or represent normal data. Specifically, the memory address space 110 will store a series of data blocks 115, which will typically have a specified size. For illustrative purposes only, it is assumed in this example that each data block includes 128 bits. Associated with each data block 115, a tag field 120 is provided, which in one example is a single bit field referred to as a tag bit, which is set to identify that the associated data block represents a capability, and is cleared to indicate that the associated data block represents regular data and therefore cannot be considered a capability. It should be understood that the actual value associated with the set or cleared state may vary depending on the implementation, but by way of illustration only, in one example implementation, if the value of the tag bit is 1, it indicates that the associated data block is a capability, and if its value is 0, it indicates that the associated data block contains regular data.

[0088] When a capability is loaded into one of the bounded pointer registers 60 (also referred to herein as capability registers), for example, Figure 3In the capability register 100 shown, the tag bit moves with the capability information. Therefore, when the capability is loaded into the capability register 100, the pointer 102, the range information 104 and the restriction information 106 (hereinafter referred to as the permission information) will be loaded into the capability register. In addition, in association with the capability register, or as a specific bit field in the capability register, the tag bit 108 will be set to identify the content representation capability. Similarly, when the capability is stored back into the memory, the relevant tag bit 120 will be set in association with the data block storing the capability. In this way, capabilities and regular data can be distinguished, thereby ensuring that regular data cannot be used as capabilities.

[0089] return Figure 1 According to the techniques described herein, a revocable bounded pointer may be generated that includes, in addition to conventional information associated with a bounded pointer, a first token value associated with a corresponding memory region for which the bounded pointer is used to control access. In addition, for use in association with a revocable bounded pointer for an allocation instance of a memory region, a header is provided that is stored at a header location in a memory, wherein the header has a first token field whose stored value is initialized to a first token value used in association with the revocable bounded pointer. The header location is arranged to be derivable from range information provided by the revocable bounded pointer, thereby enabling the header to be located when the bounded pointer is used to generate a memory address. When the allocated memory region is subsequently deallocated, the stored value in the first token field is modified.

[0090] Figure 1 Schematically illustrated are components for managing the use of revocable bounded pointers and headers provided in association with corresponding memory regions. Specifically, as shown, a bounded pointer control circuit 90 is provided for controlling the generation of bounded pointers, and the movement of these bounded pointers between the capability register 60 and the cache hierarchy 36, 44 and / or the memory 50. In addition, a memory allocator / deallocator circuit 92 is provided for allocating memory regions within the memory, for example, so that they can be used by a specific process performed on a data processing device, and for subsequently deallocating those memory regions. The memory allocator / deallocator circuit is also responsible for maintaining the header of each memory region.

[0091] In some embodiments, bounded pointer control circuit 90 and memory allocator / deallocator 92 may be provided by dedicated hardware components. Alternatively, they may be implemented on existing hardware of a data processing device under the control of a trusted code (e.g., secure code) or an operating system or hypervisor. In the case where any of these components are implemented by software, bounded pointer semantics should still be implemented by hardware.

[0092] Also like Figure 1 As shown, additional storage means 94 is provided in association with the set of bounded pointer registers 60. This may be provided as a separate storage component to that used to provide storage for the bounded pointer registers 60, or may be provided within the same component, thereby effectively providing an extension for each bounded pointer register so that they can store not only bounded pointers, but also some additional information at corresponding locations in the additional storage means 94. Specifically, as will be discussed in more detail later, for revocable bounded pointers, the relevant location in the additional storage means associated with the bounded pointer register may be used to store a second token value, which is also maintained in the header provided for the memory area associated with the revocable bounded pointer stored in the bounded pointer register.

[0093] In some embodiments, it may be desirable to provide a revocable program counter functionality, and in such a case, further additional storage may also be provided in association with the PCC register 80 .

[0094] Figure 4 1 is a flow chart showing a memory allocation operation that may be performed by the memory allocator / deallocator circuit 92 in one example embodiment. At step 150, it is determined that a new memory area needs to be allocated. This may be triggered by software executing on the processing circuit, for example, due to the need to provide a portion of memory for use by a specific process or task executed on the data processing device. Once a new memory area is to be allocated, at step 155, the address range of the memory area is determined using any of a variety of standard memory allocation techniques, and then at step 160, the identified memory area is marked as allocated so as to reserve the memory address range forming the memory area for use by the associated task or process. If a revocable bounded pointer is to be constructed for the memory area, and the associated header is located in a software addressable storage location, a portion of memory also needs to be reserved to store the header.

[0095] At step 165, it is then determined whether revocable bounded pointers are to be used for the memory region. Specifically, in one embodiment, it may be the case that revocable bounded pointers are supported, but standard bounded pointers may also be used, so in some cases it may be determined that standard bounded pointers are to be used for a particular memory region. If revocable bounded pointers are not to be used, then at this point processing may proceed to step 170, where conventional steps associated with using standard bounded pointers may be performed.

[0096] However, assuming that the allocated memory region will have at least one revocable bounded pointer associated therewith, processing proceeds to step 175, wherein a header for the memory region is created, which is then stored at a header position determined for the memory region. As will be discussed in more detail below, if the header position can be determined using the range information provided in the associated revocable bounded pointer, the header position can take a variety of different forms. The contents of the header can take a variety of forms, but in one described embodiment, a first token (also referred to herein as a small token), a second token (also referred to herein as a large token), and the values ​​of certain bounded pointer bits to be used for bounded pointers associated with the memory region are provided. The bounded pointer bits maintained in the header can take a variety of forms, but are typically bounded pointer bits common to any bounded pointer created for use in association with the current allocation instance of the memory region. As an example, this can include a portion of the range information, because the range information will be common to bounded pointers assigned to a specific memory region, and in one embodiment, the range information identifies the base address and limit address of the memory region. Furthermore, certain permission bits may be common to bounded pointers created for use in association with a memory region, and one or more of those permission bits may be included in the information maintained within the header.

[0097] As will be apparent from the discussion that will follow, when a bounded pointer is moved between the bounded pointer registers 60 and the memory, the values ​​of certain bounded pointer bits are retained in the header for use in encoding operations and corresponding decoding operations. Specifically, larger tokens cannot be accommodated within the revocable bounded pointer itself (in contrast to small tokens, which, in one example embodiment, are incorporated into the revocable bounded pointer with a series of bits that are not used in the bounded pointer format). Therefore, although large token information can be maintained in a corresponding portion of the additional storage device 94 while the revocable bounded pointer is present in one of the bounded pointer registers 60, the large token information cannot be maintained when the bounded pointer is stored in the memory. Therefore, in one example embodiment, a portion of the revocable bounded pointer (i.e., the portion corresponding to the portion maintained in the header) will be subjected to an encoding operation using the large token to generate an encoded portion, the encoding operation taking the following form, which later causes the large token to be used to decode the encoded portion in order to restore it back to its original content, and then the encoded form of the revocable bounded pointer is stored in the memory.

[0098] In an alternative embodiment, it may be sufficient to use a small token without providing a second token. In this case, the header may only need to provide an indication of the small token without identifying the value of certain bits of the second token or bounded pointer. In addition, no encoding and decoding operations will be required because the first token value can be directly incorporated into the revocable bounded pointer and can therefore be maintained when the revocable bounded pointer is moved (in either direction) between the bounded pointer register 60 and the memory 50. However, as the overall size of the token increases, the robustness of the mechanism to prevent post-release usage scenarios is improved, so for the purposes of the example embodiments described below, it will be assumed that the overall token is represented by a small token (which can be represented directly in a bounded pointer) and a large token (which cannot be represented directly in a bounded pointer), and the two pointers are used when deciding whether to revoke the revocable bounded pointer. This will be discussed in more detail with reference to the remaining figures.

[0099] Figure 5 A bounded pointer creation process that can be implemented by a bounded pointer control circuit 90 is shown. Specifically, the process describes a sequence of events that occurs when a revocable bounded pointer is created, as determined at step 200. Once a revocable bounded pointer is created, at step 205, the fields of the bounded pointer are filled with the required information (including the usual pointer, range, and permission information). However, in addition, the bounded pointer will be filled to merge the small token value as stored in the small token field of the header of the associated memory area. In addition, in the example implementation described herein, a revocable (R) bit is provided in the bounded pointer, which can be set to identify that the bounded pointer is a revocable bounded pointer. In contrast, if a standard bounded pointer is being created, no first token value will be incorporated into the bounded pointer, and the R bit will be cleared.

[0100] As will also be discussed in more detail later, in one embodiment, an encoding (E) bit is provided that can be set to identify the revocable bounded pointer as being in encoded form, and can be cleared to identify the revocable bounded pointer as being in decoded form. If the embodiment uses the E bit information, then at step 205, the E bit is cleared because at the point where the bounded pointer is created, in one example, it will be created in unencoded form in one of the bounded pointer registers 60.

[0101] At step 210, the revocable bounded pointer will be stored within the selected bounded pointer register 60 and the large token as provided in the header of the corresponding memory region will be stored in the additional storage 94 associated with the selected bounded pointer register 60. The large token may be stored in the additional storage 94 in a variety of ways. If a revocable bounded pointer within one of the bounded pointer registers 60 is used to generate a memory address, the appropriate second token for that bounded pointer may be accessed from the additional storage 94, then any suitable mechanism may be used.

[0102] In some embodiments, if there is a notification mechanism that causes the core to receive notification if a write operation is performed on any header associated with a revocable bounded pointer currently in its bounded pointer register, then the use of additional storage may not be required. Specifically, in this case, if the core does not receive any such notification, and has not yet written the associated header itself, it knows that the header has not been changed and therefore the area has not been deallocated, and thus the use of an authentication check can be avoided. With respect to the encoding operation that would be required if the revocable bounded pointer was moved to memory, the second token value can be loaded directly from the header for that purpose.

[0103] A specific example of such a notification mechanism is the cache coherence scheme example discussed above. Specifically, if the header is cached, the authentication check can be optimized so that the current core (i.e., the core using revocable bounded pointers) does not actually need to perform the authentication check until the cache coherence scheme suggests an update to the cached version of the header, or the current core updates the header. In this case, the need for additional storage 94 can be avoided. If notification of a modification of the header is received at an appropriate time, and additional storage is not provided, all revocable bounded pointers that are associated with the modified header and currently reside in one of the bounded pointer registers should be invalidated.

[0104] Figure 6 2 shows a memory deallocation operation that may be performed by the memory allocator / deallocator circuit 92. When it is determined at step 250 that the allocated memory region needs to be deallocated, for example because the process that was intended to use the memory region has completed and therefore the memory region is no longer needed, the process proceeds to step 255 where it is determined whether the memory region has an associated header. This would be the case where a revocable bounded pointer has been created for use in association with the memory region.

[0105] If the memory region does have an associated header, then the header is overwritten with a predetermined value at step 260. Exactly what data is written to the header will vary depending on the implementation, but the purpose of the overwrite process is to ensure that the header no longer maintains the large and small token values ​​previously stored in the header, as a result, they will no longer match the token information maintained in association with the revocable bounded pointer associated with the memory region.

[0106] Following step 260, or immediately following step 255 if the memory region does not have an associated header, processing proceeds to step 265 where the memory region is deallocated so that it can be used as part of a pool of memory addresses available for future allocations of memory regions.

[0107] 7A to 7C The use of a header in an example implementation is shown, as well as the form of a revocable bounded pointer. Fig. 7A As shown, in the memory allocation process, a memory area 305 in a memory address space 300 can be determined as a memory area to be allocated. The allocated memory area will have a base address identifying the first address in the area and a limit address identifying the last address in the area. In addition, in the case where the memory area will have a revocable bounded pointer associated with it, a header for the memory area will be generated, which will be stored at a head position 310. The head position can take many forms, but in one embodiment, it is required that its position can be determined using the range information of the allocated memory area, which will be provided in the revocable bounded pointer of the memory area. In an example embodiment, the base address and the limit address information will be encoded in the range information of the bounded pointer, and therefore, the head position is arranged so that it can be directly derived from one of the base address or the limit address. In the example shown, the head position can be directly determined from the base address, and specifically consists of the memory address bits just before the start of the allocated memory area. However, it is not required that the head position is directly adjacent to the memory area, but can be located at a fixed offset before the start of the memory area, so that the head position can be determined according to the base address and the fixed offset. Alternatively, the head position may be arranged just after the end of the allocated memory region so that it may be determined using the limit address. Likewise, it may alternatively be located at a fixed offset after the end of the memory region.

[0108] As another example, if the location of the header can be determined from the address of the memory region using some determination mechanism, the header can be placed in any single location relative to the memory region. For example, a binary search tree can be used, with the address of the allocated memory region as the search key and the header as the corresponding value.

[0109] In some example implementations, the header locations may be provided as software addressable memory bits, but alternatively may be provided as non-software addressable memory bits, in much the same manner as ECC bits may be provided in association with data in memory.

[0110] The header format can take many forms, but Figure 7BBox 315 in shows one format. In this example, four fields are provided, namely a small token field 320 for storing a small token value, a large token field 335 for storing a large token value, and an additional field for storing certain information bits to be provided in a revocable bounded pointer associated with a memory region. Specifically, field 325 may be provided to store a specific portion of the range information. In one example implementation, the portion stored in this field is the portion that is not needed to identify the head position. Consider Fig. 7A In the example of , the base address is used to identify the head position, so field 325 can store the limit address and is called the limit field. However, if the limit address is used to identify the head position, the base address can be identified in field 325, and this field is called the base field.

[0111] In one example implementation, field 325 may be sufficient, but other information bits from the bounded pointer may also be generated again within the header if desired. For example, a permission field 330 may be provided to store at least a portion of the permission bits for the bounded pointer. Typically, the permission field will be used to store those permission bits that are common to any bounded pointer created for use in association with the allocated memory region.

[0112] Figure 7C An example revocable bounded pointer 340 is shown, and in particular, the various fields that may be provided therein. As shown, the revocable bounded pointer includes a pointer field 345 for storing a pointer value, a base field 350 for identifying a base address of a memory region, a restriction field 355 for identifying a restriction address, a permission field 360 for storing various permission bits, a small token field 365 for storing a small token value, and other bit fields shown. Specifically, an R bit field 370 may be used, which is set to identify that the bounded pointer is a revocable bounded pointer, and is cleared when the bounded pointer is a standard bounded pointer. In addition, the previously referenced Figure 3 The T-bit information discussed may be stored within T-bit field 380. Alternatively, an E-bit field 375 may be provided, which may be used to identify whether the contents of a bounded pointer are encoded.

[0113] In some embodiments, the use of the E bit will not be necessary. For example, in one embodiment, it may be the case that a revocable bounded pointer is always decoded when stored in one of the bounded pointer registers 60, and is always encoded when stored in the memory 50. In this case, the E bit information can be inferred and a separate field need not be provided. However, in embodiments where it is desired to allow an encoded bounded pointer to reside in one of the bounded pointer registers 60, then an E bit field 375 may be provided so that it can be determined whether a particular revocable bounded pointer is currently in an encoded form (not usable when generating a memory access) or a decoded form (which may be used when performing a memory access if processed using an authentication check).

[0114] In one example implementation, when a bounded pointer is generated, it is created in one of the bounded pointer registers 60, e.g. Figure 7C Bounded pointer register 385 is shown. When a bounded pointer is stored in a bounded pointer register, an associated portion of additional storage 94 (e.g., portion 390) is used to store the associated large token, i.e., the large token is stored in large token field 335 of header 315 of the corresponding memory region.

[0115] For a bounded pointer to be used to generate a memory address, it must first reside in one of the bounded pointer registers 60, and therefore the additional storage will capture the large token information when used. Figure 7C As shown, if desired, the additional storage device can be arranged to be inaccessible to at least some types of software, thereby improving the security of large token information by preventing the possibility of software modification of large token values.

[0116] When revocable bounded pointers are used to generate memory addresses, then authentication checking can be implemented under hardware control, such as Figure 8 shown.

[0117] Specifically, when an instruction that generates a memory address is executed within the execution pipeline, the processor hardware may determine at step 400 that a revocable bounded pointer is to be used to generate the memory address, at which point processing may proceed to step 405. At step 405, at least a portion of the range information provided within the revocable bounded pointer is used to identify the head of the memory region. Consider Fig. 7A In the example of FIG. 3 , the base address information stored in base field 350 will be used for this purpose, but as previously described, in alternative embodiments, restricted address information may be used for this purpose.

[0118] Once the header location is identified, the token values ​​held in the small token field and the large token field of the header are retrieved at step 410. It should be noted that it is not necessary to access the main memory to obtain the small token field and the large token field of the header. For example, in many systems, there will be one or more levels of cache that can be used to cache data for access by the processing pipeline 4, such as the level 1 and level 2 caches 36, 44 discussed previously. Therefore, the contents of the header can be cached to improve access time when it is necessary to perform usage authentication.

[0119] Thereafter, at step 415, it is determined whether the small token value in the revocable bounded pointer and the large token value in the associated attached storage match the value retrieved from the header. If not, processing proceeds to step 425, where the revocable bounded pointer is revoked, which causes the request to generate the memory address to fail and prevents further use of the revocable bounded pointer.

[0120] However, assuming that check 415 passes, the revocable bounded pointer is allowed to be used to generate a memory address at step 420. It should be noted that once a memory address is generated, all the usual bounds and permissions checks are performed to ensure that the generated memory address does fall within the range of the associated memory region and that the type of access requested is allowed to be performed in view of the permissions information.

[0121] As previously described, in embodiments using large tokens, encoding and associated decoding mechanisms may be used when transferring revocable bounded pointers between bounded pointer storage element 60 and memory. Specifically, when storing a revocable bounded pointer in memory, a portion of the bounded pointer may be encoded using a large token in a manner that allows that portion of the revocable bounded pointer to be recreated using a second token value and the encoded bounded pointer at a later point during a decoding operation. Fig. 9 The flowchart of shows an example of an encoding operation that may be performed. At step 450, a determination is made as to whether there is a revocable bounded pointer to be stored to memory, and when this occurs, processing proceeds to step 455, where the bounded pointer control circuit 90 performs an encoding operation while moving the bounded pointer from the associated bounded pointer register 60 to memory. Specifically, at step 455, the identified portion of the bounded pointer is encoded using a large token stored in the additional storage device 94 associated with the bounded pointer register storing the revocable bounded pointer. Consider Figure 7BIn the example of , where a subset of the restriction fields and permission bits are maintained within the header, these are the bits that form part of a bounded pointer encoded using a large token. In particular, since the header contains a copy of this information, it can later be determined whether the contents of the large token field 335 have changed when performing an associated decode operation, and therefore whether the revocable bounded pointer should be revoked when performing the decode. Reference will be made later to Fig.10 This is discussed in detail in the flowchart.

[0122] Once the encoding operation is performed at step 455, the encoded revocable bounded pointer is stored to the memory at step 460, and if the bounded pointer format includes the E bit, the E bit is set. Then, at step 465, if necessary, the contents of the relevant bounded pointer register and the associated additional storage device can be invalidated. At this point, the revocable bounded pointer has been migrated to the memory, but in an encoded form that takes into account the large token value. As an alternative to invalidating the contents of the relevant bounded pointer register and the associated additional storage device at step 465, this information can be retained only when needed, in which case it should be understood that the revocable bounded pointer has been copied to the memory in an encoded form while still retaining the revocable bounded pointer in the bounded pointer register.

[0123] In one embodiment, whenever a revocable bounded pointer is stored in a memory from one of the bounded pointer registers, an encoding operation is performed. When such an encoded bounded pointer is subsequently retrieved from the memory for storage back in one of the bounded pointer registers 60, it can be decoded before being written into the bounded pointer register. Specifically, in the case where the bounded pointer format does not include information for identifying whether the bounded pointer is encoded, this method will always be adopted, but alternatively, it will be predetermined that the revocable bounded pointer will always be stored in the memory in an encoded form, and stored in the register in an unencoded form. However, for a bounded pointer format including an E bit, an encoded bounded pointer can be retrieved from the memory into a bounded pointer register, although the bounded pointer in the encoded form cannot be used to generate a memory address until it is decoded. This can prove useful in some cases, for example, when migrating bounded pointers between different areas of the memory, during which time the bounded pointer can be loaded into one of the bounded pointer registers and then stored back to different memory addresses.

[0124] Fig.10 is a flow chart illustrating a decoding operation in one example implementation. When it is determined at step 500 that a bounded pointer is to be decoded, then processing proceeds to step 505, where at least the unencoded portion of the range information is used to identify the head of the associated memory region. Considering the previous reference 7A to 7CIn the example discussed, since the restriction field information is part of the encoded range information, the base address information will be the information used to identify the header. However, on the contrary, if the restriction information is used to identify the header, the base information will have been encoded, and the restriction address will be used to identify the header at step 505.

[0125] At step 510, the header contents are retrieved, after which at step 515 the encoded portion of the revocable bounded pointer is decoded using the value in the large token field 335 of the header 315. Assuming the value held in the large token field 335 is still the same as the large token value when the revocable bounded pointer was encoded, this will recreate the relevant portion of the revocable bounded pointer in its decoded form. At step 520, a determination is made as to whether the decoded portion matches the bounded pointer bit value stored in the header. Consider Figure 7B In an example of , this would involve comparing the decoded restriction address information with the various permission bit values, and the corresponding data being maintained in fields 325 , 330 of header 315 .

[0126] If a mismatch is detected for any reason at step 520, then at step 530, the revocable bounded pointer is invalidated. Otherwise, at step 525, it is determined whether the small token value in the revocable bounded pointer matches the value in the small token field 320 of the header 315. If not, then at step 530, this again invalidates the revocable bounded pointer, but otherwise processing proceeds to step 535, where the decoded revocable bounded pointer is stored in the selected bounded pointer register and the large token value retrieved from the header is stored to the appropriate location in the associated storage device 94. Additionally, in embodiments that use the E bit, then the E bit within the revocable bounded pointer will be cleared at this time to confirm that the revocable bounded pointer is in decoded form.

[0127] Fig.11 The previously described encoding and decoding process is schematically shown. Fig.11 As shown at the top of the figure, the unencoded bounded pointer 600 includes the previously referenced Figure 7C All of the various fields discussed, including the restrictions and permissions fields 610, 615, in this example, form part of the bounded pointer that is encoded when the bounded pointer is stored in memory. As previously discussed, not all permission bits are included for this purpose. The additional storage device 605 stores the corresponding large token value, and this large token value is used to perform an encoding operation 620 so that an encoded revocable bounded pointer 622 is stored in memory. In addition to the restrictions and permissions fields 610, 615, this also includes various parts of the original unencoded bounded pointer, and instead of the restrictions and permissions fields 610, 615, there is an encoded portion 625 within the encoded revocable bounded pointer.

[0128] When a decision is subsequently made to decode the encoded revocable bounded pointer 622, the base field 630 is accessed and used to identify a header 635 stored in memory associated with the corresponding memory region. The large token is then retrieved from the header and used to perform a decode operation 640 using the encoded portion 625 to produce decoded restriction and permission information.

[0129] This decoded restriction and permission information, along with the small token value, is input to the matching process 645, which also receives the restriction, permission and small token information from the header 635. In the event that a match is detected, the decoded revocable bounded pointer is stored in the associated bounded pointer register and the large token value from the header 635 is stored in the additional storage 605. Fig.11 As shown at the bottom of , the original unencoded bounded pointer has therefore been recreated. If a match is not detected at step 645, the revocable bounded pointer is invalidated / revoked.

[0130] As from Fig.11 Obviously, in an implementation using the E bit, when the revocable bounded pointer is in unencoded form, the E bit is cleared, and when the bounded pointer is in encoded form, the E bit is set.

[0131] The encoding and associated decoding operations may take a variety of forms. The primary requirement is that the encoded value resulting from the encoding operation may be decoded to the same concatenated field value of the original revocable bounded pointer using the same token value as was used when encoding. In some cases, it may also be desirable that the encoded value may not be decoded to the same concatenated field value using any other token value. However, in some embodiments, it may be considered that this latter restriction is not required to facilitate a sufficient degree of resilience to post-release use scenarios.

[0132] Fig. 12A and Fig. 12B Two example encoding schemes are schematically shown which may be used in the case where the number of bits in the large token is not directly the same as the number of bits in the relevant portion of the bounded pointer being encoded. In particular, one suitable encoding scheme would be to use an XOR binary operation applied between the relevant bits of the bounded pointer and the relevant bits of the large token. This is straightforward in the case where the number of bits in the large token is the same as the number of bits in the relevant portion of the bounded pointer. Conversely, if Fig. 12A As shown, if the number of bits in the bounded pointer 700 that need to be encoded exceeds the number of bits in the large token 705, then in one embodiment, the large token can be extended using any suitable scheme (e.g., rotation) to add additional bits 710. Thereafter, an XOR operation 715 can be applied between each corresponding pair of bits in the bounded pointer portion 700 and the extended large token formed by the portions 705, 710 to produce the encoded bits 720.

[0133] Fig. 12B An alternative approach is shown where the large token is larger than the associated number of bits of the bounded pointer that needs to be encoded. In this case, an XOR operation 740 is applied using the associated bounded pointer bits 700 and the corresponding number of bits of the large token 730 to generate an intermediate encoding 745. The remaining bits of the large token 735 can then be used to perform a complementary operation (in the example shown, this is a rotation 750) on the intermediate encoding to produce encoded bits 755.

[0134] use Fig. 12A and Fig. 12B For both methods, it will be appreciated that corresponding decoding operations may be performed which, assuming the same large token is used, will result in the re-creation of the original bounded pointer bits 700.

[0135] However, it should be noted that providing Fig. 12A and Fig. 12B This is merely to illustrate a specific example of a suitable encoding scheme, and it will be appreciated that any other suitable encoding scheme may be used as long as it is able to recreate the bounded pointer bits using the same token values ​​as during the encoding process.

[0136] In many cases, it is beneficial to be able to reliably undo a bounded pointer to ensure that it is not used after the corresponding memory area has been deallocated. Fig.13 An example use case is shown in , where a first device 800 has associated memory 815 and is able to allocate a memory region 820 that it wants to temporarily allow access to from a second device 805. According to the scheme described herein, the first device 800 can generate a revocable bounded pointer 810 for use in association with the memory region 820, and as a result of the mechanisms described herein, a header 825 will also be created in association with the memory region 820.

[0137] The revocable bounded pointer 810 may then be passed to the second device 805 to enable the second device 805 to access the memory region 820. The second device will then perform a usage authentication check 830 in hardware when using the revocable bounded pointer to generate a memory address.

[0138] As a result, when the first device 800 decides to deallocate the memory area 820 at the appropriate time, the previously described mechanism will ensure that if the second device 805 subsequently attempts to use the revocable bounded pointer 810, the usage authentication check 830 will fail, causing the revocable bounded pointer to be revoked, thereby preventing its further use by the second device 805.

[0139] In the examples discussed with reference to the accompanying drawings, it is assumed that when a revocable bounded pointer is stored in a memory, the encoded portion of the revocable bounded pointer is predetermined. Figure 7B , in this example, it is assumed that the restricting address information and predetermined permission bits constitute the encoded portion of the bounded pointer. However, in alternative embodiments, the actual bits used may be configurable. For example, the header may include a control field that identifies which bits of the revocable bounded pointer have been used to form a copy of the revocable bounded pointer stored in the header. For example, a mask field may be used to accurately identify which bits of the revocable bounded pointer are represented by the values ​​in fields 325, 330 of the header 315, and these bits do not have to be predetermined as restricting addresses and certain permission bits. Because of the presence of the mask field, it is possible to determine which bits of the revocable bounded pointer will be used as input to the encoding operation when encoding, and similarly, when decoding, it is possible to determine which bits are to be subjected to a decoding operation to ensure that the original bits are recreated when the token value used during the decoding operation is the same as the token value used in an earlier encoding operation.

[0140] The techniques described herein provide a mechanism for significantly mitigating the possibility of a use-after-release scenario occurring. The probability of preventing a use-after-release scenario depends on the size of the token used. Therefore, there is a trade-off between the token size and the probability of preventing any use-after-release scenario from occurring. Therefore, the token size can be appropriately selected depending on the implementation. In some embodiments, it may be sufficient to use only small tokens, and in this case, the encoding and decoding operations described above will not be required because the small token can be completely accommodated within the revocable bounded pointer. However, it is generally considered appropriate to use both large tokens and small tokens to generate an overall token of appropriate size. By way of example only, if the size of the concatenated large token and small token fields is 40 bits, the probability of generating a token with a particular selected value is approximately one in 100 million.

[0141] If desired, other steps may be taken to reduce the likelihood that an attacker could circumvent the measures described herein. For example, an attacker could recreate a large number of random values ​​and specify different token values ​​to continually retry memory accesses. However, if desired, the processing device may be arranged to prevent such activity, for example, by stopping the attack component from performing further attempts after the first access fails.

[0142] In this application, the phrase "configured to..." is used to indicate that an element of a device has a configuration that enables it to perform a defined operation. In this context, "configuration" means the arrangement or manner of interconnection of hardware or software. For example, the device may have dedicated hardware that provides the defined operation, or a processor or other processing device that can be programmed to perform the function. "Configured to" does not mean that the device elements need to be changed in any way to provide the defined operation.

[0143] Although illustrative embodiments of the present invention have been described in detail herein with reference to the accompanying drawings, it should be understood that the present invention is not limited to those precise embodiments and that various changes, additions and modifications may be made therein by those skilled in the art without departing from the scope and spirit of the present invention as defined by the appended claims. For example, the features of the dependent claims may be variously combined with the features of the independent claims without departing from the scope of the present invention.

Claims

1. A device, include: A memory allocation circuit for allocating a memory area in the memory; as well as A bounded pointer generation circuit is used to generate a bounded pointer, wherein the bounded pointer at least includes a revocable bounded pointer for accessing the memory area, and the revocable bounded pointer provides a pointer value and range information identifying an address range of the memory area; wherein the memory allocation circuitry is arranged to provide a header for the memory region at a header position in the memory, the header having a first token field, a stored value of the first token field being initialized to a first token value associated with the memory region, the head position being derived from the range information provided by the revocable bounded pointer, and wherein the memory allocation circuitry modifies the stored value in the first token field of the header in response to a subsequent deallocation of the memory region; and wherein, in response to a request to generate a memory address using the revocable bounded pointer, a usage authentication check is arranged to prevent generation of the memory address upon determining that the stored value in the first token field has been altered, in: the usage authentication check being arranged to invalidate the revocable bounded pointer upon determining that the stored value in the first token field has been altered; The revocable bounded pointer is arranged to store the first token value; and In response to a request to generate a memory address using the revocable bounded pointer, the usage authentication check is arranged to employ the range information to determine the head position and, in the event of a mismatch between the first token value stored in the revocable bounded pointer and the stored value in the first token field of the header, invalidate the revocable bounded pointer.

2. The apparatus according to claim 1 further comprising a token generation circuit for generating the first token value.

3. The device according to claim 2, in, The token generation circuit is a pseudo-random number generator.

4. The device according to any one of claims 1 to 3, in, The bounded pointer generation circuit is further arranged to provide a revocable field in each generated bounded pointer, the revocable field being set when the generated bounded pointer is the revocable bounded pointer.

5. The device according to claim 2, further comprising: include: A set of bounded pointer registers, each bounded pointer register being arranged to store a bounded pointer for generating a memory address.

6. The device according to claim 5, in: The header further comprises a second token field arranged to store a second token value associated with the memory region, the second token value being absent from the revocable bounded pointer generated by the bounded pointer generation circuit; and The usage authentication check is further arranged to invalidate the revocable bounded pointer when it is determined that the second token value has been changed.

7. The device according to claim 6, further comprising: include: additional storage means provided in association with the set of bounded pointer registers, wherein, when the revocable bounded pointer is stored in a selected bounded pointer register, the additional storage means is arranged to identify in association with the selected bounded pointer register the second token value as initialized in the second token field of the header; wherein the use authentication check is further responsive to a request to generate a memory address using the revocable bounded pointer as stored in the selected bounded pointer register to invalidate the revocable bounded pointer if there is no match between the second token value stored in the header and the second token value stored in the additional storage device associated with the selected bounded pointer register.

8. The device according to claim 7, in, The additional storage is inaccessible to one or more types of software executing on the device.

9. The apparatus of claim 6, further comprising a notification mechanism for identifying when a write operation has been performed on at least one of the first token field and the second token field of the header, thereby enabling the usage authentication check to invalidate the revocable bounded pointer if the first token value or the second token value has been changed.

10. The device according to any one of claims 6 to 9, in, The memory allocation circuitry modifies the value stored in the second token field of the header in response to a subsequent deallocation of the memory region.

11. The device according to any one of claims 6 to 9, in, The token generation circuit is further arranged to generate the second token value.

12. The device according to claim 7, in: The header is arranged to store a copy of a portion of the revocable bounded pointer; and The apparatus comprises an encoding control circuit arranged to, when the revocable bounded pointer is stored from the selected bounded pointer register to the memory, perform an encoding operation to create an encoded revocable bounded pointer by encoding the portion of the revocable bounded pointer using the second token value in a manner that allows the portion of the revocable bounded pointer to be recreated using the second token value and the encoded revocable bounded pointer, whereafter the encoded revocable bounded pointer is stored to the memory.

13. The device according to claim 12, in, The portion of the revocable bounded pointer is the portion that is common to any bounded pointer generated for the current allocation instance of the memory region.

14. The device according to claim 13, in, The portion includes at least a portion of the range information that is not necessary for identifying the head position.

15. The device according to claim 14, in, The range information includes a base address and a limit address of the memory region, the head position is determined using one of the base address and the limit address, and the portion of the revocable bounded pointer for which a copy is stored in the header identifies the other of the base address and the limit address.

16. The device according to any one of claims 12 to 15, in, The portion of the revocable bounded pointer for which a copy is stored in the header includes at least one or more permissions specified within the revocable bounded pointer.

17. The device according to any one of claims 12 to 15, in, The encoding control circuit is arranged to decode the encoded revocable bounded pointer by performing a decoding operation to decode the encoded portion of the revocable bounded pointer using the value stored in the second token field of the header to generate a recreated portion of the revocable bounded pointer, and then performing a checking operation to determine whether the recreated portion of the revocable bounded pointer matches the copied portion of the revocable bounded pointer stored in the header.

18. The device according to claim 17, in, The encoding control circuit is arranged to invalidate the revocable bounded pointer in any of the following circumstances: the checking operation indicates that the recreated portion of the revocable bounded pointer is different from the copied portion of the revocable bounded pointer stored in the header; or The first token value in the decoded revocable bounded pointer is different from the stored value in the first token field of the header.

19. The device according to claim 17, in, The encoding control circuitry is arranged to perform the decoding operation each time an encoded revocable bounded pointer is loaded from the memory into one of the bounded pointer registers.

20. The device according to claim 17, in: Each bounded pointer includes an encoding field that is set to indicate when the revocable bounded pointer has been encoded; and Before the encoded revocable bounded pointer is used to generate a memory address, the encoded revocable bounded pointer needs to be decoded by the encoding control circuit.

21. The device according to any one of claims 1 to 3, in, The head position is arranged relative to the memory region as one of: a sequence of memory addresses immediately preceding the allocated memory region or at a fixed offset preceding the allocated memory region; a sequence of memory addresses immediately following the allocated memory region or at a fixed offset after the allocated memory region; as well as A sequence of memory addresses at locations is determined by performing calculations based on the addresses of the memory regions.

22. The device according to any one of claims 1 to 3, in, The head location is located in a portion of memory that is not addressable by one or more types of software executing on the device.

23. The device according to claim 17, in, The header includes a control field that identifies which bits of the revocable bounded pointer have been used to form the copied portion of the revocable bounded pointer stored in the header.

24. An apparatus according to any one of claims 1 to 3, further comprising a cache structure arranged to maintain a copy of the stored value in the first token field of the header, in, The usage authentication check is arranged to refer to the copy maintained in the cache structure when determining whether the stored value in the first token field has changed.

25. The device according to any one of claims 1 to 3, in, The device is arranged to provide the revocable bounded pointer to other devices to control access to the memory region by the other devices, and the other devices are arranged to perform the usage authentication check, whereby after the device has deallocated the memory region, the other devices will be prevented from further using the revocable bounded pointer to generate memory addresses.

26. A method of controlling the use of bounded pointers in a device, the device having a memory allocation circuit for allocating a memory area in a memory, and a bounded pointer generation circuit for generating a bounded pointer, the method include: arranging the bounded pointer generation circuit to generate at least a revocable bounded pointer for accessing the memory region, the revocable bounded pointer providing a pointer value and range information identifying an address range of the memory region; providing a header for the memory region at a header location in the memory, the header having a first token field, a stored value of the first token field being initialized to a first token value associated with the memory region, the header location being derived from the range information provided by the revocable bounded pointer; causing the memory allocation circuitry to modify the stored value in the first token field of the header in response to a subsequent deallocation of the memory region; as well as In response to a request to generate a memory address using the revocable bounded pointer, causing the memory address to be prevented from being generated upon determining, using an authentication check, that the stored value in the first token field has been altered, in: The using authentication check invalidates the revocable bounded pointer when it is determined that the stored value in the first token field has been changed; The revocable bounded pointer stores the first token value; and In response to a request to generate a memory address using the revocable bounded pointer, the usage authentication check employs the range information to determine the head position and, in the event of a mismatch between the first token value stored in the revocable bounded pointer and the stored value in the first token field of the header, invalidates the revocable bounded pointer.