This description relates to network security for over the air (OTA) flashing.
Vehicles, such as automobiles, may have many onboard computing resources. For example, vehicles may include multiple sensors, processors, memories and networking components. Vehicles may use such computing resources for many purposes related to, e.g., the safety and convenience of vehicle passengers. For example, vehicles may use such computing resources to implement software for, e.g., providing semi-autonomous or autonomous driving capabilities.
As software may be improved or upgraded over time, it is convenient to be able to provide over the air (OTA) software updates for vehicle software. For example, a machine learning algorithm for enabling self-driving features may be improved, and it may be desirable to be able to automatically update such an algorithm already installed on a potentially large number of vehicles.
Executing such OTA updates, however, represent a substantial security risk. For example, compromised OTA updates may potentially lead to the loss of confidential information of vehicle users, and, in the case of self-driving features, could lead to loss of control of the vehicle and other critical safety failures.
A computer program product may be tangibly embodied on a non-transitory computer-readable storage medium and may comprise instructions that, when executed by at least one computing device, may be configured to cause the at least one computing device to initiate an over-the-air (OTA) update of a software application using an application image, using a dual bank architecture with a first memory bank having a first address space and a second memory bank having a second address space, and translate a start address of the application image from the second address space to the first address space, to thereby obtain a translated start address. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to calculate a pre-boot application authentication code for the application image, using the translated start address, and write the application image to the second address space, using the start address. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to execute a swap of the first address space and the second address space with respect to the first memory bank and the second memory bank, so that the application image has a swapped start address instead of the start address, and perform a reset of the dual bank architecture. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to calculate an application authentication code for the application image, using the swapped start address, and verify the application image based on comparing the pre-boot application authentication code and the application authentication code.
Example implementations may include the following. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to translate the start address of the application image using an address offset between the first address space and the second address space. The first address space may be a standard address space, and the second address space may be an alternate address space, and the first memory bank may be active and executing an earlier version of the application image during the translating of the start address to the translated start address. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to store the pre-boot application authentication code in a hardware security manager (HSM) secure storage. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to initiate a second over-the-air (OTA) update of a bootloader using a bootloader image, translate a bootloader start address of the bootloader image from the second address space to the first address space, to thereby obtain a translated bootloader start address, calculate a pre-boot bootloader authentication code for the bootloader image, using the translated bootloader start address, and write the bootloader image to the second address space, using the bootloader start address. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to execute a second swap of the first address space and the second address space with respect to the first memory bank and the second memory bank, so that the bootloader has a swapped bootloader start address instead of the bootloader start address, and perform a reset of the dual bank architecture. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to calculate a bootloader authentication code for the bootloader image, using the swapped bootloader start address, and verify the bootloader image based on comparing the pre-boot bootloader authentication code and the bootloader authentication code. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to verify a bootloader signature of the bootloader image using a signature start address in the second address space, prior to calculating the pre-boot bootloader authentication code. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to duplicate a hardware security manager (HSM) module of a HSM from the first memory bank to the second memory bank, calculate the pre-boot application authentication code and the application authentication code using the HSM module and the HSM. When executed by the at least one computing device, the instructions may be configured to cause the at least one computing device to store the pre-boot application authentication code in a secure storage of the HSM. The first memory bank and the second memory bank may be implemented using partitions of a flash memory. The application authentication code may include a cipher-based message authentication code (CMAC).
According to other general aspects, a computer-implemented method may include initiating an over-the-air (OTA) update of a software application using an application image, using a dual bank architecture with a first memory bank having a first address space and a second memory bank having a second address space, and translating a start address of the application image from the second address space to the first address space, to thereby obtain a translated start address. The method may include calculating a pre-boot application authentication code for the application image, using the translated start address, writing the application image to the second address space, using the start address, and executing a swap of the first address space and the second address space with respect to the first memory bank and the second memory bank, so that the application image has a swapped start address instead of the start address. The method may include performing a reset of the dual bank architecture, calculating an application authentication code for the application image, using the swapped start address, and verifying the application image based on comparing the pre-boot application authentication code and the application authentication code.
Example implementations may include the following. The method may include translating the start address of the application image using an address offset between the first address space and the second address space. The first address space may be a standard address space, and the second address space may be an alternate address space, and the first memory bank may be active and executing an earlier version of the application image during the translating of the start address to the translated start address. The method may include storing the pre-boot application authentication code in a hardware security manager (HSM) secure storage. The method may include initiating a second over-the-air (OTA) update of a bootloader using a bootloader image, translating a bootloader start address of the bootloader image from the second address space to the first address space, to thereby obtain a translated bootloader start address, and calculating a pre-boot bootloader authentication code for the bootloader image, using the translated bootloader start address. The method may include writing the bootloader image to the second address space, using the bootloader start address, executing a second swap of the first address space and the second address space with respect to the first memory bank and the second memory bank, so that the bootloader has a swapped bootloader start address instead of the bootloader start address, performing a reset of the dual bank architecture, calculating a bootloader authentication code for the bootloader image, using the swapped bootloader start address, and verifying the bootloader image based on comparing the pre-boot bootloader authentication code and the bootloader authentication code. The method may include verifying a bootloader signature of the bootloader image using a signature start address in the second address space, prior to calculating the pre-boot bootloader authentication code. The method may include duplicating a hardware security manager (HSM) module of a HSM from the first memory bank to the second memory bank, and calculating the pre-boot application authentication code and the application authentication code using the HSM module and the HSM.
According to other general aspects, a vehicle may include a chassis, a frame mounted on the chassis, a motor mounted within the frame, a plurality of sensors mounted on the vehicle and configured to generate sensor data characterizing an environment of the vehicle, at least one memory including instructions, and at least one processor that is operably coupled to the at least one memory and that is arranged and configured to execute instructions that. When executed, the instructions may cause the at least one processor to initiate an over-the-air (OTA) update of a software application using an application image, using a dual bank architecture with a first memory bank having a first address space and a second memory bank having a second address space, translate a start address of the application image from the second address space to the first address space, to thereby obtain a translated start address, and calculate a pre-boot application authentication code for the application image, using the translated start address. When executed, the instructions may cause the at least one processor to write the application image to the second address space, using the start address, execute a swap of the first address space and the second address space with respect to the first memory bank and the second memory bank, so that the application image has a swapped start address instead of the start address, and perform a reset of the dual bank architecture. When executed, the instructions may cause the at least one processor to calculate an application authentication code for the application image, using the swapped start address, and verify the application image based on comparing the pre-boot application authentication code and the application authentication code.
Example implementations may include the following. When executed, the instructions may cause the at least one processor to translate the start address of the application image using an address offset between the first address space and the second address space. The first address space may be a standard address space, and the second address space may be an alternate address space, and the first memory bank may be active and executing an earlier version of the application image during the translating of the start address to the translated start address.
The details of one or more implementations are set forth in the accompanying drawings and the description below. Other features will be apparent from the description and drawings, and from the claims.
Processors may implement a dual bank memory architecture to support OTA (also referred to as Software OTA, or SOTA) updates. Use of such a dual bank architecture provides multiple advantages, but may conflict with, or compromise, security requirements associated with OTAs.
For example, a dual bank architecture enables an update to be executed using a second bank, while a first bank is in active use. For example, such an update may include installing a second version of an application (e.g., referred to as Version 2, or v2, or portions thereof) to replace a first version of the application (e.g., referred to as Version 1, or v1, or portions thereof).
Dual bank architectures provide a swapping feature in which the banks are swapped, e.g., from an inactive bank to an active bank. For example, a first bank may be an active bank that is currently executing v1 of the application, while v2 is written to the second, inactive bank. Then, the banks may be swapped, e.g., in conjunction with a restart or other reset event, so that v2 then executes from the second bank.
Dual bank architectures thus enable software updates with very little or no downtime. Dual bank architectures also provide a layer of redundancy, e.g., in case of update failures. For example, in case of an update failure at the second bank, a dual bank architecture enables the use of the first bank as a backup. In other words, dual bank architectures provide an ability to execute a rollback to a previous, working version of the software being updated.
Dual bank architectures, however, may complicate, compromise, or invalidate other security requirements associated with performing SOTA updates. For example, part of a secureboot process may include verifying an authentication code, e.g., a message authentication code (MAC) or cipher-based MAC (CMAC), of one or more software components being updated. However, such authentication codes may depend on the address information of the component being verified. Since an address of a software component (or an updated version thereof) may be changed in conjunction with bank swapping operations, such MAC verification processes will fail.
Additionally, some software components requiring updates may be security-critical, e.g., may provide potential vulnerabilities to attacks. For example, a hardware security manager (HSM), executing one or more HSM modules, may be used to provide trust or security operations related to, e.g., secure keys, certificates, or other security elements. A bootloader associated with booting applications may present vulnerabilities because, e.g., the bootloader may be manipulated to boot an untrusted software image.
Such security-critical components may be particularly problematic to implement and/or update in a dual bank architecture. For example, dual bank architectures may require complete duplication of relevant software components on both of the banks. On the other hand, some security-critical components may specify singular instances of such components.
Described techniques provide addressing schemes that account for address differences between active and inactive memory banks, including providing address translations where needed to obtain one standard addressing scheme for purposes of SOTA updates. Further, the timing and implementation of authentication and booting techniques (e.g., MAC generation and verification) may ensure that signature authentication and boot processes use correct memory addresses across the dual banks to enable updates to both an application and a bootloader (and subsequent successful, secure booting processes) to occur. Still further, swapping techniques are described that enable robust, secure swapping between the banks, and that enable SOTA updates to HSM software, while ensuring the use of such HSM software in dual bank scenarios.
The vehicle 102 may thus include a body of desired type (e.g., a chassis, a frame mounted on the chassis with doors, windows, a roof, trunk, and/or hood), various components for enabling movement of the vehicle, such as wheels/wings, and a suitable motor, such as an electric motor (and associated battery) or internal combustion engine (not separately illustrated in
For example, the at least one processor 106 may represent multiple processors, chipsets, or processing cores. The computer-readable storage medium 108 may represent multiple types of memories, including, e.g., read-only memories (ROM) 110, solid state drives (SSD) 112, random access memories (RAM) 114, or flash memories (Flash) 115 (including, e.g., data FLASH (DFLASH) or program FLASH (PFLASH)).
The vehicle computational resources 104 may also include network hardware used to create a vehicle network 116 within the vehicle 102. For example, the vehicle network 116 may represent, e.g., wiring and related hardware/software to provide one or more busses and related protocols for distributing data within the vehicle 102. As such, the vehicle network 116 provides opportunities for intra-vehicle communication between and among various vehicle subsystems, as described in detail, below.
For example, the vehicle network 116 may utilize existing types of vehicle bus topologies and related busses, including, e.g., the Controller Area Network (CAN) bus, the Local Interconnect Network (LIN) bus, or the Media Oriented Systems Transport (MOST). The network 114 may also represent automotive-grade Ethernet and various types of Transport Control Protocol/Internet Protocol (TCP/IP) networks.
In some implementations, two or more of these technologies may be combined or utilized together. For example, a physical Ethernet connection may be established throughout the vehicle 102 (e.g., as an Ethernet ring that encircles a chassis and/or cabin of the vehicle 102), and may be used to aggregate or distribute multiple CAN busses.
In many implementations, the vehicle 102 may include multiple sensors 118, which may be used to detect information regarding the environment or surroundings of the vehicle 102. For example, the sensors 118 may include video cameras, Light Detection and Ranging (lidar) sensors, ultrasonic sensors, radar sensors, GPS sensors, and various other types of sensors. The sensors 118 may be distributed within and around a chassis, body, and/or cabin of the vehicle 102, where needed to perform intended functions.
In the simplified example of
For example, multiple control boards may be assembled using desired ones of the at least one processor 106 and the computer-readable storage media 108, and positioned appropriately within the vehicle 102 to perform desired functions. Such control boards and related hardware and software may be referred to generally as electronic control units (ECUs). For example, one or more ECUs may be used to support and enable corresponding vehicle subsystems. Examples of current vehicle subsystems may include subsystems for navigation, including an advanced driver assistance system (ADAS) 120 for autonomous or semi-autonomous systems, which may include one or more Autonomous Control Units (ACUs) 122. Various other vehicle subsystems may relate to, or include, subsystems for vehicle safety features, climate control, and information/entertainment (infotainment) systems.
Another example of an ECU is illustrated in
Moreover, maintaining a single site of network connectivity may assist in protecting the vehicle 102 from various types of cyberattacks. For example, the TCU 124 may be equipped with firewalls and various other protection mechanisms used to prevent attackers from, e.g., controlling operations or the vehicle 102, or accessing confidential information within the vehicle 102.
The TCU 124 may include multiple modems and/or related hardware (including appropriate ones of the at least one processor 106 and the computer-readable storage media 108) for connecting to two or more external networks 126. For example, the TCU 124 may provide external connectivity to WiFi networks, Long Term Evolution (LTE) networks, or 3G/4G/5G networks.
Accordingly, it is possible to use the external networks 126 to exchange vehicle information with remote processing resources 128. For example, as described in detail, below, it is possible to perform over-the-air (OTA) updates of software stored using the computer-readable storage media 108, or to upload navigation data from the vehicle 102 to the remote processing resources 128 for analysis or long-term storage.
As further illustrated, the ACU 122 may include a framework 130. The framework may include an operating system (OS) that, e.g., supports operations of one or more applications 132 of the ACU 122, and that enables connectivity with the vehicle network 116. For example, the framework 130 may provide or include an implementation of the AUTomotive Open Source Architecture (AUTOSAR), which is designed to support the deployment of the applications 132 using an operating system based on the Portable OS Interface (POSIX) standard, which is written using C++ and enables service-oriented communication and application programming interfaces (APIs) for communicating with, e.g., the vehicle network 116 and the applications 132. Additionally, or alternatively, the framework 130 may include other OS implementations, such as automotive grade Linux.
In the example of
An OTA updater 138 represents a component for receiving updates of the vehicle 102 via the external network 126. For example, new or updated software may be downloaded via the TCU 124 and installed by the OTA updater 138 within an appropriate or designated memory of the computer-readable storage media 108.
An uploader 140 may be configured to execute any desired transmission of data from the vehicle 102 to the external network 126, using the vehicle network 116 and the TCU 124. For example, the uploader 140 may be configured to upload processed sensor data, or any vehicle data, to the remote processing resources 128.
An event manager 142 represents a component for detecting, determining, processing, and/or characterizing network data received via the vehicle network interface 134 and/or sensor data received via the sensor interface 136, and for then using the network data and/or sensor data, e.g., to control other functions of the framework 130 and the applications 132. Put another way, the event manager 140 represents a control node for controlling and coordinating operations of the framework 130 and the applications 132, to thereby achieve coordinated functions such as, e.g., sensor fusion, multi-layer perception processing algorithms, and autonomous driving control algorithms for controlling steering, braking, or other functions of the vehicle 102.
In specific examples, the event manager 142 may be configured to control operations of a recorder 144 in recording various types of vehicle data, including sensor data, for storage as recorded files 146. For example, the recorded files 146 may be used to store sensor data related to particular events, including driving-related events such as sudden accelerations/decelerations, or impact events including collisions of the vehicle 102. Then, some or all of the recorded files 146 may be uploaded to the external networks 126, and to the remote processing resources 128, using the uploader 140.
In the simplified example of
Further in
The HSM 150 may include secure storage 152. For example, as referenced above, the secure storage may be used to store various keys, certificates, and other trust elements, as well as related algorithms for processing such trust elements. Although not pictured in
As described in detail, below, e.g., with respect to
As further illustrated in
For example, the HSM modules 158, 164 may represent or include interfaces between the bootloaders 162, 168 and the HSM 150. The HSM modules 158, 164 may also represent or include a form of secure storage for enacting functionalities of the HSM 150.
The OTA updater 138 may be configured, as referenced above, to execute OTA updates of any permitted and enabled software of the ACU 122. For example, the OTA updater 138 may implement the Unified Diagnostics Services (UDS) protocol for OTA updates.
For example, during such updates, a particular software image may be downloaded using the TCU 124. The software image may be required to be updated on one or more ACUs of the ADAS 120, including the ACU 122. Accordingly, the software image may be transmitted to each ACU using the vehicle network 116.
Secure flashing of the downloaded software image thus refers to securely flashing the downloaded software image into implementations of flash memory 115 installed on the ACU 122, e.g., using the first bank 154 and the second bank 156. Secure booting refers to booting processes, which may occur during any booting operation, and in the context of SOTA updates, may occur after the software image is flashed. That is, secure booting may occur during a power cycle or reset event subsequent to the secure flashing, to confirm the integrity of the flashed software, and to ensure that the booting process has not been corrupted to cause booting of, e.g., a different and/or untrusted software image.
In the example of
In more detail, in conventional SOTA update systems, only a single flash memory bank may be used, e.g., the first bank 154. In such a single bank solution, a bootloader and HSM module (e.g., the bootloader 162 and the HSM module 158) may interface with one another and with the HSM 150 to provide secure updating of an application, such as the application 160.
For example, in a single bank solution, the OTA updater 138 may obtain a new image (e.g., referred to as version 2, or v2), represented by the application 166, to replace a current image of the application 160 (e.g., referred to as version 1, or v1). As noted above, secure flashing of v2 refers generally to secure flashing of bits of v2 into the first bank 154, which may include both authenticating a provider of the image (e.g., in a challenge/response scenario) and/or authenticating a signature associated with the new image, e.g., using an appropriate signature authentication algorithm (e.g., a public/private key pair or other asymmetric algorithm). In some cases, one or more authentication codes (e.g., MAC, or CMAC) may also be calculated, for use in subsequent secure booting operations, as described below. In conjunction with successful authentication, flashing of the new image for v2 into the first bank 154 may occur, including erasing v1 and writing v2.
Then, the bootloader 162 and the HSM module 158 may be configured to work together and with the HSM 150 to provide secure booting of v2. Secure booting ensures, for example, the integrity of the HSM module 158, v2 of the application 160, and/or the bootloader 162, e.g., by calculating a message integrity code (MIC), which may also be referred to as a message authentication code (MAC), or just authentication code, as referenced above.
For example, a MAC may be calculated based in part on the characteristics of an image, such as its size and address space (e.g., start address), and compared to a previously-calculated MAC value. For example, a BOOT_MAC calculated for the bootloader 162 may be calculated at a point in time, e.g., during production, and stored in the secure storage 152 of the HSM 150. During typical secure booting, the HSM 150 may re-calculate the BOOT_MAC and compare the two values to verify the authenticity and integrity of the bootloader 162.
In additional examples, as described in detail, below, a pre-boot BOOT_MAC may be calculated after (or in conjunction with) the secure flashing, and a new BOOT_MAC calculated during the boot event may be compared to the pre-boot BOOT_MAC. By verifying the pre-boot BOOT_MAC, the secure booting process ensures that no illicit activities were included. Similarly, a pre-boot application MAC (referred to herein as APP_MAC) may be calculated and then compared to a new APP_MAC in conjunction with the booting process, e.g., to ensure that the booting process did not change the application in an undesired manner.
The HSM 150 may provide a number of advantages in such procedures. For example, as a hardware-based solution, the HSM 150 may provide very fast calculations of the BOOT_MAC and other verification data. For example, in addition to MAC generation, the HSM 150 may provide fast calculations of known algorithms such as the RSA public key algorithm, SHA256, AES128 key algorithms, and others. Moreover, the HSM 150 and related firmware (FW) may provide secure storage of any related secrets obtained in conjunction with such calculations, including secure (e.g., encrypted) exchange with interfaces of the HSM module 158.
As a result of such security measures, however, conventional implementations of the HSM 150 are not compatible with the dual bank architecture of
For example, the types of source authentication for v2 referenced above may be performed, and v2 may be written, without disrupting the ongoing operations of v1 as the application 160 in the first bank 154. Moreover, a pre-boot APP_MAC may be calculated. Specifically, in conventional dual bank systems, such calculations may be performed using the address space of the inactive second bank 156, e.g., the physical or logical address space of the second bank 156.
In the context of a subsequent secure boot event, in conventional systems, a swap may be executed, e.g., by the OTA updater 138 and/or the bootloader 168, so that the second bank 156 becomes the active bank, while the first bank 154 becomes an inactive bank. For example, the second bank 156 may be assigned the first logical address space previously assigned to the first bank 154, so that the second bank 156 becomes the active bank. Meanwhile, the bank 154 is assigned the second logical address space previously assigned to the second bank 156, so that the first bank 154 becomes the inactive bank.
During a subsequent secure boot event, in conventional dual bank systems, the bootloader 168 and the HSM 164 may attempt to perform verification of the pre-boot APP_MAC and the pre-boot BOOT_MAC, using the v2 address space, which is now the active address space previously assigned to the first bank 154. Consequently, the calculated APP_MAC and BOOT_MAC generated using the active address space will not match the pre-boot APP_MAC and pre-boot BOOT_MAC generated using the inactive address space, and the secure booting process will fail.
In contrast, the system of
As noted above, a requirement of the dual bank architecture of
In the example of
A secure flashing operation(s) may then be executed. In the example of
In
A pre-boot APP_MAC and pre-boot BOOT_MAC or other authentication code(s) may then be generated, with address translation between the active first bank 154 and the inactive second bank 156 (206). As referenced above, and described in detail, below, with respect to
Then, the application 166 and the bootloader 168 may be flashed onto the second flash bank 156 (208), while the second bank 156 is inactive and the first bank 154 is active. Such flashing may be performed across multiple ACUs 122, while typical operations of all such ACUs 122 are ongoing. Then, prior to a single subsequent reset, a swapping of the first bank 154 and the second bank 156 (for all ACUs 122) may be executed (210). Consequently, the start address of the application 166 (or the bootloader 168) may be referred to as a swapped start address.
After the reset is performed (212), a secure boot process may be implemented, in which the application authentication code APP_MAC and the bootloader authentication code BOOT_MAC may be recalculated and verified (214). Since the earlier swap operation results in the second bank 156 having the active or standard addressing, the APP_MAC and BOOT_MAC will automatically be generated in accordance therewith. As a result, the APP_MAC will successfully be verified against the pre-boot APP_MAC, and the BOOT_MAC will successfully be verified against the pre-boot BOOT_MAC. In other words, each authentication code may be calculated with a pre-boot translated start address and then subsequently with a swapped start address that is equivalent to the translated start address, so that the authentication code(s) will match.
The SWAP mechanism for SOTA of the Infineon TC39xx platform operates as referenced above, and splits the Flash memory of MCU (Micro Controller Unit) into two banks, A and B. Bank A is here called Standard addressing and Bank B is here called Inactive addressing. If SOTA is enabled, one of the banks will be active and the other bank is inactive. Using the available SWAP mechanism, it is possible to switch the active bank to the other and vice versa.
The various features, functions, and advantages referenced above may be obtained in the context of the example of
As another example, to enable update of a bootloader component, BOOT_MAC computation of the inactive bank may be executed after a signature authentication is successful. Signature authentication may be performed with the inactive bank address and secure booting with the active bank address, as noted above.
Further, the SOTA and secure boot in HSM may be enabled only after a first time successful OTA. For example, on reset (e.g., restart) after the OTA, the software will boot in the other bank, so that only on successful OTA is it possible to ensure the secure boot process can be successful.
Additionally, the swap function may be enabled only after signature authentication and BOOT_MAC generation of bootloader in the inactive bank to avoid hardware bricking in response to perceived threat or other malfunctions. For example, a reset may be performed after the SWAP enabling, as shown in
As shown in
As shown HSM software module(s) comprises two blocks, HSM Bootloader 406 and HSM application 408, and HSM Bootloader 414 and HSM application 416. TC3xx supports a secure boot of the HSM application image(s) 408, 416, in which HSM application 408, 416 verification is provided by HSM bootloader 406, 414.
Then, the HSM application 408, 416 verifies Tricore bootloader 412, 420, respectively, and supports secure boot of the Tricore bootloader 412, 420. The Tricore bootloader may be referred to herein as the root of trust.
The Tricore bootloader 412, 420 may then request the HSM application 408, 416 to verify the Tricore application 410, 418. The Tricore application 410, 418 may be referred to herein as a secure boot extension.
Put another way, the left view illustrates PFLASH bank A 502 mapped to the standard address range for CPU read and execute. After the bank swap 506, bank B 504 is mapped to standard address space as illustrated on the right view.
In
Thus,
Similarly for an application,
A security access get seed may then be performed (804). For example, the Tricore boot loader may share some fixed numbers of random bytes (where the number of bytes may be decided by at a time of development). A security access compare key operation may then be performed (806), in which the UDS client calculates a key by performing some mathematical calculation on the seed provided in the previous step. A UDS server may perform the same mathematical operation and compare the result with the key sent by the UDS client. If the key matches, then the UDS server may send a positive response.
Then, a memory erase may be performed (808). For example, appropriate bank of flash memory may be erased according to a block ID included in an erase request. As noted in
A download may then be requested (810). For example, a block ID and number of bytes that the UDS client will send in each transfer data message may be identified.
A data transfer (812) may then be executed. That is, data may be transmitted to the UDS server to be written to flash memory, again using the address translation techniques as described herein and noted in
More specifically, CPU writes may be redirected to the alternate bank's physical address. For example, when bank A is active, address translation from standard address space to alternate address space may be achieved using the address translation illustrated in
In some scenarios, bank B may be active, such as when a previous SOTA has been executed. In such scenarios, updates are flashed to bank A, in which case the physical address (standard address) is used to write the update image to bank A without any address translation being required.
A transfer exit may be requested (814). For example, the transfer exist may be required to terminate a server/client data transfer. This operation may also include determining whether all the bytes to flash are received by the UDS server.
A check memory routine may then perform (816), e.g., a cyclic redundancy check (CRC) and/or signature verification on received data bytes to verify whether the received bytes are correct. A check dependencies routine may also be performed (818) to perform a version check on all dependent blocks. In the example of
As may be understood from the above description of
After successful signature verification, a swap and reset may be triggered over UDS (822). As also shown in
In the secure boot init sequence of
In
cryptographic key used to verify the authenticity and integrity of the Tricore bootloader 902, and is required for the illustrated examples of BOOT_MAC verification. Therefore, a request (908) for BOOT_MAC_KEY generation is made using interface hsm_key_gen( ) to cause the HSM to generate (910) the BOOT_MAC_KEY, and then store the resulting BOOT_MAC_KEY 912 in the HSM secure storage 906. For example, DATA FLASH 1 (DFLASH 1) of Aurix may be dedicated to HSM secure storage and may be common between Bank A and Bank B.
While BOOT_MAC_KEY is used for BOOT_MAC authentication of Tricore bootloader, CMAC_KEYs used for CMAC verification of an application, where, e.g., CMAC is an example of APP_MAC, referenced above. Therefore the Tricore bootloader 902 may request (914) HSM 904 to generate CMAC_KEY (916) using interface hasm_key_gen( ), for secure boot extension, and store the resulting CMA_key 918 in HSM secure storage 906.
As noted above, a MAC of Tricore bootloader 902 used in secure boot may be called BOOT_MAC. Thus, BOOT_MAC 926 may be requested (920) by the Tricore bootloader 902 using interface hsm_secure_boot( ), with arguments 922 that include a start address of the Tricore bootloader 902 and a size of the Tricore bootloader 902. After generating the BOOT_MAC (924), the HSM 904 may store the BOOT_MAC 926, the start address 928 of the Tricore bootloader 902 and the size 930 of the Tricore bootloader 902 in the HSM secure storage 906.
Similarly, CMAC 938 may be requested (932) by the Tricore bootloader 902 using interface hsm_mem_blockadd( ), with arguments 934 that include a start address of the application and a size of the application. After generating the CMAC (936), the HSM 904 may store the CMAC 938, the start address 940 of the application and the size 942 of the application in the HSM secure storage 906.
Specifically, the HSM BOS starts HSM bootloader 1006 that verifies and securely boots HSM application 1008 (analogous, e.g., to the HSM bootloader 414 and HSM application 416 of
Tricore bootloader 902 may then request (1016) CMAC verification of the Tricore application from the HSM application 1008. The HSM application 1008 may then read the Tricore application start address 940 and size 942, and may compute the CMAC of the Tricore application image. If computed CMAC matches with the pre-boot application CMAC 938 stored in the HSM secure storage 906, the HSM application handshakes with the Tricore Bootloader using AND gate 1020 to allow execution (1022) of the Tricore Application.
Thus, in
Upon successful signature verification (1106), the HSM 906 regenerates BOOT_MAC of the new downloaded bootloader (1108), using a pre-boot BOOT_MAC_KEY 912a, to obtain a pre-boot BOOT_MAC 926a, using the bootloader start address 928 and bootloader size 930 received with hsm_boot_sign( ), and stores the computed pre-boot BOOT_MAC 926a along with the bootloader start address 928 and bootloader size 930 in HSM secure storage 906.
In conjunction therewith, the HSM 906 stores the pre-boot BOOT_MAC 926a and a translated bootloader start address 928a that is obtained using the address translation techniques of
After successful BOOT_MAC regeneration, Tricore bootloader enables bank swap 1112, e.g., by updating UCB for swap. If the start address 0xA0F00000 were stored in secure storage 906, then, after reset (1114), the CPU read address (1116) of FLASH bank 5 would be mapped to a standard address, i.e., 0xA0C00000, while the address 0xA0F00000 would map to PFLASH bank 4. The resulting BOOT_MAC calculated over the bootloader image from the start address stored in secure storage (0xA0F00000) in PFLASH Bank 4, when compared with the BOOT_MAC of the bootloader in PFLASH bank 5 stored in secure storage (calculated over the bootloader image from the swapped start address in the standard address space), would result in a mismatch, and the HSM 904 would prevent the Tricore CPU from executing the new bootloader, so that a secure boot would fail.
In
Similar comments apply to a secure boot extension for any application other than the bootloader that is updated. For example, an application start address in an alternate address space may be translated to a corresponding standard start address in a standard address space (if bank A is active). Moreover, the swap 1112 and subsequent secure boot may be enabled in the check dependencies stage (818), only after the successful pre-boot BOOT_MAC and pre-boot CMAC regeneration have occurred, to also ensure a successful MAC match(es).
Thus, described techniques enable Secureboot processes that are leveraged to securely update software over the air, including HSM Firmware (F/W) secureboot processes, as referenced herein. For example, a pre-boot APP_MAC may be calculated over a HSM application image and may then be verified by a HSM bootloader. HSM application F/W can be updated over the air and a new MAC may be calculated. A BOOT_MAC_KEY may be used to verify the integrity and authenticity of the software and to verify a corresponding BOOT_MAC. Optionally, BOOT_MAC_KEY may be generated by HSM F/W. BOOT_MAC may store the MAC of the Host bootloader in HSM DFLASH. As also referenced, host software may include comprises more than one block in PFLASH, such as bootloader, application, or calibration. Secureboot extension may be used to validate host applications other than the root of the trust (bootloader).
As also referenced, SOTA with a swap mechanism may require complete duplication of all the software blocks in PFLASH. As a result, as described, a HSM update mechanism may be leveraged to duplicate the HSM image and program in a separate flash sector in an inactive bank.
Described techniques solve the problem(s) of a BOOT_MAC calculation by HSM on an incorrect address block by, e.g., allowing the HSM to internally use a signature key id to verify the signature of a new bootloader for programming, based on chosen asymmetric algorithm. If the signature is verified successfully, then the HSM may trigger a pre-boot BOOT_MAC computation on a translated start address and size of the new bootloader.
Implementations of the various techniques described herein may be implemented in digital electronic circuitry or in computer hardware, firmware, software, or in combinations of them. Implementations may be implemented as a computer program product, i.e., a computer program tangibly embodied in an information carrier, e.g., in a machine-readable storage device, for execution by, or to control the operation of, data processing apparatus, e.g., a programmable processor, a computer, or multiple computers. A computer program, such as the computer program(s) described above, can be written in any form of programming language, including compiled or interpreted languages, and can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a communication network.
Method steps may be performed by one or more programmable processors executing a computer program to perform functions by operating on input data and generating output. Method steps also may be performed by, and an apparatus may be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory or a random access memory or both. Elements of a computer may include at least one processor for executing instructions and one or more memory devices for storing instructions and data. Generally, a computer also may, or be operatively coupled to, receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. Information carriers suitable for embodying computer program instructions and data include all forms of non-volatile memory, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The processor and the memory may be supplemented by or incorporated in special purpose logic circuitry.
To provide for interaction with a user, implementations may be implemented on a computer having a display device, e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input.
Implementations may be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface or a Web browser through which a user can interact with an implementation, or any combination of such back-end, middleware or front-end components. Components may be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet.
While certain features of the described implementations have been illustrated as described herein, many modifications, substitutions, changes, and equivalents will now occur to those skilled in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes as fall within the scope of the embodiments.
This application claims priority to U.S. Patent Application No. 63/263,300, filed on Oct. 29, 2021, and entitled “SECURE OVER THE AIR FLASHING FOR DUAL BANK MEMORIES,” the disclosure of which is incorporated by reference herein in its entirety.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/US2022/078807 | 10/27/2022 | WO |
Number | Date | Country | |
---|---|---|---|
63263300 | Oct 2021 | US |