Method and system for executing security critical applications
By setting up the execution environment on the hardware platform and using the supervisor component to detect control flow transitions, the problem of fault propagation between safety-critical and non-safety-critical applications in hybrid critical systems is solved, enabling the independent operation and correct execution of safety-critical applications.
Patent Information
- Application Number
- CN202380102208.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-24
- Filing Date
- 2023-11-08
- Publication Date
- 2026-04-21
AI Technical Summary
Existing technologies struggle to effectively prevent the propagation of faults between safety-critical and non-safety-critical applications in hybrid critical systems, especially when using open-source operating system kernels such as the Linux kernel, making it difficult to ensure the correct operation and security integrity of safety-critical applications.
By setting up first and second execution environments on the hardware platform and utilizing the regulator component to detect control flow transitions, prohibit or allow resource access, capture and verify status, the independent operation of safety-critical applications is ensured, and fault propagation is avoided.
It achieves isolation between software components with different security levels, ensuring that security-critical applications are free from interference in time and space, ensuring their correct operation, and even enabling secure execution on non-security-qualified operating systems.
Smart Images

Figure CN121909450A_ABST
Abstract
Description
Technical Field
[0001] This invention generally relates to the field of safety-critical applications. More specifically, the invention relates to a method for performing safety-critical applications on a hardware platform including at least one processor core. Furthermore, the invention relates to a computing system configured to perform the steps of such a method, one or more computer programs for instructing the computing system to perform the steps of such a method, and a machine-readable data carrier and / or downloadable product for storing such one or more computer programs. Background Technology
[0002] Safety-critical applications are generally defined or understood as software applications or programs whose failure or malfunction is, at least in principle, likely to cause serious damage or injury, particularly to one or more of machinery, equipment, human health, and environmental health. In other words, failure of a safety-critical application may result in an increased safety risk to people, the machinery used, and / or the environment involved.
[0003] For example, safety-critical applications can run or be executed on so-called safety-critical systems, which may include computing systems running one or more software-based safety-critical applications, as well as more complex systems involving additional components such as one or more sensors, one or more actuators, and / or other hardware components. Exemplary safety-critical systems and corresponding applications for controlling and / or monitoring one or more components can be found in vehicle control systems, power plant control systems, manufacturing or production control systems, chemical plant control systems, building or facility control systems, and many other systems.
[0004] The software used to make the processor's proprietary features accessible to a hardware platform or computing system is typically encapsulated in a dedicated program called the operating system kernel (also referred to herein as the OS kernel or kernel). Generally, the kernel, OS kernel, and / or system kernel referred to herein can be considered a supervisor program, which may have an elevated level of privilege compared to other software components, programs, or software executing on top of the kernel. The correctness of the hardware features used may require the operating system kernel to operate correctly on the hardware. Therefore, the correct operation of safety-critical applications may depend on or be dependent on the correct operation of the operating system kernel software. Furthermore, this dependency can involve not only the software unit or kernel software operating the hardware features under consideration, but also all software code that may potentially affect the software unit under consideration, such as the entire OS kernel. In the presence of support for a single safety-related function that should be ensured by executing safety-critical applications, this leads to the common understanding that the operating system kernel as a whole should be qualified for use in a safety context or should be monitored.
[0005] Various standards and recommendations have been defined for safety-critical applications and systems to ensure their correct or proper operation. Typically, such standards or recommendations are related to specific use cases and / or the equipment involved. For example, ISO standard 26262, recommended by the International Organization for Standardization (ISO), relates to safety-critical or safety-related systems, including electrical and / or electronic systems installed in passenger cars or road vehicles. These standards and recommendations provide a set of guidelines and / or safety measures that safety-critical applications and corresponding systems should meet to ensure their proper operation. Safety-critical applications or systems that conform to standards or recommendations may also be referred to as safety-qualified applications or systems. In other aspects, software applications or computing systems that do not conform to such standards (e.g., because they handle processes or functions that are not safety-critical or related) may be referred to herein as non-safety-critical applications.
[0006] Security qualification is challenging and expensive for open-source software with a distributed and unspecified software development model. However, when it comes to open-source monolithic operating system kernels like the Linux kernel (consisting of millions of lines of code), qualification in the sense of the ISO 26262 standard may become practically impractical, as security qualification will typically require the entire software stack to meet the same integrity level, or Security Integrity Level (SIL), requirements as those for safety-critical applications. The term “Security Integrity Level” or “integrity level” (also referred to herein as “security level”) can be defined as a discrete level of risk reduction provided by security instrumentation functions or safety-critical applications. To date, there are no available methods or technical solutions demonstrating that the Linux kernel, Linux-based kernels, or similar non-proprietary kernel software and their modules meet any Security Integrity Level.
[0007] In many software applications and corresponding computing systems or environments, safety-critical applications can run or execute in parallel, sequentially, or alternately with non-safety-critical applications, or more generally, they can coexist with applications that do not meet the safety level required for safety-critical applications. Alternatively or additionally, safety-critical applications can execute on an OS or OS kernel that is not safety-qualified. Such systems are often referred to as hybrid critical systems or hybrid critical software systems. A hybrid critical system can be a complex software-based system in which software applications or software components (including OS software, such as the OS kernel) with different criticalities can run on common hardware (e.g., one or more common processors), and the different applications come from different quality or safety levels, including at least one safety-critical application. This means that not all applications in a hybrid critical system comply with the quality assurance measures required or recommended by standards such as ISO 26262 and the highest safety level that any application should meet.
[0008] To ensure the proper functioning of one or more safety-critical applications in such hybrid critical systems, it is essential to protect against interference between software components with different quality and / or safety levels associated with them. This protection is typically achieved by ensuring protection against the propagation of faults across software components with different safety levels in both time and space (and / or data).
[0009] For example, in order to execute security-related applications using a non-security-related operating system kernel, mitigation mechanisms should be implemented, for example, at the execution environment (especially a non-privileged execution environment) and / or at the system level for the corresponding hardware platform or computing system (such as, for example, an electrical / electronic / programmable electronic system or device (E / E / PE system or device)). Exemplary mitigation strategies and / or corresponding mechanisms are (a) diversified coded processing or (b) self-checking pairs. Both methods execute the program code twice and do have a comparator that accepts the output once the outputs are the same (e.g., per bit or a predefined degree). (a) typically involves copying the program code and then executing it on the same operating system, and (b) copying the electronic control unit and its software stack, and even parts of its construction toolchain if required for technical analysis.
[0010] The aforementioned solutions may come with additional constraints and requirements. For example, coded processing often involves limitations on the code and a need for a specific compiler. For instance, if a variety of compilers for embedded devices cannot be found or used, arguing for the independence of the components building the self-test pair may be difficult. Generally, both approaches may require avoiding common-cause failures. Summary of the Invention
[0011] Therefore, it may be desirable to provide an improved method and computing system for performing safety-critical applications, which overcomes or at least mitigates the aforementioned drawbacks of conventional systems.
[0012] This is achieved through the subject matter of the independent claims, wherein further embodiments are included in the dependent claims and the description below.
[0013] Various aspects of this disclosure relate to a method for performing a safety-critical application on a hardware platform, a computing system configured to perform the steps of such a method, one or more computer programs for instructing the computing system to perform the steps of such a method, and a machine-readable data carrier and / or downloadable product for storing such one or more computer programs. It should be emphasized that any features, functions, elements, and advantages described herein with reference to one aspect of this disclosure are equally applicable to any other aspect of this disclosure described herein.
[0014] According to one aspect of this disclosure, a method is provided for executing a security-critical application on a hardware platform including at least one processor core. The method includes the following steps: • Execute the security-critical application in the primary execution environment on this hardware platform; • The regulator component for this safety-critical application is executed in a second execution environment on the hardware platform; • The regulator component detects at least the transition of control flow between the safety-critical application and other software running in the first execution environment; and: • In response to detecting that the control flow is transitioning from the safety-critical application to the other software, the monitor component prohibits at least one access mode to at least one resource used by the safety-critical application and / or captures the status of at least one resource used by the safety-critical application. • In response to the detection that the control flow is switching back from the other software to the safety-critical application, allow (e.g., re-)access to the at least one resource and / or verify whether the state of the at least one resource conforms to the previously captured state, and report a failure if the state does not conform.
[0015] The features and steps of the aforementioned methods interact synergistically to provide comprehensive mitigation measures to ensure safety-critical systems (such as the hardware platforms and / or computing systems described herein) are protected from fault propagation. Specifically, the computer-implemented methods and computing systems described herein can provide mitigation measures or means to ensure protection against fault propagation from any guest operating system (OS), kernel software or portions thereof, the OS kernel and / or any other non-security-qualified process to safety-critical applications. Furthermore, these methods and systems overcome the limitations associated with conventional mitigation measures based on redundancy and / or resource replication, as described under items (a) and (b) in the Background section.
[0016] Therefore, the methods and computing systems described herein can ensure or allow the secure execution of safety-critical applications on a hardware platform (e.g., on any guest OS), which includes, for example, any guest OS kernel, kernel software, or kernel components, and optionally one or more non-safety-critical applications. In other words, the features and steps of the foregoing methods can interact synergistically to ensure that safety-critical applications are free from interference (FFI) in one or both spatial and temporal aspects, and / or reliably detect any interference. Specifically, the methods of this disclosure can allow the secure execution of safety-critical applications without requiring the software components of the guest OS (such as the entire guest OS kernel) to be security-qualified. Furthermore, this can allow the secure execution of safety-critical applications on a variety of different hardware platforms, where the hardware and software components may not be security-qualified. It should be emphasized that the methods and computing systems according to this disclosure can be advantageously used with security-qualified systems and / or hybrid critical systems. Therefore, this disclosure is not limited to this aspect. Moreover, the invention can be advantageously used in conjunction with any kernel, including both security-qualified and non-security-qualified kernels, such as, for example, Linux-based kernels.
[0017] As used herein, the term "application" may refer to or include software applications or programs. As used herein, the term "application" is not necessarily limited to purely software applications, but may include software-based applications that may optionally include one or more interfaces for receiving sensor signals from one or more sensors and / or for sending one or more control signals (control signals are used interchangeably with actuation signals herein) to one or more actuators and / or other hardware components.
[0018] To improve readability without loss of generality, this document may describe detailed specific technical implementations. Specifically, this disclosure refers to an operating system architecture with a kernel. However, as stated above, the kernel, OS kernel, and / or system kernel referred to herein can be considered a supervisor program that may have an elevated level of privilege compared to other software components, programs, or software executing on top of the kernel. Therefore, it will be understood by those skilled in the art that the general concepts described herein can be applied to various architectures, provided that the exception levels and / or privilege levels mentioned in this disclosure can be utilized.
[0019] As stated above, the term "safety-critical application" is generally understood to be a software (software-based) application or program whose failure or malfunction is, at least in principle, likely to cause damage or injury, particularly to one or more of machinery, equipment, human health, and environmental health. On the other hand, a safety-related application or system can be defined or understood to include aspects not controlled by the corresponding safety-critical application or system, such as personnel operating the application or system. Because this disclosure focuses on aspects related to software-based safety-critical applications and / or corresponding computing systems, the terms "safety-critical application or system" and "safety-related application or system" may be used interchangeably or synonymously herein. In other words, in the context of this disclosure, the term "safety-critical" may include or refer to "safety-related," and vice versa.
[0020] In various instances, this disclosure may refer to a processor, which can typically be implemented as a single-core or multi-core central processing unit (CPU) having one or more cores or processor cores, which can be used to run an operating system. However, this disclosure is not limited to this aspect, but can also be applied, for example, to multiprocessor hardware with shared memory. Therefore, the terms "processor," "processor core," and "core" may be used synonymously herein.
[0021] As used herein, a hardware platform may refer to or include a data processing platform or processing circuitry, which may include or refer to, for example, a CPU having one or more processor cores for data processing, or it may refer to a multiprocessor architecture. Any reference to a single processor or processor core may include references to multiple processors or processor cores. Furthermore, this disclosure is not limited to a particular processor architecture but can be applied to processors of any type or architecture, such as ARM, x86, RISC, etc., including shared-memory multiprocessor architectures.
[0022] A hardware platform may include optional components and / or provide optional hardware resources for data processing, such as physical memory (e.g., random access memory), cache memory, and / or other components. A hardware platform may be implemented in, and / or may be part of, the computing system described herein. Therefore, the terms "hardware platform" and "computing system" are used interchangeably or synonymously herein.
[0023] As used herein, an execution environment can refer to or include a computing environment with associated configurations and / or specifications in terms of hardware and / or software resources, which can be configured to perform one or more computing tasks or functions. Different execution environments can be at least partially isolated or separated from each other in terms of (virtual and / or physical) hardware and their software components. Optionally, different execution environments can be communicatively and / or operatively coupled to each other and / or to other software components in the computing system, for example, based on corresponding interfaces implemented in the software and / or hardware. Further optionally, different execution environments can share one or more computing resources, which are also referred to herein as resources and can include physical and / or virtual hardware resources as well as software resources.
[0024] In an exemplary and non-limiting implementation, different execution environments can be implemented within a virtual computing environment that provides one or more virtual machines for one or more execution environments. Therefore, different execution environments can be provided either within the same virtual machine or within different virtual machines that each provide a specific execution environment. For example, at least one or both of a first execution environment and a second execution environment can be executed or provided within at least one virtual machine.
[0025] Typically, different execution environments can have the same privilege level or different privilege levels relative to the overall computing system or hardware platform. As is generally understood, different privilege levels can define different sets of permissions or actions that are allowed to be performed by the corresponding components, where a higher privilege level includes more permissions compared to a lower privilege level.
[0026] The first and second execution environments can refer to or represent different execution environments that may differ in their configuration and / or specifications. Specifically, the first and second execution environments can represent independent computing environments with at least partially different hardware and / or software resources associated with them. The first and second execution environments can be at least partially isolated from each other, thereby allowing one or more software components or programs, such as a safety-critical application in the first execution environment and a regulator component in the second execution environment, to run or execute independently.
[0027] Optionally, at least one execution environment can be provided as a virtual machine within a virtualization environment of the hardware platform. For example, the first and / or second execution environments can be provided by the first and / or second virtual machines, in which security-critical applications and supervisory components can be executed, respectively. Optionally, one or more additional software components can be executed or run in the first and / or second execution environments (e.g., in user space), and / or, for example, as a guest operating system or OS kernel in one or more virtual machines.
[0028] In at least the first execution environment, “other software” is executed or run. As used herein, “other software” may refer to or include any software code, program, and / or application executing in the first execution environment, such as, for example, another process executing in user space, a guest OS, and / or a guest OS kernel. “Other software” may be security-qualified or security-unqualified. Optionally, other software may also be executed or run in a second execution environment and / or additional execution environments.
[0029] It should be noted that this disclosure is not limited to two execution environments, but rather any number of execution environments can be utilized. For example, unsecured and secure processes or applications can be executed in multiple different execution environments, for example, to provide secure and unsecured execution environments that are separate from each other. Alternatively, a hybrid critical execution environment can be used, in which both secure and unsecured software or applications can be executed.
[0030] A monitor component can generally refer to or represent monitor software or monitoring components configured to monitor the execution of an execution environment and / or safety-critical applications within that environment. In other words, the term "monitor component" can refer to a software component capable of implementing error detection and / or error indication. While this definition may correspond to the established understanding in security engineering, it can deviate from the understanding of the term "monitor software" in the context of an operating system as a component or program used to control or schedule processes and other programs.
[0031] A monitor component may refer to or represent monitor software or monitoring components configured to monitor the execution of a first execution environment and / or a safety-critical application within that first execution environment. The monitor component may be configured to monitor, determine, and / or validate the secure execution of a safety-critical application, for example, based on processing information or data related to the execution of the safety-critical application within the first execution environment. Such information or data may be retrieved from and / or received from the first execution environment. Alternatively or additionally, such information or data may be provided by a higher-level or intermediate component of the hardware platform (e.g., a hypervisor or hypervisor component).
[0032] Control flow typically refers to the control flow of one or more processors and / or processor cores, which may refer to the order in which individual statements, instructions, and function calls of one or more software components or applications are executed and / or evaluated by at least one processor and / or processor core of a hardware platform.
[0033] The monitor component can be configured to detect transitions between safety-critical applications and other software based on analysis of control flow or associated data. Such transitions, also known as context switches or context transfers, refer to the process of storing the state of processes, programs, threads, and / or applications, allowing that state to be restored and execution resumed at a later point in time. By detecting context switches with the monitor component, the monitor component can ensure that safety-critical applications are not erroneously compromised, or at least not compromised without being detected by the monitor component. The monitor component can then optionally allow the triggering or execution of one or more countermeasures, which may also be referred to herein as handlers (used synonymously with handler components) and / or function blocks.
[0034] As used herein, context switching between safety-critical applications and other software (e.g., a guest OS or program running in user space) may include context switching or control flow transitions from safety-critical applications to other software, and / or context switching from other software to safety-critical applications.
[0035] The monitor component can be configured to detect whether a transition is occurring from a safety-critical application to other software or vice versa. Therefore, the monitor component can be configured to detect the type or direction of the control flow transition. Depending on the detected type or direction of the control flow transition, the monitor component can be configured to perform or trigger different tasks.
[0036] For example, in response to detecting that control flow is shifting from a safety-critical application to other software, a regulator component can be configured to deny at least one access mode to at least one resource used by the safety-critical application. Denying at least one access mode may include modifying and / or changing at least one access mode and / or the access permission used to access at least one resource.
[0037] Different access modes or access permissions may be associated with: a read permission to read from at least one resource, a write permission to write to at least one resource, and an execute permission to execute code in at least one resource. Here, a resource may refer to or include hardware-based and / or software-based resources. Specifically, at least one resource may refer to or include physical and / or virtual hardware resources, such as memory, processor registers (also known as process registers), memory registers, and / or computing power.
[0038] As an alternative or supplement to disabling at least one access mode in response to the detection that control flow is shifting from a safety-critical application to other software, the monitor component can be configured to capture the state of at least one resource used by the safety-critical application. This may include storing the resource's state information in memory or other data storage, which can be loaded at a later time to resume execution. For example, one or more of the following may be captured: the content, data content, state, processor registers, memory registers, and configuration of at least one resource.
[0039] Alternatively or additionally, in response to detecting that control flow is switching back from other software to a safety-critical application, the monitor component may be configured to allow (e.g., re-)access to at least one resource. Alternatively or additionally, the monitor component may be configured to verify and / or confirm whether the state of at least one resource conforms to a previously captured state, and report a fault if the state does not conform. Here, conformity may mean that the states are the same, match each other, or correspond to each other. Reporting a fault may include providing a corresponding fault or error signal, such as indicating a different or non-conforming state before and after a context switch. Alternatively, the provision of health or heartbeat signals to indicate a fault may be terminated and / or stopped.
[0040] During context switching in the first execution environment, the aforementioned measures of the regulator component ensure that any failures that could potentially affect the execution of safety-critical applications can be avoided or at least detected, for example, enabling mitigation of the failure after an erroneous context switch. These measures may include, for example, failure passivation and / or indication. Therefore, the secure execution of safety-critical applications can be ensured.
[0041] According to the implementation scheme, at least one resource includes memory pages used, allocated to, and / or accessed by a safety-critical application. Alternatively or additionally, prohibiting access to these memory pages and / or prohibiting at least one access mode to these memory pages includes prohibiting writes to these memory pages. In other words, memory pages can be marked as and / or set to be non-writable. Therefore, at least one access mode prohibited by the regulator component can be associated with write access to memory pages (or generally, memory) used or accessed by a safety-critical application. Thus, upon detecting a context switch or control flow transition from a safety-critical application to other software, write access to memory pages used by the safety-critical application can be prevented, thereby ensuring that the contents of the memory pages cannot be modified by other software during the context switch. Optionally, other access modes, such as read access to memory pages and / or code execution, can be permitted.
[0042] According to the implementation scheme, prohibiting access to memory pages used by safety-critical applications includes prohibiting writing to these memory pages and prohibiting the execution of code within these memory pages. In other words, the monitor component can be configured to prohibit at least two access modes when a shift in control flow from a safety-critical application to other software is detected. These at least two modes include prohibiting write access and prohibiting the execution of code within memory pages used or accessed by the safety-critical application. Alternatively or additionally, memory pages can be marked and / or set to be non-writable and non-executable. Therefore, any changes or modifications to memory pages that could affect the execution of the safety-critical application and / or data associated with the safety-critical application can be reliably avoided or prevented.
[0043] According to the implementation scheme, prohibiting or allowing access to memory pages includes modifying the Phase 2 page table tree (PTT) maintained by and residing outside the first execution environment. In other words, one or more access modes can be changed and / or modified in a Phase 2 PTT maintained outside the first execution environment (e.g., maintained by a supervisor component and / or other components such as a hypervisor running on at least one processor and / or processor core). Modifying and / or changing access to one or more page tables and / or page table trees can, for example, involve applying appropriate settings in one or more phases and / or PTTs of one or more page tables, page table trees, or page tables. This ensures proper isolation and protection of hardware resources from interference.
[0044] Typically, a page table refers to a data structure used by the virtual memory system in a computer operating system to store the mapping between virtual memory addresses and the physical memory of the hardware platform, for example, stored in the form of page tables and / or page table trees with one or more page table entries. Optionally, the page table may store, or be associated with, permission settings and / or other settings regarding memory access. Page tables may also be arranged or structured hierarchically as multi-level or multi-stage page table trees, for example, including at least a stage 1 page table tree PTT (also known as level 1 page tables) and a stage 2 PTT (also known as level 2 page tables). In a multi-level page table, page table entries in a level 1 page table may be pointers to level 2 page tables (trees), and entries in a level 2 page table (tree) may be pointers to level 3 page tables (trees), and so on. The entries in the last level of the page table (tree) store the actual frame information of the memory, and the level 1 page table (tree) typically contains single-page tables, the addresses of which are typically stored in the page table base address register PTBR. In the case of modern ARM-based processors, the pointer to the PTT can be stored in translation table base registers 0 and / or 1 (referred to as TTBR0 and TTBR1). However, as stated above, this disclosure is not limited to any particular processor architecture.
[0045] Therefore, by modifying the Phase 2 PTT when switching from a safety-critical application to other software, memory or memory pages used by the other software can be defined differently from those used by the safety-critical application. This reliably ensures that other software cannot write to memory or memory pages used by the safety-critical application. Alternatively or additionally, when switching from other software to a safety-critical application, the Phase 2 PTT can be modified so that the safety-critical application can access the memory or memory pages it used before the context switch and resume its execution. Therefore, modifying the Phase 2 PTT during a context switch provides an effective means of memory isolation and ensures the secure execution of the safety-critical application.
[0046] It should be noted that, in addition to or replacing stage 2 PTT, other stages of PTT can also be modified or changed during context switching. Specifically, the final stage of PTT can be modified.
[0047] In the example, different settings for the Phase 2 PTT can be implemented or configured in different software objects, wherein a first object in such objects can be loaded or activated when the safety-critical application is active on the processor core, and a second object in such objects can be loaded or activated when other software is active on the processor core. The first software object may include applying the Phase 2 PTT such that the safety-critical application can (and optionally, other software cannot) read, write, and / or execute code in its memory or memory pages, while the second software object may include applying the Phase 2 PTT such that one or more of the following are prohibited from other software, and optionally also from the safety-critical application or any other software: reading from the memory or memory pages allocated to the safety-critical application, writing to the memory or memory pages, and executing code in the memory or memory pages.
[0048] According to the implementation scheme, at least one resource includes at least one processor register and / or one or more memory pages, which may optionally be maintained by one or more PTTs. Therefore, in response to detecting a control flow transition from a safety-critical application to other software, the supervisor component may prohibit at least one access mode of at least one processor register and / or one or more memory pages, such as one or more of write access, read access, and code execution permissions. Alternatively or additionally, in response to detecting a control flow transition back from other software to the safety-critical application, the supervisor component may allow the safety-critical application access to the processor register and / or one or more memory pages, for example, to resume execution. This allows for the reliable and secure storage and recovery of the state of the safety-critical application in the event of a context switch.
[0049] According to the implementation scheme, detecting a control flow transition includes the supervisor component instruction processor core: in response to receiving an instruction to perform an action associated with and / or related to the control flow transition, redirecting the control flow to a handler in the supervisor component. This redirection of the control flow may include directing and / or providing the control flow to a handler in the supervisor component.
[0050] A handler may refer to a software component including routines that may be specifically associated with or related to one or more predefined actions and / or events that are linked to or related to a transition in control flow, and may be configured to trigger a predefined response or action in response to the occurrence of said one or more actions and / or events. Therefore, once one or more actions and / or events occur during a context switch, the handler can specify a particular response or subsequent action or step to trigger.
[0051] It should be noted that a handler can be responsible for a single action or multiple actions and / or associated with a single action or multiple actions. Therefore, the regulator component can maintain or include one or more handlers associated with one or more actions. Furthermore, step-by-step, phased, or hierarchical handling can be implemented, which may include or involve multiple handlers, where the output of one handler (e.g., a first handler or a common handler) can be provided as input to other handlers.
[0052] As used herein, instructions that perform actions associated with and / or related to transitions in control flow will be interpreted broadly. Such instructions may be based on, or implemented using, a variety of possible mechanisms. Examples of such mechanisms include exceptions or traps triggered by a breach of access to at least one resource by any software process other than a security-critical application, and special calls or hypervisor calls provided by the hypervisor when a context switch is detected.
[0053] For example, one or more traps can be configured on the processor and / or processor core to redirect control flow to the appropriate handler and / or hypervisor in the supervisor component. In other words, a trap at least on the processor core (also known as a hardware root trap or hardware-assisted trap) can be used to trap control flow and / or redirect control flow to one or more of the hypervisor, supervisor component, and / or appropriate handler. Alternatively or additionally, one or more traps can be configured on the kernel to redirect control flow. Typically, a trap can be considered a condition or criterion that triggers an exception when met, which can be detected to take further action. In other words, a trap and / or its corresponding exception can cause control flow to transfer to the supervisor component and / or appropriate handler. Therefore, traps can provide a reliable tool for detecting context switches between security-critical applications and the guest OS.
[0054] Optionally, capturing and / or redirecting control flow may include triggering and / or accompanying the exit of a first execution environment (e.g., a virtual machine providing the first execution environment), which may be detected by a hypervisor and / or regulator component, for example, based on a corresponding exit signal or status code of the first execution environment. The exit of the first execution environment, its corresponding exception, and / or trap may allow the invocation of associated functions of one or more hypervisors, regulator components, and / or corresponding handlers.
[0055] In an exemplary implementation, trapping and / or redirecting of control flow can be triggered by applying appropriate settings in a page table tree (e.g., a stage 2 page table tree (PTT)), optionally maintained by the hypervisor and / or a supervisor component of the first execution environment used to run security-critical applications. Alternatively or additionally, traps can be generated at least partially programmatically, for example via a hypervisor call (HVC), and / or whenever other software (e.g., a guest OS, a process in user space (e.g., performing a system call), and / or the guest OS kernel) attempts to rewrite the contents of specific core registers of the processor (also called processor or process registers) and / or memory pages (virtual and / or physical memory pages) that should be protected. An example of such memory pages is a stage 2 memory management unit (MMU-protected) memory page.
[0056] According to the implementation scheme, the execution of a safety-critical application includes the verification, determination, and / or validation of one or more of the following: The integrity of at least a portion of the binary file containing the machine-readable instructions of the safety-critical application. This ensures that the binary file information and / or data has not been corrupted during context switching. Alternatively or additionally, it can be determined whether memory elements in the page table tree (PTT) used by the safety-critical application have the expected size and / or are located at the expected location. This ensures the integrity of the paging tree and / or memory or memory pages used by the safety-critical application. Alternatively or additionally, it can be verified whether memory pages used by the safety-critical application conflict with the address spaces and / or memory pages of other software (such as, for example, non-safety-critical applications, guest OS, and / or guest OS kernel). One or more of the foregoing measures for ensuring the secure execution of the safety-critical application can be performed by a supervisor component, one or more handlers of the supervisor component, and / or another component (such as, for example, a hypervisor). Furthermore, if any of the foregoing verifications fails, a failure can be reported. Therefore, it is possible to reliably detect whether a safety-critical application is malfunctioning and, for example, to take countermeasures, or, in the absence of any malfunction, to confidently confirm safe operation. Alternatively or additionally, incorrect operation can also be signaled, for example, by providing indicator signals.
[0057] According to the implementation scheme, the method further includes the supervisor component instructing the processor and / or processor core to: redirect the control flow from the first execution environment to the supervisor component if any event necessitates a shift of control flow from the first execution environment to the supervisor component; distribute the event to individual handler components within the supervisor component according to a predetermined set of rules; determine whether the event is expected or unexpected during normal operation by each individual handler component; and if the event is expected during normal operation, execute a predetermined handling operation associated with the event, and if the event is unexpected, report a fault. Therefore, in an exemplary implementation, a handler chain including a common handler and one or more individual handlers can be utilized, for example, each individual handler is associated with an individual event at the time of a context switch. However, it should be noted that the characteristics and functions of the common handler and individual handlers can be combined in a single handler component or handler.
[0058] According to the implementation scheme, the method further includes: in response to a system call (also known as a syscall) to the operating system in the first execution environment initiated by a safety-critical application, checking whether the system call is on a list of permitted system calls, and if the system call is on the list, executing the system call, and if the system call is not on the list, reporting a fault. Thus, the OS or guest OS may execute in the first execution environment (e.g., in a first virtual machine), and the safety-critical application may execute system calls to the OS and / or its kernel software, which may trigger or cause the regulator component to check whether the system call can be permitted. Therefore, system calls that potentially affect or disrupt the state of the safety-critical application can be prohibited or suppressed, or at least the execution of such system calls can be reported, allowing the regulator component to perform countermeasures or monitoring functions to ensure the safe execution of the safety-critical application. On the other hand, if the system call is whitelisted (which may mean that all handlers are in place to ensure the safety-critical application is protected from disruption), such system calls can be permitted without reporting.
[0059] The terms "system call" or "system call instruction" generally refer to instructions for actions to be performed by the kernel and / or functions to be provided by the kernel, which may result in control flow redirection and privilege transitions between software components at different privilege levels. For example, one or more resources and / or data of a hardware platform may be requested by a safety-critical application during its execution, and one or more corresponding system calls may be initiated by the safety-critical application requesting the kernel to provide one or more resources and / or data. Exemplary and non-limiting system calls can include reading data from user space, writing data to user space, modifying the processes of one or more applications, adding a process or application, removing a process or application, invoking or executing one or more other processes or applications, and combinations thereof.
[0060] According to the implementation scheme, the method further includes: the operating system invoking HVC via the hypervisor to notify the regulator component of the expected action, with the safety-critical application running on top of the operating system in the first execution environment. As mentioned above, other mechanisms may be based on capture, such as hardware root capture and / or capture at the software level, such as on the safety-critical application itself, on the guest OS, on another process in user space, and / or on the guest OS kernel.
[0061] According to the implementation plan, anticipated actions include starting a process and / or allocating memory pages to the process, or both. Specifically, when a new process is created, for example, by a guest OS that may include other safety-critical or non-safety-critical applications, the state, memory, and / or data of the safety-critical application may be corrupted, for example, due to the allocation of memory pages to the process that may interfere with the safety-critical application. Therefore, notifying the supervisory component can, for example, allow appropriate preparatory steps, monitoring functions, protective measures, and / or countermeasures to be taken.
[0062] According to the implementation scheme, the first execution environment is a virtual machine instantiated by a hypervisor running at a higher privilege level than the virtual machine. In other words, the hardware platform or computing system may include a hypervisor for controlling a virtualized environment, which includes at least one virtual machine providing the first execution environment, in which security-critical applications are executed, for example, on a guest OS and / or a guest OS kernel. By executing security-critical applications on a guest OS within a virtual machine instantiated by a hypervisor with a higher privilege level, the hypervisor can take over control of the control flow and redirect the control flow to a supervisor component and / or one or more of its handlers. In an alternative implementation, the supervisor component may be part of the hypervisor.
[0063] In an exemplary implementation, the hypervisor includes a watchdog configured to periodically trigger a heartbeat signal indicating normal operation of a safety-critical application. In other words, the safety-critical application can indicate its health and / or health status to the hypervisor's watchdog. The watchdog can be a software-based health monitor used to monitor the health of the safety-critical application. Alternatively or additionally, the monitor component can also indicate normal operation of the monitor component and / or the safety-critical application to the hypervisor by supplying one or more heartbeat signals to the hypervisor.
[0064] In response to the termination of a heartbeat signal, the hypervisor can determine that one or more of the safety-critical application and monitor components are faulty, and may optionally initiate remedial actions to restore the operational state of the safety-critical application and / or monitor components. For example, heartbeat signals can be provided in a predefined sequence and / or at predefined time intervals. Upon determining that a heartbeat signal from one or both of the safety-critical application and monitor components is missing during a predetermined time period, the hypervisor can detect a fault in one or more of these components.
[0065] According to the implementation scheme, one or both of the monitor component and the safety-critical application may include a canary component configured to provide a heartbeat signal to the hypervisor's watchdog or health monitor. Such a canary component can be implemented in software to provide heartbeat signals at predefined intervals. The canary component of the monitor component and / or the canary component of the safety-critical application can be configured to receive health indications and / or reported failures from the safety-critical application and / or the monitor component. In response to receiving a poor health indication and / or reported failure, the canary component of the monitor component and / or the safety-critical application can terminate providing heartbeat signals, thereby notifying the hypervisor's watchdog of the poor health indication and / or reported failure.
[0066] According to the implementation scheme, the method further includes: processing measurement data acquired by at least one sensor into an actuation signal or control signal by a safety-critical application, and actuating at least one land vehicle, air vehicle, or sea vehicle, at least one robot, and / or any component thereof with the actuation signal. In other words, based on measurement or sensor data from one or more sensors, the safety-critical application can determine an actuation signal to actuate at least one component of a land vehicle, air vehicle, or sea vehicle and / or at least one robot, which can be any type of robotic device. For example, the output of the safety-critical application may include an actuation signal that can actuate one or more display components in the vehicle.
[0067] Another aspect of this disclosure relates to a computing system comprising a hardware platform having one or more processors and / or processor cores, and (physical and / or virtual) memory for data storage. The computing system is configured to perform the steps of the methods described above and below. It should be emphasized that any step, feature, function, and / or element described herein with reference to the method can be a feature, function, and / or element of the computing system, and vice versa.
[0068] Another aspect of this disclosure relates to one or more computer programs including machine-readable instructions that, when executed by a computing system, cause the computing system to perform the steps of the methods described above and below, and / or cause the computing system to perform the roles of a supervisor component and / or a hypervisor in the context of the methods described above and below.
[0069] Another aspect of this disclosure relates to a non-transitory machine-readable data carrier and / or download product having and / or storing one or more computer programs including machine-readable instructions that, when executed by a computing system, cause the computing system to perform the steps of the methods described above and below, and / or cause the computing system to perform the role of a monitoring component in the context of the methods described above and below. Attached Figure Description
[0070] These and other aspects of the invention will become apparent and further elucidated by referring to the embodiments described by way of example in the following description and by referring to the accompanying drawings, in which... Figure 1 A flowchart illustrating an exemplary computer implementation of a method for performing a security-critical application on a hardware platform is shown; Figure 2 A block diagram illustrating an exemplary hardware platform and method for performing security-critical applications is shown; Figure 3 Block diagrams illustrating exemplary hardware platforms and methods for performing safety-critical applications are shown; and Figure 4 A block diagram of a regulator component for performing an exemplary hardware platform and method for safety-critical applications is shown.
[0071] In the accompanying drawings, elements corresponding to those already described may have the same reference numerals. Examples, embodiments, or optional features, whether or not indicated as non-limiting, should not be construed as limiting the claimed invention. Detailed Implementation
[0072] Figure 1 Examples are shown on hardware platforms (e.g., reference). Figure 2A flowchart illustrating an exemplary computer implementation of a method for executing a safety-critical application on a hardware platform 100.
[0073] Figure 2 A block diagram illustrating an exemplary hardware platform 100, computing system 500, and method for performing a safety-critical application 130 is shown. References are made, mutually or jointly, below. Figure 1 and Figure 2 .
[0074] like Figure 2 As shown, the hardware platform 100 includes a processing circuit 110 having two processor cores 112a and 112b, which can represent a CPU 110 and / or a processor 110. The hardware platform 100 may include a single processor 112a or more than two processor cores 112a and 112b.
[0075] The hardware platform 100 also includes physical data storage 114 or memory 114. Memory 114 can be any type of hardware-based memory 114, such as random access memory or other types, which can be used as a computing resource or resource by the processing circuitry 110.
[0076] Hardware platform 100 may be embodied in and / or be part of computing system 500, which may include optional other components 520, 540, such as one or more communication interfaces 520 and / or one or more other data storage 540. One or more other components or entities may be communicatively and / or operatively coupled to computing system 500, and correspondingly, to hardware platform 100, via one or more communication interfaces 520. For example, one or more sensors 522 may be coupled to one or more communication interfaces 520 to provide sensor signals. Alternatively or additionally, one or more actuators 524 may be coupled to one or more communication interfaces 520, for example, to receive one or more control or actuation signals from computing system 500 and / or hardware platform 100.
[0077] Hardware platform 100 also includes a first execution environment 120, in which at least one security-critical application 130 is executed and / or runs. The first execution environment 120 may, for example, be embodied as a virtual machine 120 of hardware platform 100. The security-critical application 130 may be executed on top of a guest operating system and / or a guest OS kernel of a guest OS. Optionally, one or more additional security-critical applications 130 may be executed in the first execution environment 120 or another execution environment of hardware platform 100. Further optionally, one or more non-security-critical applications may be executed in the first execution environment (e.g., in the user space of a guest OS and / or one or more other execution environments). Any software other than the security-critical application 130 that may run in the first execution environment 120 is... Figure 2 As indicated by reference numeral 125 in the accompanying drawings, it may include a guest OS, a guest OS kernel, one or more non-security-critical applications and / or one or more additional security-critical applications.
[0078] Hardware platform 100 also includes a second execution environment 140, such as a second virtual machine 140, in which a supervisor component 150 for at least one security-critical application 130 in the first execution environment 120 executes. The second execution environment 140 may have its own memory and data storage and may execute on top of a separate operating system and / or kernel. Supervisor component 150 may include one or more handlers 152 for performing specific tasks or functions, as described above and below, and for example in… Figure 4 It is referred to as function block 155-161.
[0079] Guest OS 125 and / or Guest OS kernel 125 may be, for example, a Linux-based kernel. However, any other kernel software may be used for the Guest OS. Furthermore, more than two execution environments may be utilized. For example, for non-security-critical applications, a third execution environment and / or virtual machine may be utilized, such as for providing network or Ethernet connectivity or corresponding data related to that non-security-critical application.
[0080] Figure 1 The flowchart also illustrates the functionality of the regulator component 150 in conjunction with the first execution environment 120 and the second execution environment 140, as well as the safety-critical application 130. The flowchart illustrates a computer implementation method for executing the safety-critical application 130 on the hardware platform 100.
[0081] Figure 1 The method shown includes: in step S1, executing a security-critical application 130 in a first execution environment 120 on the hardware platform 100.
[0082] The method includes: in step S2, executing a regulator component 150 for a safety-critical application 130 in a second execution environment 140 on the hardware platform 100.
[0083] The method further includes, in step S3, at least detecting, by the regulator component 150, a transition of control flow between the safety-critical application 130 and other software 125 running in the first execution environment. As illustrated by reference numeral 125, the other software 125 may be a guest OS, a guest OS kernel, one or more non-safety-critical applications, and / or one or more additional safety-critical applications running in the first execution environment 120.
[0084] The method includes a further step S4a, which includes: in response to detecting that control flow is shifting from safety-critical application 130 to other software 125, the supervisor component 150 prohibits at least one access mode to at least one resource used by safety-critical application 130 and / or captures the state of at least one resource 132 used by safety-critical application. At least one resource 132 may refer to any physical and / or virtual resource provided to safety-critical application 130 in the first execution environment 120. Examples of such resources are memory pages and / or memory provided to the safety-critical application, and memory registers, process registers, processor registers, or hardware computing resources (such as CPU capabilities) that can be controlled or blocked by the supervisor component 150 and / or hypervisor 115 upon detection of the shift from safety-critical application 130 to other software 125.
[0085] As an alternative to or supplement to step S4a, the method includes step S4b, which includes: in response to detecting that the control flow is switching back from other software 125 to the safety-critical application 130, allowing re-access to at least one resource 132 and / or verifying whether the state of at least one resource 132 conforms to a previously captured state, which may include appropriate or correct updates to the state, and reporting a failure if the state does not conform.
[0086] As described above and below, Figure 1 The general method illustrated may be supplemented with one or more optional features, steps, or aspects. See below for further details. Figure 1 and Figure 2 And reference Figure 3 and Figure 4 This paper summarizes such exemplary steps and aspects, as well as the advantages and benefits achieved through this method.
[0087] in, Figure 3 A block diagram illustrating an exemplary hardware platform 100 and computing system 500 for performing methods for performing safety-critical application 130 is shown. Unless otherwise stated, Figure 3The hardware platform 100 includes and Figure 2 The hardware platform 100 has the same features and components. Figure 4 A block diagram of an exemplary hardware platform 100 and a regulator component 150 for performing a safety-critical application 130 is shown. Unless otherwise stated, Figure 4 The regulator component 150 in the reference may include Figures 1 to 3 The same features and functions as the regulator component 150 described in any of them.
[0088] Figure 3 The computing system 500 depicted corresponds to or exemplifies a component of an electrical / electronic / programmable electronic device (E / E / PE device), such as a safety-critical system in a vehicle for controlling one or more functions of the vehicle.
[0089] The computing system 500 includes a hardware platform 100, which can be considered as a control system for an E / E / PE device or the computing system 500. The computing system 500 includes processing circuitry 110 and / or a processor 110 having one or more processor cores 112a, 112b, and a memory 114 (see [link to documentation]). Figure 2 ).
[0090] Optionally, hardware platform 500 includes a bootloader 111 for configuring platform 100 during boot. Hardware platform 100 may also optionally include a hypervisor 115, which may provide or allow the creation of one or more execution environments 120, 140, 190, for example.
[0091] Specifically, Figure 3 An example is illustrated as a first execution environment 120 or a main execution environment, which may be included in or provided by a first or main virtual machine 120 maintained and / or instantiated by a hypervisor 115. The hypervisor 115 may have a higher... Figure 3 The execution environment 120, 140, and 190 shown have a higher privilege level. The first execution environment 120 may include a guest OS or a guest OS kernel 125a, optionally using a C library 125b to execute one or more security-critical applications 120 on top of the guest OS kernel 125a.
[0092] A second execution environment 140 can be provided for the supervisor component 150 and one or more processors 152, 155-161. This second execution environment can run directly on the hardware platform 100 as a dedicated or encapsulated computing environment without a virtual machine. For example, the supervisor component 150 can be integrated into a hypervisor 115. Alternatively, the supervisor component 150 can be executed in a virtual machine that provides the second execution environment 140.
[0093] The hardware platform 100 also includes a third execution environment 190 with an additional kernel 192 and / or guest OS 192, which optionally runs another process 194, such as a proxy server application, for example.
[0094] exist Figure 3 In the example shown, the third execution environment 190 communicates with the outside world via one or more (digital) communication interfaces 520a. For example, one or more sensor signals can be obtained from one or more sensors 522 communicatively coupled to one or more communication interfaces 520a. The sensor signals received via communication interfaces 520a can be provided to safety-critical application 130 and / or other components of hardware platform 100, and can be used, for example, to generate one or more actuation signals to actuate one or more actuators communicatively and / or operatively coupled to hardware platform 100 via one or more corresponding communication interfaces 520b.
[0095] The following text mainly references Figure 4 Various features, functions, and associated benefits are described in this figure, which is illustrated as a block diagram with functional blocks 155, 156, 157, 158, 159, 160, and 161. One or more of these functional blocks 155-161 can be combined with each other and / or with one or more other functions described herein with reference to regulator component 150. Furthermore, each functional block 155-161 can be associated with or correspond to one or more processors 152.
[0096] Function block 155 illustrates the features and functions provided by monitor component 150 for launching safety-critical application 130. When starting (a new) safety-critical process or application 130, monitor component 150 is configured to verify that a binary file or binary file segment has not been corrupted, and / or verify the integrity of at least a portion of a binary file containing machine-readable instructions of safety-critical application 130.
[0097] In addition, the regulator component 150 can verify that the new process context of the safety-critical application 130 has been correctly established by the guest OS kernel 125a.
[0098] Furthermore, the regulator component 150 can verify that the paging tree of the (new) safety-critical application 130 is correct. For example, it can determine whether memory elements in the page table tree PTT used by the safety-critical application 130 have the expected size and / or are located at the expected location. Alternatively or additionally, it can determine whether memory pages used by the safety-critical application 130 do not conflict with the address spaces of other software.
[0099] To register a (new) safety-critical process or application 130, the supervisor component 150 can receive HVC instructions for kernel 124a from hypervisor 115, indicating the intent to launch the new process or safety-critical application 130. For example, hypervisor 115 can be invoked via HVC instructions from execution environment 120. A handler within hypervisor 115 can, for example, determine whether to invoke supervisor component 150 based on the HVC instructions. The safety application startup or block 155 can then receive critical parameters of the new process or safety-critical application 130 (e.g., binary path and expected paging tree root) and can create new internal data structures for at least one handler (e.g., a common handler (which may also be referred to herein as "MoniLisa" or block 160 of supervisor component 150)) to track the new process or safety-critical application 130. Further checks may not be required at this point, and kernel 125a can be allowed to continue booting.
[0100] To verify the binary file content or segments of safety-critical application 130, the monitor component 150 can protect the binary file content and / or data from corruption. This can be achieved by the monitor component 150 observing, monitoring, and / or reporting faults and, for example, by triggering the calculation of checksums for each segment or segment of the binary file, which can be done, for example, within a data structure. These CRC32 checksums can be checked against segments or segments in this feature. For example, the binary file can be verified after it has been loaded into RAM. The checksums of the segments can be stored in additional segments. The binary file may optionally include additional flags in its header to indicate that it is a binary file implementing safety-critical application 130. If the binary file lacks flags or segments with segment checksums, the monitor component 150 can indicate a fault. Not all binary file segments can hold or contain data related to the correct execution of safety-critical application 130. Therefore, not all segments can be checked and verified.
[0101] To verify the process context, the monitor component 150 can check that memory elements (e.g., memory stack) in the user-space PTT are of the correct size and located in the correct position. Optionally, further checks can be performed on the process's internal kernel data structures (such as task_struct or mm_struct), which may be subject to conclusions drawn from software-based technical analysis.
[0102] To verify the correctness of the paging tree, the supervisor component 150 can verify the correctness of the PTT start address. To verify the correctness of the paging tree, it can be checked that there is no overlap or "conflict" with the address space of kernel 125a (unless intended for shared memory) or other security-critical applications 130. The supervisor component 150 can also verify the correctness of the PTT start address.
[0103] Verification of the startup of the safety-critical application 130 can be captured from exception level 1 (EL 1 OS) at the operating system 125a or kernel 125a to exception level 2 at the hypervisor 115 and from there to the supervisor component 150. For example, the capture can be achieved when writing to TTBR0_EL1 based on ARM HV characteristics (see, for example, the ARM Architecture Reference Manual, Section G8.2.64).
[0104] Furthermore, if any of these verifications fails, the regulator component 150 may, for example, indicate a failure and / or provide a failure indication via function block 158.
[0105] Function block 156 illustrates the features and functions provided by monitor component 150 for maintaining the data integrity of safety-critical processes or applications 130. In addition, function block 156 and / or monitor component 150 can be configured to protect memory pages used by safety-critical applications 130.
[0106] In an exemplary implementation of functional block 156, the supervisor component 150 may be configured to modify the page tables of a high-integrity application (correspondingly, a safety-critical application 130). For example, memory pages of the safety-critical application 130 may be marked as read-only and optionally not executed in the final stage of the PTT (e.g., in the stage 2 PTT and / or the stage 2 address space). Block 156 may handle modifications to the stage 2 PTT. Alternatively or additionally, modifications to the stage 2 PTT may be performed in the hypervisor 115.
[0107] Furthermore, after modifying the Phase 2 PTT and / or the final Phase PTT of one of the multiple cores 112a, 12b of processor 110, the Translation Lookaside Buffer (TLB) of the other cores is flushed. This prevents other cores from using PTT entries with outdated address mappings or cached permissions, and thus prevents accidental access to or modification (e.g., writes) of memory used by safety-critical applications. To ensure that no potentially inconsistent state is generated during this process, the supervisor component 150 may first mark memory pages as read-only and non-executable (or non-executable) in the PTT of the guest OS kernel 125a, flush the TLB, and then modify the PTT of the safety-critical application 130 and flush the TLB again. Multi-page modifications following this workflow are also possible.
[0108] Therefore, the regulator component 150 can be configured to maintain page table entries for the security-critical process or application 130. Specifically, the regulator component 150 can be configured to maintain the Phase 2 PTT for the first execution environment 120.
[0109] Furthermore, to maintain data integrity, the supervisor component 150 can be configured to switch the Phase 2 memory address space. Specifically, the supervisor component 150 can be configured to modify the Phase 2 PTT when a context switch occurs from safety-critical application 130 to other software 125, 125a, 125b and / or vice versa. Specifically, when the context switches from kernel 125a or other software 125, 125b to safety-critical application 130 and vice versa, the supervisor component 150 can trigger and / or execute the switching of the Phase 2 PTT and / or memory address space. Therefore, depending on whether safety-critical application 130 is active on processor cores 112a, 112b, or whether other software 125, 125a, 125b is active on processor cores 112a, 112b, the supervisor component 150 can activate and / or load the specific Phase 2 PTT for the corresponding context, thereby ensuring that memory pages allocated or used by safety-critical application 130 are not corrupted during context switching. However, further modifications to the page order are possible.
[0110] Optionally, when kernel 125a or other software 125b, 125 is active on processor cores 112a, 112b, a memory base address register, such as TTBR0 (Translation Table Base Address Register 0), can be set. Furthermore, the supervisor component 150 can be configured to handle one or more exceptions triggered by writes to the memory base address register, such as a TVM exception in the case of an ARM-based processor. A similar concept can be implemented for other processor architectures such as x86.
[0111] In the event of any fault detected, the monitor component 150 may, for example, indicate the fault and / or provide a fault indication via function block 158.
[0112] Function block 157 illustrates the features and functions provided by monitor component 150 for maintaining data integrity during context switching. In addition, function block 157 and / or monitor component 150 can be configured, for example, to capture the state of safety-critical application 130 when a context switch or control transition occurs from safety-critical application 130 to other software 125, 125a, 125b, and / or to restore the state when transitioning from other software 125, 125a, 125b to safety-critical application 130.
[0113] For example, the context switching component or block 157 of the regulator component 150 can check the state of the registers and / or memory of the safety-critical application 130. Furthermore, block 157 can determine whether memory pages and / or (process / processor) registers are consistently and / or correctly updated upon entry and exit of the guest OS kernel 125a or other software 125, 125b.
[0114] Specifically, function block 157 and / or regulator component 150 can be configured to store state, such as CPU / processor register state, during context switching to kernel and / or other software 125, 125a, 125b. Upon entering kernel and / or other software 125, 125a, 125b, a copy or shadow copy of the relevant process register or processor register can be stored. For example, context switching triggers can be based on a scheduled timer interrupt, a syscall, or others.
[0115] It is possible to store only copies of registers that are relevant to the safety-critical application 130, for example, only copies of registers that can be written from EL1 by kernel 125a and that are relevant to computational data within the high integrity context of the safety-critical application 130.
[0116] Furthermore, function block 157 and / or supervisor component 150 can be configured to check state, such as CPU registers, during context switching to user space (e.g., from kernel 125a to safety-critical application 130). For example, supervisor component 150 can be configured to check a (shadow) copy of the state against restored process / processor registers upon returning to user space and / or safety-critical application 130. Optionally, permitted changes performed by kernel 125a can be considered. For example, the initial state of a new process or safety-critical application 130 can be stored in a new data structure upon initial creation.
[0117] Permitted changes can primarily be initiated when starting a new process and / or safety-critical application 130, as kernel 125a can then be responsible for replacing the cloned process state with the clean start state of the new process. Therefore, for new processes, a detailed technical analysis can outline which default values are acceptable. Close coordination between the secure application startup at block 155 and function block 157 can be implemented to ensure the integrity of these context switches. The exact values of the registers can be analyzed in the software technical analysis.
[0118] In addition, block 157 can know which process or application is being scheduled, because during scheduling, the incoming process is likely not the outgoing process, and therefore the correct shadow copy of the state should be used.
[0119] Allowed values for all registers can be determined for different architectures of processor cores 112a and 112b. These allowed values can be derived, for example, from ARM or x86 manuals, and can be analyzed in software technical analysis for potential causes of fault propagation introduced by certain values (such as cache attributes).
[0120] In the event of any fault detected, the monitor component 150 may, for example, indicate the fault and / or provide a fault indication via function block 158.
[0121] Function block 158 of the supervisor component 150 can be configured to provide heartbeat signals to the hypervisor 115 (e.g., the hypervisor's watchdog 117 and / or watchdog service 117). Function block 158 may be referred to as the canary component 158 of the supervisor component 150.
[0122] The canary component 158 can provide an interface to other monitor software and / or function blocks of the monitor component 150 described herein to indicate faults.
[0123] Block 158 or canary component 158 can begin indicating a heartbeat before the sole first safety-critical process or application 130 begins. Therefore, it is possible to react to fault indications observed throughout the startup process. If any other component of the supervisor component 150's functional block indicates a fault to canary component 158, canary component 158 can stop triggering the watchdog 117 interface and / or stop providing heartbeat signals to the watchdog 117 of the hypervisor 115.
[0124] The regulator component 150 may also include a function block 159 that provides an abstraction layer from the hypervisor 115 used. Block 159 provides a simple, reusable interface for abstraction from a specific hypervisor 115, thereby allowing the use of a variety of different hypervisors 115.
[0125] The supervisor component 150 may also include a function block 160 that provides an interface to the hypervisor 115 to initiate monitoring tasks from a single entry point. Furthermore, block 160 may be configured to distribute events and exceptions forwarded from the hypervisor 115 to individual monitoring components or function blocks 155-161 of the supervisor component 150, and optionally filter unwanted and / or disallowed events. Therefore, the function block container 160 can be considered a common handler 160 that interacts with the individual handlers 155, 156, 157, 158, 159, and 161 of the supervisor component 150 and / or function blocks 155, 156, 157, 158, 159, and 161. Block 160 may also be referred to herein as MoniLisa.
[0126] To provide an entry point, the hypervisor 115 may call a startup routine or block 155 before the start of the first execution environment 120 or the virtual machine 120, for example, to start monitoring in MoniLisa block 160.
[0127] Then, block 160 can call block 159 to enable exception triggering, for example, to enable the TVM bit, which enables exception triggering when kernels 125, 125a, and 125b attempt to write to TTBR0 and several other registers.
[0128] Block 160 can also distribute events and exceptions to the various functional blocks 155-161 of the supervisor component 150, because different exceptions and events should be handled by different functional blocks or components 155-161. Some blocks in 155-161 may have sorting requirements, which can also be handled by component 160.
[0129] HVC instruction-related events can be dispatched as follows: - Store task entries: Store the base address of the task and / or process within the supervisor component; - Process initialization: Set the process's internal state information to "start", and then call the safety-critical application startup or block 155, and then call block 157; - Any page table modification: If the process's internal state is not "start", indicate an error; otherwise, call block 156. - TVM-related TTBR0 exception: Request to set TTBR0 byblock 156; - Execution license exception in the PTT mapping during High Integrity Phase 2: If syscall is not allowed: indicates a fault; Otherwise: call block 157 to store the register; Internally, the process state is marked as sleeping; If a child process is created, mark it as started; Call block 156 to switch to phase 2 PTT.
[0130] - Returning from an exception to a safety-critical process: If the process is marked as started, invoke the safety-critical application startup or blocks 155 and 157 to set the initial reference data; Call block 157 for register checking; Call block 156 to switch the pagination tree; Internally, the process status is marked as running.
[0131] Block 160 can filter permitted system calls (referred to herein as syscalls) from user space, such as those permitted in the security manual and / or according to security standards or recommendations. If a syscall that is not permitted in the supervisor component 150 is invoked, a fault can be indicated to block 158.
[0132] Block 160 can also store state information for other components of Block 160, accessible and updated centrally. Examples of such information include: a list of processes and their states (such as running and starting), references to at least two Phase 2 PTTs (one of the safety-critical applications 130, and one for other software 125, 125a, 125b), and other kernel memory address-related information that can be used by the safety application startup or by Blocks 155 and 156 to infer locations within kernel memory.
[0133] In the event of any fault detected, the monitor component 150 may, for example, indicate the fault and / or provide a fault indication via function block 158.
[0134] Another functional block 161 of the regulator component 150 can be associated with kernel patches. Block 161 can enable event-based communication with functional block 160 and provide shared memory to safety-critical application 130 or high-integrity application 130.
[0135] For example, shared memory patches or updates can be provided as follows. The device tree for the guest OS or virtual machine (VM) (e.g., guest Linux VM) can store several additional shared memory pages. These pages can be mapped in a predefined layout to high-integrity processes or security-critical applications 130 at startup and / or during runtime to enable IPC, watchdog triggering from user speeds, and communication to low-integrity processes or VMs.
[0136] For example, an HVC call can be used by kernel 125a as an instruction to notify block 160 of the intent to perform certain actions related to all the monitoring features described herein or to blocks 155-161.
[0137] By studying the accompanying drawings, this disclosure, and the appended claims, those skilled in the art can understand and implement other variations of the disclosed embodiments in practicing the claimed invention. In the claims, the word "comprising" does not exclude other elements or steps, and the indefinite articles "a" or "an" do not exclude multiple. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used for an advantageous purpose. Any reference numerals in the claims should not be construed as limiting the scope of the claims.
Claims
1. A method for executing a security-critical application (130) on a hardware platform (100) including at least one processor core (112a, 112b), the method comprising the steps of: • The security-critical application (130) is executed in a first execution environment (120) on the hardware platform (100); • The supervisor component (150) for the safety-critical application is executed in a second execution environment (140) on the hardware platform; • The regulator component (150) detects at least the transition of control flow between the safety-critical application (130) and other software (125, 125a, 125b) running in the first execution environment (120); as well as: • In response to the detection that the control flow is transitioning from the safety-critical application (130) to the other software (125, 125a, 125b), the regulator component (150) prohibits at least one access mode to at least one resource (114) used by the safety-critical application (130) and / or captures the state of at least one resource used by the safety-critical application, while • In response to detecting that the control flow is switching back from the other software (125, 125a, 125b) to the safety-critical application (130), allow re-access to the at least one resource (114) and / or verify whether the state of the at least one resource conforms to the previously captured state, and report a failure if the state does not conform.
2. The method according to claim 1, wherein: • The at least one resource (114) includes a memory page used by the security-critical application (130), and • Prohibiting access to these memory pages includes prohibiting writing to these memory pages.
3. The method according to any one of claims 2, wherein prohibiting access to the memory pages used by the security-critical application (130) includes prohibiting writing to the memory pages and prohibiting execution of code in the memory pages.
4. The method according to any one of claims 2 and 3, wherein prohibiting or allowing access to memory pages comprises modifying the Stage 2 Page Table Tree (PTT) maintained by the first execution environment (120) and residing outside the first execution environment.
5. The method according to any one of claims 1 to 4, wherein the at least one resource includes at least one processor register.
6. The method according to any one of claims 1 to 5, wherein detecting the transition of the control flow comprises instructing the processor core (112a, 112b) by the regulator component (150) to redirect the control flow to the processor (155-161) in the regulator component (150) in response to receiving an instruction to perform an action associated with the transition of the control flow.
7. The method according to any one of claims 1 to 6, wherein the execution of the safety-critical application (130) includes verification of one or more of the following: • The integrity of at least a portion of the binary file containing the machine-readable instructions of the safety-critical application (130); and / or • Whether the memory elements in the page table tree PTT used for the safety-critical application have the expected size and / or are located at the expected location; and • Whether the memory pages used by the security-critical application do not conflict with the use of other software. And if any such verification fails, a failure is reported.
8. The method according to any one of claims 1 to 7, further comprising: • The processor cores (112a, 112b) are instructed by the regulator component (150) to redirect the control flow from the first execution environment (120) to the regulator component (150) if any event requires the control flow to be redirected to the common processor (160) in the regulator component (150). • The public handler (160) distributes the event to the individual handler components (155-159, 161) in the supervisor component (150) according to a predetermined rule set; • Each individual handler component determines whether the event is expected or unexpected during normal operation; as well as • If the event is anticipated during normal operation, then the predetermined handling action associated with the event is performed, and, • If the event is unexpected, report a failure.
9. The method according to any one of claims 1 to 8, further comprising: In response to the security-critical application (130) triggering a system call to the operating system (125, 125a, 125b) in the first execution environment (120): • Check if the system call is on the list of allowed system calls, and • If the system call is on the list, then the system call is executed, and... • If the system call is not on the list, a fault is reported.
10. The method according to any one of claims 1 to 9, further comprising: The operating system (125, 125a, 125b) notifies the supervisor component (150) of the expected action by invoking HVC through the hypervisor, and the security-critical application (130) runs on the first execution environment (120) above the operating system.
11. The method of claim 9, wherein the anticipated action comprises one or both of the following: • Start the process, and • Allocate memory pages to the process.
12. The method according to any one of claims 1 to 11, wherein • The first execution environment (120) is a virtual machine, which is instantiated by a hypervisor (115) running at a higher privilege level than the virtual machine; • The virtual machine monitoring program (115) includes a watchdog (117) configured to periodically trigger a heartbeat signal indicating normal operation of the security-critical application (130); and • In response to the termination of the heartbeat signal, the virtual machine monitoring program (115) determines that the safety-critical application (130) is faulty and may optionally initiate remedial actions to restore the working state of the safety-critical application.
13. The method of claim 12, wherein... • At least one canary component (158) provides a heartbeat signal to the watchdog (117) of the hypervisor (115) and is configured to receive health indications and / or reported faults; and • In response to a failure that receives an adverse health indication and / or report, the canary component terminates the provision of the heartbeat signal.
14. The method according to any one of claims 1 to 13, further comprising: • The safety-critical application (130) processes the measurement data acquired by at least one sensor (522) into an actuation signal; as well as • Actuate at least one land vehicle, air vehicle or sea vehicle and / or at least one robot, and / or any of its components (524) by means of the actuation signal.
15. A computing system (500), comprising: A hardware platform (100) having one or more processor cores (112a, 112b); as well as Memory (114) for data storage; The computing system (500) is configured to perform the steps of the method according to any one of the preceding claims.
16. One or more computer programs, the one or more computer programs comprising machine-readable instructions that, when executed by a computing system, cause the computing system to perform the method according to any one of claims 1 to 14, and / or the role of the regulator component in the context of performing the method.
17. A non-transitory machine-readable data carrier and / or downloadable product having one or more computer programs as claimed in claim 16.
