A formal verification method for access control based on security attributes for ARM architecture
By defining atomic security attributes and access control policies, combining formal verification and new attribute bits in page table descriptors, the problem of insufficient security in the memory access control mechanism of the ARM architecture is solved, and flexible and fine-grained resource management and security are achieved. Protection, enhances memory isolation protection.
Patent Information
- Application Number
- CN202210411830.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2024-11-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing ARM architecture memory access control mechanism cannot independently describe and control the memory read and write permissions of the privileged mode and the user mode, resulting in insufficient security. The existing access control mechanism lacks flexibility and fine-grainedness, making it difficult to provide strict security guarantees. .
By defining the atomic security attributes of system resources and designing access control policies based on these attributes, using formal verification methods to ensure the confidentiality and integrity of the access control mechanism, modifying the ARM memory access control mechanism, and using 4 page table descriptors Reservation bits (PRN, PWN, URN, UWN) are reserved to control the memory read and write permissions of privileged mode and user mode.
It realizes fine-grained control of memory read and write permissions of privileged mode and user mode, enhances resource security protection of ARM architecture, simplifies the judgment logic of access control policies, and verifies the effectiveness and low performance of the new mechanism in the QEMU simulation environment. Performance overhead.
Smart Images

Figure CN114610658B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart device access control security, and in particular to a security attribute-based access control formal verification method for ARM architecture. Background Art
[0002] With the rapid development of the Internet of Things and edge computing technologies, processors using reduced instruction sets such as ARM and RISC-V are becoming popular. These processors use limited resources to provide sufficient computing resources for smart terminals, edge nodes, etc. as much as possible. However, the widespread use of smart devices also highlights their shortcomings in security. As a result, the security of smart devices has gradually become a research hotspot in industry and academia. Smart devices currently use a variety of access control mechanisms to resist attacks, such as the trusted execution environment (TEE) that relies on software and hardware co-design. It is used to provide a powerful isolation mechanism and is widely used in these scenarios to carry some security functions. However, the current access control mechanism often has defects. Among the various threats faced by smart devices, attacks launched by exploiting the defects of their access control mechanisms are increasing. In recent years, many scholars have proposed solutions to enhance the security protection of TEE resources, including optimizing the isolation granularity to reduce the attack surface, building encryption modules, and performing runtime checks to increase the difficulty of attacks. However, the security mechanisms implemented in these solutions are often neither flexible nor able to achieve fine-grained control, and lack strict security guarantees. Therefore, the security boundaries between isolation domains are easily broken. One way to ensure the functional correctness of hardware and software is to use formal methods, which have been gradually applied to TEE. However, existing work often only guarantees the security properties of TA (Trusted Application) and it is difficult to provide a scheduler interface.
[0003] The memory access mechanism of the ARM architecture also has defects. The access control mechanism adopted by the ARMv8 architecture is roughly as follows: the architecture uses PXN and UXN to control the execution permissions of the privileged mode and user mode to the memory respectively. For read and write permissions, the PSTATE.PAN bit is used to control the privileged mode to access any memory belonging to the user mode, and the AP[2:1] attribute bit in the page table entry is used to control the read and write permissions of the memory area. However, since the two AP bits are not enough to describe the 16 combinations of memory read and write permissions of the privileged mode and user mode, this mechanism has two defects: on the one hand, it cannot describe read and write permissions separately; on the other hand, there is a large correlation between the memory access permissions in the privileged mode and the user mode, and their memory access permissions cannot be controlled independently. Summary of the invention
[0004] The present invention discloses a security attribute-based access control formal verification method for ARM architecture. The method abstracts entities in the system and assigns security attributes to them to achieve flexible and fine-grained system resource management, thereby enhancing the resource security protection of the ARM architecture. On this basis, the access control strategy proposed by the present invention is applied to the ARM processor to enhance the memory isolation protection of the ARM architecture. The specific technical solution is as follows:
[0005] A security attribute-based access control formal verification method for ARM architecture, the steps of this method are as follows:
[0006] Step 1: Define the atomic security attributes of system resources, and based on these atomic security attributes, specify security attributes for entities in the system, including subject attributes, object attributes, user attributes, and resource attributes;
[0007] Step 2: Define access control policies. The access control policies use subject attributes, object attributes, and access attribute configurations as inputs to determine whether access is allowed for resource access requests generated in trusted execution environments and untrusted execution environments.
[0008] Step 3: Formalize and verify security attributes and access control policies to ensure that the access control mechanism meets confidentiality and integrity requirements;
[0009] Step 4: Modify the memory access control mechanism of the ARM architecture to resolve the defects of the ARM memory access control mechanism.
[0010] Furthermore, the atomic security attributes in step 1 describe the most basic attributes of system resources, including identity, type, address, and authority, which are used to perform fine-grained division of system resources.
[0011] Furthermore, the security attributes in step 1 describe the inherent attributes of the entity in the system, describing the system identity of the entity, the attributes of the resources it owns, and the relationship with other entities.
[0012] Furthermore, the security attributes in step one are based on atomic security attributes, the subject attributes are the subject referring to the resource accessor in the system, the object attributes are the object referring to the accessed resources in the system, and the user attributes and resource attributes are both components of the subject attributes and object attributes.
[0013] Furthermore, the resource access request in step 2 refers to a request by a resource accessor to read, write or execute an operation on a resource in the system, and the judgment refers to whether the operation is allowed.
[0014] Furthermore, the access attribute configuration in step 2 sets all access attributes of a resource, and the access attributes are composed of access operations including read, write, and execute, and privilege levels including user mode and privileged mode. The access attribute configuration and subject attributes and object attributes are used together as inputs to the access control policy.
[0015] Furthermore, the defect of the ARM memory access control mechanism in step 4 is that it is insufficient to describe the 16 combinations of read and write permissions of the privileged mode and the user mode for a certain memory space, and cannot independently control the memory read and write permissions of the two.
[0016] Furthermore, the modification made to the memory access mechanism of the ARM architecture in step 4 refers to keeping the execution permission control bit of the page table descriptor unchanged, selecting 4 bits in the reserved bits in the page table descriptor to control the read and write permissions of the privileged mode and user mode, and performing a fine-grained description of the memory read and write permissions of the privileged mode and user mode.
[0017] The beneficial effects of the present invention are as follows:
[0018] The present invention discloses a security attribute-based access control formal verification method for ARM architecture. The method abstracts entities in the system and assigns security attributes to them to achieve flexible and fine-grained system resource management, thereby enhancing resource security protection of the ARM architecture. First, the atomic security attributes of system resources are defined, and based on these atomic security attributes, security attributes are specified for entities in the system. The atomic security attributes defined for system resources help to divide system resources in a fine-grained manner, thereby providing fine-grained protection for them; secondly, an access control policy is defined. The access control policy makes a judgment on whether to allow access to resource access requests generated in trusted execution environments and non-trusted execution environments. It uses subject attributes, object attributes and access attribute configurations as inputs, rather than atomic security attributes, which can simplify the decision logic of the access control policy; then, the security attributes and access control policies are formally described and verified to ensure that the access control mechanism meets the confidentiality and integrity requirements; finally, the access control policy proposed by the present invention is applied to the ARM processor, and 4 bits of the reserved bits in the ARM architecture page table descriptor are selected to control the read and write permissions of the privileged mode and user mode. The effect is that a fine-grained description of the memory read and write permissions of the privileged mode and user mode can be achieved, and the memory isolation protection of the ARM architecture can be enhanced. Experiments have proved the effectiveness of the access control mechanism designed by this scheme and its low performance overhead. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of the access mechanism model formed by the modeling method proposed in the present invention;
[0020] Figure 2 It is a schematic diagram of the atomic security attributes and security attribute structure of the system resources in the present invention;
[0021] Figure 3 This is a comparison chart of the memory access performance overhead of the Memcached Get method in the ARMv8 environment simulated by QEMU;
[0022] Figure 4 This is a comparison chart of the memory access performance overhead of the Memcached Set method in the ARMv8 environment simulated by QEMU. DETAILED DESCRIPTION
[0023] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments, and the purpose and effects of the present invention will become more clear. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0024] Figure 1 This is a schematic diagram of the access mechanism model formed by the modeling method proposed in this invention; this invention first proposes a formal verification method for access control based on security attributes for the ARM architecture, the key of which is to define the atomic security attributes of system resources, and form security attributes on this basis, and then design an access control strategy for access decisions based on security attributes, and finally use formal methods to verify whether the model meets the confidentiality and integrity requirements. Figure 1 As shown in Figure 1, security attributes abstractly specify the characteristics of entities based on physical resources, including user attributes (specifying the identity and attributes of users), resource attributes (specifying the identity and attributes of system resources), subject attributes (identity and attributes of resource accessors), and object attributes (identity and attributes of accessed resources). Both subject attributes and object attributes are composed of user attributes and resource attributes, while configuration attributes specify access operation attributes. With these attributes as parameters, the access control policy provides resource access interfaces for the upper-layer non-trusted execution environment and trusted execution environment and decides whether to allow access.
[0025] Step 1: Define atomic safety properties
[0026] Figure 2It is a schematic diagram of the atomic security attributes and security attribute structure of the system resources in the present invention, wherein the atomic security attributes are represented by a rectangle, and the security attributes based on the atomic security attributes are represented by a rounded rectangle. The atomic security attributes describe the most basic attributes of the resources, such as identity, type, location, permissions, etc. The system identity is an identifier of all resources defined in the present invention to distinguish different resources. "Labels" are used to specify the attributes of the resources in the system, which are composed of the partition to which they belong and the privilege level. The partition to which they belong includes the system identity and location, the former represents the identification of this resource, and the latter describes the location of the partition resource, which can be TEE (trusted execution environment) or REE (non-trusted execution environment). The privilege level describes which privilege level the resource belongs to, including exception level 0, exception level 1 or exception level 2, which represent user applications, operating system kernels and privileged software respectively. The "label" in the resource attribute describes the attributes of the domain where the resource is located, and the resource type and information type represent the types of resources and information respectively. "Access operation" specifies specific resource access operations, including read, write, and execute.
[0027] Step 2: Define security attributes and verify their validity
[0028] Entities in the system form security attributes based on atomic security attributes. Figure 2 As shown in the figure, the user attributes defined in the module "User Attributes" include system identity and tags to specify the user's identity and tag attributes. Both subject attributes and object attributes are bound to user attributes. Subject attributes include user attributes (i.e., resource accessor attributes), the subject's system identity and resource attributes, while resource attributes describe the characteristics of the resources owned by the subject. Similarly, object attributes also include system identity, user attributes and resource attributes, where user attributes describe the attributes of the user or owner of the object resource. In order to specify the access attributes of a resource, "Access Attributes" combines privilege levels and access operations to describe access requests and access operations of specific privilege levels. On this basis, "Access Attribute Configuration" configures all access attributes of a resource, which together with subject attributes and object attributes serve as input to the access control policy.
[0029] The validity of the security attribute needs to be verified. In this embodiment, the valid function is used for verification. The valid function can be defined in two ways: function and definition, depending on whether recursion is required. The valid function ensures that all elements of the input attribute are correctly defined, and it can recursively check all sub-attributes. The valid function example is as follows:
[0030]
[0031]
[0032] The function valid_objattr defines the validity of an object attribute. This function takes the object attribute as an input parameter. The attribute is valid only if and only if the attribute is not empty (i.e. noobjattr) and the object's identification attribute (objattr), user attribute (objattr_user), and resource attribute (objattr_resrcattr) are all valid. These functions are encapsulated in the corresponding modules and provide interfaces to reduce coupling. In other words, each module is transparent to other modules. When a module is modified, other modules can still continue to call these interfaces.
[0033] Step 3: Form an access control strategy
[0034] Access control policies use subject attributes, object attributes, and access attribute configuration as input parameters. These policies consider the partitions and privilege levels of the subject and object resources to make logical judgments. Generally, access operations are divided into read, write, and execute, while privilege levels are divided into user mode and privileged mode. Therefore, access control policies cover 6 scenarios: user mode readable (UR), privileged mode readable (PR), user mode writable (UW), privileged mode writable (PW), user mode executable (UX), privileged mode executable (PX). These policies all use access attribute configuration, subject attributes, and object attributes as parameters. The following takes user mode readable and privileged mode readable as examples.
[0035] User-mode readable definitions:
[0036]
[0037]
[0038] SA.caller = OA user∧
[0039] el=OA.privilege∧el=el0∧
[0040] SA.tag=OA.tag∧(Read,el)∈ACF
[0041] By symbol To indicate that the access operation satisfies the constraints, UR indicates the read operation in user mode. When the subject requesting the read operation is in user mode, the valid function mentioned above is first called to determine the validity of these attributes. validACF, valid SA, and validOA refer to the validity of ACF (access attribute configuration), SA (subject attribute), and OA (object attribute). Secondly, it is necessary to determine whether the caller of the subject (SA.caller) is the user of the object resource (OA user). Since the subject in user mode can essentially only access the object in user mode, the permission level of the object (el) must be el0. In addition, the subject and the object have the same tag to indicate that they have the same partition and privilege level. Finally, the policy determines whether the user mode read operation permission has been assigned in the access attribute configuration, that is, whether (Read,el) is in ACF.
[0042] Privileged mode readable definition:
[0043]
[0044]
[0045] SA.caller=OA.user∧
[0046] elo=OA.privilege∧els=SA.privilege∧
[0047] (els=el1∨els=el2)∧
[0048] ((elo=el0∧SA.partition=OA.partition∧
[0049] (Read,els)∈ACF∧PNU=0)∨
[0050] (elo≠el0∧SA.tag=OA.tag∧(Read,els)∈ACF))
[0051] Similar to user-mode readable, Indicates that the subject satisfies the constraint condition for performing a read operation on the object resource in privileged mode. elo and els are the privilege levels of the object and subject resources, respectively. In addition to verifying the validity of these input attributes (validACF, valid SA, validOA) and the binding relationship between the subject and the object (SA.caller = OA.user), the policy performs logical judgments in two cases: 1) When the object is in user mode, it must be determined whether the subject and the object are in the same partition (SA.partition = OA.partition), and the read operation permission in privileged mode has been granted in the access attribute configuration (ACF), and the privileged mode is allowed to access the resources in user mode (PNU = 0); 2) When the object is not in user mode, the subject and the object have the same tag (tag), and the read operation permission in privileged mode has been granted in the access attribute configuration (Read, els).
[0052] Step 4: Verify that the model meets confidentiality and integrity requirements
[0053] Integrity is defined with reference to the Biba model, which prohibits data from flowing from low-security entities to high-security entities. Confidentiality is defined with reference to the BLP model, which prohibits sensitive data from flowing from high-security entities to low-security entities. These security levels are derived through security attributes.
[0054] The completeness is formally described as follows:
[0055] THEOREM.(Integrity of REAL).
[0056]
[0057]
[0058] Completeness is expressed as Since read and write operations affect the flow of data between the subject and the object, the theorem proves that any read and write operation in the access control policy satisfies the integrity requirement. or ), PNU should be equal to 1, that is, the privileged mode cannot operate on user mode resources.
[0059] Confidentiality is formally described as follows:
[0060] THEOREM.(Confidentiality ofREAL).
[0061]
[0062] Confidentiality is represented by Confidentiality ensures that read and write operations in the access control policy prohibit data from flowing from a high privilege level to a low privilege level. Confidentiality is verified in the same way as integrity. By proving that the access control mechanism satisfies confidentiality and integrity, it can be ensured that the access control mechanism is able to protect the security of system resources.
[0063] The present invention modifies the memory access mechanism of the ARM architecture according to the access control formal verification method proposed in the above steps, and verifies the effect of the new mechanism in the ARMv8 environment simulated by QEMU. The key lies in how to design a suitable tag bit in the ARM page table descriptor and form an access control policy based on the defined tag bit, so that the privileged mode and user mode can flexibly and finely grant or update the access rights to the memory, thereby avoiding the defects of the old mechanism.
[0064] Step 1: Analyze the existing memory access control mechanism of the ARM architecture
[0065] The ARM architecture uses PXN and UXN to control the execution permissions of privileged mode and user mode to memory respectively. For read and write permissions, the PSTATE.PAN bit is used to control the privileged mode to access any memory belonging to user mode, and the AP attribute bit in the page table entry is used to control the read and write permissions of the memory area.
[0066] The definition of AP attribute bits of the ARM architecture is shown in Table 1:
[0067] Table 1 AP attribute bit definition for ARM architecture
[0068]
[0069]
[0070] Since two AP bits are not enough to describe the 16 combinations of memory read and write permissions in privileged mode and user mode, this mechanism has two defects: on the one hand, it cannot describe read and write permissions separately; on the other hand, there is a large correlation between the memory access permissions in privileged mode and user mode, and their memory access permissions cannot be controlled independently.
[0071] Step 2: Add PRN, PWN, URN and UWN attributes
[0072] Select the reserved 4 bits in the ARM page table descriptor, defined as PRN, PWN, URN and UWN, their meanings are shown in Table 2:
[0073] Table 2 Definitions of PRN, PWN, URN, and UWN
[0074]
[0075] The newly added PRN, URN, PWN and UWN and ARM's original PXN and UXN control the read, write and execute permissions of memory pages. The access control mechanism of this solution is more fine-grained than the PAN mechanism, because when PAN is turned on, the privileged mode is prohibited from accessing all memory belonging to the user mode; while the access control mechanism of this solution is based on pages, which can control the access rights of the privileged mode and user mode to a single page. In addition, the access control mechanism of this solution uses enough bits to describe the read and write permissions, which makes up for the lack of AP attribute bits and improves security.
[0076] Step 3: Modify the page table descriptor bit status corresponding to the page access attribute
[0077] The page access attributes correspond to different page table descriptor bit states. When the page access rights change, the relevant bits in the page table descriptor corresponding to the page need to be changed. Since the mechanism of this scheme defines 4 new attribute bits in the page table descriptor, namely PRN, PWN, URN, and UWN, these newly defined bits need to be set accordingly according to the specific read and write permission requirements of the page access attributes. For example, the page access attribute "the page cannot be read, written, or executed" prevents the reading and writing of the page, so the corresponding PRN, PWN, URN, and UWN should all be set to 1.
[0078] Step 4: Change the MMU memory access control mechanism
[0079] When privileged mode or user mode accesses a certain memory area, the MMU (memory management unit) determines whether to allow this memory access based on the permission control bits in the page table descriptor of the memory area. In the original ARM mechanism, the status of AP[2:1] and PSTATE.PAN is used to determine whether to allow memory reading or writing. In the ARM environment simulated by QEMU, this solution modifies the simulated ARM MMU to make judgments based on the four attribute bits newly added in the page table descriptor: PRN, PWN, URN, and UWN, which makes up for the defects of the original mechanism.
[0080] Step 5: Test the ARM memory access performance overhead under the new mechanism
[0081] After modifying the memory access control mechanism in the ARM environment simulated by QEMU, the Memcached application is used to test the memory access performance overhead of the new mechanism in actual scenarios. Memcached uses memory to cache database query results to improve database access efficiency. This method uses the Get and Set methods of Memcached to test the impact of the new mechanism on memory access performance under different data sizes. Figure 3This is a comparison chart of the memory access performance overhead of the Memcached Get method in the ARMv8 environment simulated by QEMU. Figure 4 This is a comparison chart of the memory access performance overhead of the Memcached Set method. In these two figures, the horizontal axis represents the data size involved in a single access, the vertical axis value on the left corresponds to the overhead of the new mechanism represented by the curve compared with the old mechanism, and the vertical axis value on the right represents the throughput. The two ends of the vertical line in the figure are the throughput of the old mechanism and the new mechanism respectively. The solid block indicates that the performance overhead of the new mechanism is greater than the old mechanism, and the hollow block indicates that the performance overhead of the new mechanism is less than the old mechanism. The test results show that the modified new mechanism does not significantly increase the memory access performance overhead compared to the old mechanism.
[0082] Those skilled in the art can understand that the above is only a single example of the invention and is not intended to limit the invention. Although the invention is described in detail with reference to the above examples, those skilled in the art can still modify the technical solutions recorded in the above examples or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, etc. made within the spirit and principle of the invention shall be included in the protection scope of the invention.
Claims
1. A security attribute-based access control formal verification method for ARM architecture, characterized in that: The method comprises the following steps: Step 1: Define the atomic security attributes of system resources, and based on these atomic security attributes, specify security attributes for entities in the system, including subject attributes, object attributes, user attributes, and resource attributes; Step 2: Define access control policies. The access control policies use subject attributes, object attributes, and access attribute configurations as inputs to determine whether access is allowed for resource access requests generated in trusted execution environments and untrusted execution environments. Step 3: Formalize and verify security attributes and access control policies to ensure that the access control mechanism meets confidentiality and integrity requirements; Step 4: Modify the memory access control mechanism of the ARM architecture to solve the defects of the ARM memory access control mechanism; The defect of the ARM memory access control mechanism in step 4 is that it is not sufficient to describe the 16 combinations of privileged mode and user mode read and write permissions for a certain memory space, and cannot independently control the read and write permissions of the two. The modification made to the memory access mechanism of the ARM architecture in the step 4 refers to keeping the execution permission control bit of the page table descriptor unchanged, selecting 4 bits in the reserved bits in the page table descriptor to control the read and write permissions of the privileged mode and user mode, and performing a fine-grained description of the memory read and write permissions of the privileged mode and user mode.
2. The security attribute-based access control formal verification method for ARM architecture according to claim 1 is characterized in that: The atomic security attributes in step 1 are the most basic attributes of system resources, including identity, type, address, and privilege level, and are used to perform fine-grained division of system resources.
3. The security attribute-based access control formal verification method for ARM architecture according to claim 1, characterized in that: The security attributes in step 1 describe the inherent attributes of the entity in the system, describing the system identity of the entity, the attributes of the resources it owns, and the relationship with other entities.
4. The security attribute-based access control formal verification method for ARM architecture according to claim 3 is characterized in that: The security attributes in step one are based on atomic security attributes. The subject attributes refer to the resource accessors in the system, and the object attributes refer to the accessed resources in the system. The user attributes and resource attributes are both components of the subject attributes and object attributes.
5. The security attribute-based access control formal verification method for ARM architecture according to claim 1, 2, 3 or 4, characterized in that: The resource access request in step 2 refers to a request by a resource accessor to read, write or execute an operation on a resource in the system, and the judgment refers to whether the operation is allowed.
6. The security attribute-based access control formal verification method for ARM architecture according to claim 1, characterized in that: The access attribute configuration in step 2 sets all access attributes of a resource. The access attributes are composed of access operations including read, write, and execute, and privilege levels including user mode and privileged mode. The access attribute configuration and subject attributes and object attributes are used together as inputs to the access control policy.
