WO2017093029A1 - Method for operating a microcontroller - Google Patents

Method for operating a microcontroller Download PDF

Info

Publication number
WO2017093029A1
WO2017093029A1 PCT/EP2016/077964 EP2016077964W WO2017093029A1 WO 2017093029 A1 WO2017093029 A1 WO 2017093029A1 EP 2016077964 W EP2016077964 W EP 2016077964W WO 2017093029 A1 WO2017093029 A1 WO 2017093029A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
protection unit
memory
memory protection
unit
Prior art date
Application number
PCT/EP2016/077964
Other languages
German (de)
French (fr)
Inventor
Simon Hufnagel
Jens Gladigau
Original Assignee
Robert Bosch Gmbh
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Robert Bosch Gmbh filed Critical Robert Bosch Gmbh
Publication of WO2017093029A1 publication Critical patent/WO2017093029A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/79Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in semiconductor storage media, e.g. directly-addressable memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/54Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by adding security routines or objects to programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/567Computer malware detection or handling, e.g. anti-virus arrangements using dedicated hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • G06F21/74Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information operating in dual or compartmented mode, i.e. at least one secure mode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • G06F12/1483Protection against unauthorised use of memory or access to memory by checking the subject access rights using an access-table, e.g. matrix or list
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1052Security improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/17Embedded application
    • G06F2212/173Vehicle or other transportation

Definitions

  • the present invention relates to a method for operating a
  • Microcontroller and a computing unit and a computer program for its implementation are described in detail below.
  • Microcontrollers for example for embedded systems, have i.a. a processor unit and a memory unit, such as ROM, RAM, flash and / or EEPROM, with different memory areas.
  • the processor unit may comprise one or more processor cores, in each of which different processes (tasks, programs, arithmetic instructions, etc.) can be executed. The processes executed can access the different memory areas.
  • access protection or memory protection is of great importance. By means of such access or storage protection is to be prevented that unauthorized access to the
  • Memory areas takes place.
  • Such a memory protection can be realized for example by a special hardware component, the so-called Memory Protection Unit (MPU).
  • MPU Memory Protection Unit
  • the microcontroller has a processor unit with one or more processor cores and a memory unit (e.g., ROM, RAM, Flash, EEPROM) having different memory areas.
  • a memory unit e.g., ROM, RAM, Flash, EEPROM
  • Different processes are executed by the microcontroller or by the processor unit.
  • the processes are executed in particular with different privilege levels or hierarchy levels.
  • An operating system or operating software (BSW) has in particular a highest privilege level or a highest hierarchical level.
  • ASW application software
  • access rights e.g., read, write, execute
  • the memory protection unit may in particular be designed as a hardware unit, in particular as a memory protection unit (MPU). It is also conceivable that the memory protection unit is executed as a process or as a software application, in particular with a highest privilege level. By the invention, individual processes are treated privileged and this
  • Processes are granted a higher degree of access rights in a simple, uncomplicated way. If a first process wants to access a particular storage area in a particular way, the storage protection unit checks, in the event that an access condition is met, only if the first process is allowed access to that particular storage area ("where") and not the first
  • the access condition is satisfied, for example, if a correspondingly privileged second process wants to access the first process or if the storage protection unit is operated in a corresponding operating mode without access rights checking.
  • the access condition may alternatively include operating the memory protection unit in a corresponding operating mode with predetermined access rights to predetermined memory areas for predetermined privilege levels.
  • the access condition is satisfied if the first process wants to access in a particular way ("like"), according to his
  • a second process for the first process accesses the particular memory area in the particular way.
  • the second process is a higher privileged process than the first process.
  • the memory protection unit checks whether the first process is allowed to access the specific memory area ("where") and whether the second process is allowed to access the particular memory area ("where") in the specific way ("how"). Access is allowed only if the first process is allowed access to the designated memory area and if the second process is allowed to access the particular memory area in the specific way.
  • the memory protection unit can be operated in a first operating mode. If the first process wants to access the particular memory area in the particular way, the memory protection unit only checks to see if the first process is on the
  • the memory protection unit thus ignores the access rights of the first process in the first operating mode and allows access.
  • a (first) process attempts to access a memory space in a manner that is not permitted to it (e.g., if the process wants to access writing or executing, but is only allowed to read), that access is provided by the
  • Memory protection unit prevented after checking the access rights.
  • Memory protection unit notifies in this case, for example by means of a trap a higher instance, for example, a second process with high or highest privilege level, in particular the operating system.
  • This higher privileged process decides in this case whether the desired access of the process is allowed and can be performed or whether the
  • Access should be omitted, for example, because of an error of the process or even an attack is present. If the higher privileged process decides that the access may be made, then this higher priviledged process performs this access to the memory area itself, since the other process still does not have sufficient access rights. To this
  • the purpose of the higher privileged process is usually to verify that the other process is allowed to access the memory area, for example, by having the higher privileged process first obtain and verify access privileges from the memory protection unit, or use tables stored in memory for checking.
  • the memory protection unit is also in a second
  • the memory protection unit checks whether the first process is allowed to access in the specific way, and based on this checking, the access of the first process to the memory area is permitted or denied.
  • the memory protection unit can be operated in particular as in a conventional microcontroller as described above.
  • the second operating mode can ensure a more secure, reliable protection of all memory areas, in particular against process errors or even against enemy attacks.
  • a sufficiently privileged second process may toggle between the first and second modes of operation, and thus authorize the access of the first process.
  • Memory area wants to access writing or executing, for example, although he has only read access rights, the first process in the first mode of operation can be privileged treated and the corresponding write or execute access can be easily admitted.
  • the memory protection unit is put back into the second operating mode after this access in order to ensure more secure and reliable protection of all memory areas.
  • the microcontroller is in particular implemented in a control unit of a motor vehicle, for example in an engine control unit.
  • a control unit of a motor vehicle for example in an engine control unit.
  • safety requirements which are made in the automotive sector, can be met.
  • safety requirements as laid down in ISO standard 26262 can be complied with.
  • a second process switches to a higher one
  • Privilege level as the first process the memory protection unit in the first operating mode (especially from the second) to. This prevents a low privileged process from changing or extending its access rights or the privileges of a more privileged process. In particular, it can thus be prevented that an attacker with a low privilege level can unauthorizedly change or override access rights.
  • the second process preferably transmits the storage protection unit its privilege level.
  • the memory protection unit checks in particular whether this privilege level is sufficiently high to allow a change between the
  • the storage protection unit may also check to see if this privilege level is higher than the privilege level of the first process that will next request access. If this is the case, the change between the operating modes is performed.
  • the second process preferably switches the memory protection unit into the first operating mode before the first process wants to access the memory area.
  • a trap is prevented from being triggered by the memory protection unit and a higher privileged process (e.g., the second process itself or the operating system) is informed.
  • the storage protection unit informs a fourth process with a higher privilege level than the first process, for example by means of a trap, if a third process with a lower privilege level than the first process wants to switch the storage protection unit into the first operating mode.
  • this fourth process may be the same process as the second process described above.
  • the second and fourth processes are Operating system.
  • the fourth process may also be a stand-alone process, which, for example, is explicitly responsible for such unauthorized switching through low-priority processes.
  • the memory protection unit is designed as a memory protection unit (MPU).
  • the memory protection unit is preferably designed as a unit or a module of the microcontroller and is in particular in the
  • the memory protection unit may alternatively or additionally be formed an external unit or an external module, which is connected to the microcontroller, for example via a Bus Obus system.
  • An arithmetic unit e.g. a control unit of a
  • Motor vehicle is, in particular programmatically, adapted to perform a method according to the invention.
  • Computer programs are in particular magnetic, optical and electrical memories, such as e.g. Hard drives, flash memory, EEPROMs, DVDs, etc. It is also possible to download a program via computer networks (Internet, intranet, etc.).
  • Figure 1 shows schematically preferred embodiments of a
  • Control unit of a motor vehicle each of which is adapted to a preferred embodiment of a
  • FIGS. 2 to 6 each schematically show a preferred embodiment of a method according to the invention as a block diagram.
  • a control device 100 of a motor vehicle such as an engine control unit, shown schematically.
  • the control unit 100 comprises a microcontroller 101 having a processor unit 1 10, a memory protection unit (MPU) designed as a memory protection unit 120 and an example designed as a RAM memory unit 130th
  • MPU memory protection unit
  • a plurality of processes are executed.
  • FIG. 1 a for example, four executed processes 1 1 1, 1 12, 1 13 and 1 14 are shown.
  • Process 1 1 1 in this example is an operating system having a highest privilege level, e.g. Four, owns.
  • the processes 1 12, 1 13 and 1 14 are about tasks that are executed in the course of a motor control.
  • process 1 12 has a privilege level of three
  • process 1 13 has a privilege level of three
  • Privilege level of two and process 1 14 has, for example
  • the RAM memory 130 includes a variety of different ones
  • Storage areas For example, three memory areas 131, 132 and 133 are shown in FIG. 1a.
  • access rights of the individual processes 1 1 1 1 to 1 14 are deposited. As access rights are for each of the processes 1 1 1 to 1 14th Defines whether the respective process may read, write and / or execute access to a specific memory area.
  • FIG. 1 b shows a further embodiment of a control device 100. Identical or identical elements are each provided with identical reference numerals in FIGS. 1a and 1b.
  • the microcontroller 101 according to FIG. 1 b comprises a second processor core 140 in addition to the processor core 110.
  • the processes 1 1 1 and 1 12 are executed by the processor core 1 10 and the processes 1 13 and 1 14 are executed by the processor core 140.
  • a separate MPU 120 is provided for each of the processor cores 1 10 and 140.
  • the RAM 130 is provided in common to both processor cores 1 10 and 140.
  • control device according to FIGS. 1 a and 1 b is in each case adapted to a preferred embodiment of a method according to the invention
  • process 1 13 wants to access an address within memory area 132 in step 201.
  • the MPU 120 is operated in a second operating mode, which does not fulfill an access condition, and the MPU checks in step 202, on the one hand, whether the process 1 13 is allowed to access the memory area 132 and, on the other hand, whether the process 1 13 is allowed to read. For example, the process 1 13 has a read access right to the memory area 132. The MPU 120 therefore leaves access to and
  • Process 1 13 accesses the address in memory area 132 in step 203.
  • process 1 13 wants to write to an address in memory area 132 in step 301.
  • the MPU 120 is also operated in the second operating mode and checks again in step 302, on the one hand, whether the process is allowed to access the memory area 132, and on the other hand, whether the process 1 13 may write access. Since process 1 13 has read-only access to storage area 132, MPU 120 leaves the access not and informs in step 303 by means of a trap the process with the highest privilege level, in this case the operating system 1 1 1.
  • Operating system 1 1 1 then checks in step 304 whether the access attempt of the process 1 13 is permitted or, for example, indicates an attack or an error. If the access attempt is detected as legitimate, the operating system executes
  • step 305 the appropriate write access itself.
  • the operating system 1100 switches the MPU 120 from the second operating mode into a first operating mode in step 401 and transmits its privilege level for this purpose.
  • the MPU 120 recognizes the highest privilege level of four and enters the first mode of operation.
  • Process 1 13 would like to write to an address in memory area 132 in step 402.
  • the MPU 120 now checks because the
  • Access condition is satisfied, in the first mode of operation in step 403, only whether the process 1 13 is allowed to access the memory area 132, and not the access rights of the process 1 13. After it has been determined that the process 1 13 may access the memory area 132, allows the MPU 120 in step 404 the write access of the process 1 13 to the memory area 132, although this process 1 13 has read-only access rights. Process 1 13 then performs the access. In step 405, the operating system 1100 switches the MPU 120 back to the second operating mode.
  • process 1 13 wishes to re-write to memory area 132.
  • Process 1 14 wants the MPU 120 in step 501 from the second
  • Operating system 1 1 1 from the switchover attempt.
  • the operating system 1 1 1 checks in step 504 whether the switch attempt was performed due to an error of the process 1 14 or in the course of an attack.
  • process 1 13 wants to re-write the memory area 132 in step 601.
  • the operating system 1 1 1 accesses the memory area 132 in this case for the process 1 13 writing.
  • Operating system 1 1 1 transmits for this purpose the MPU 120 in step 602
  • step 603 whether the operating system 1 1 1 write access to the memory area 132 may access. Since this is the case, an access condition according to a preferred embodiment of the invention is met.
  • the MPU 120 now checks, as the access condition is satisfied, in step 604, whether process 1 13 is on
  • Memory area 132 may access. Since this is the case, the MPU 120 in
  • Step 605 the write access of the process 1 13 to the memory area

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Virology (AREA)
  • Storage Device Security (AREA)

Abstract

The invention relates to a method for operating a microcontroller (101), wherein access rights of processes (111, 112, 113, 114) carried out in the micro-controller (101) are stored in a memory protection unit (120) on different storage areas (131, 132, 133), wherein, when a first process (113) wants to access a specific storage area (132) in a specific manner, the memory protection unit (120) checks in the event that an access condition is met, whether the first process (113) is allowed to access the specific storage area (132), and not, whether the first process (113) is allowed to access in said specific manner. The access to the memory region (132) is allowed only when the first process (113) is allowed to access the specific storage area (132).

Description

Beschreibung Titel  Description title
Verfahren zum Betreiben eines Mikrocontrollers  Method for operating a microcontroller
Die vorliegende Erfindung betrifft ein Verfahren zum Betreiben eines The present invention relates to a method for operating a
Mikrocontrollers sowie eine Recheneinheit und ein Computerprogramm zu dessen Durchführung. Microcontroller and a computing unit and a computer program for its implementation.
Stand der Technik State of the art
Mikrocontroller, beispielsweise für eingebettete Systeme, weisen u.a. eine Prozessoreinheit und eine Speichereinheit, wie ROM, RAM, Flash und/oder EEPROM, mit unterschiedlichen Speicherbereichen auf. Die Prozessoreinheit kann einen oder mehrere Prozessorkerne umfassen, in welchen jeweils unterschiedliche Prozesse (Tasks, Programmen, Rechenbefehlen, etc.) ausgeführt werden können. Die ausgeführten Prozesse können auf die unterschiedlichen Speicherbereiche zugreifen. Microcontrollers, for example for embedded systems, have i.a. a processor unit and a memory unit, such as ROM, RAM, flash and / or EEPROM, with different memory areas. The processor unit may comprise one or more processor cores, in each of which different processes (tasks, programs, arithmetic instructions, etc.) can be executed. The processes executed can access the different memory areas.
Für den Betrieb von Mikrocontrollern ist ein Zugriffsschutz bzw. Speicherschutz von großer Bedeutung. Mittels eines derartigen Zugriffs- bzw. Speicherschutzes soll verhindert werden, dass ein nicht autorisierter Zugriff auf die For the operation of microcontrollers, access protection or memory protection is of great importance. By means of such access or storage protection is to be prevented that unauthorized access to the
Speicherbereiche erfolgt. Ein derartiger Speicherschutz kann beispielsweise durch eine spezielle Hardwarekomponente, die sogenannte Memory Protection Unit (MPU) realisiert werden. Memory areas takes place. Such a memory protection can be realized for example by a special hardware component, the so-called Memory Protection Unit (MPU).
Offenbarung der Erfindung Disclosure of the invention
Erfindungsgemäß werden ein Verfahren zum Betreiben eines Mikrocontrollers sowie eine Recheneinheit und ein Computerprogramm zu dessen Durchführung mit den Merkmalen der unabhängigen Patentansprüche vorgeschlagen. According to the invention, a method for operating a microcontroller as well as a computer unit and a computer program for its implementation proposed with the features of the independent claims.
Vorteilhafte Ausgestaltungen sind Gegenstand der Unteransprüche sowie der nachfolgenden Beschreibung. Advantageous embodiments are the subject of the dependent claims and the following description.
Der Mikrocontroller weist insbesondere eine Prozessoreinheit mit einem oder mehreren Prozessorkernen und eine Speichereinheit (z.B. ROM, RAM, Flash, EEPROM) mit unterschiedlichen Speicherbereichen auf. Von dem Mikrocontroller bzw. von der Prozessoreinheit werden unterschiedliche Prozesse (Tasks, Programmen, Rechenbefehlen, etc.) ausgeführt. Die Prozesse werden insbesondere mit unterschiedlichen Privilegienniveaus bzw. Hierarchiestufen ausgeführt. Ein Betriebssystem bzw. eine Betriebssoftware (BSW) besitzt insbesondere ein höchstes Privilegienniveau bzw. eine höchste Hierarchiestufe. Weiterhin kann unterschiedliche Anwendungssoftware (ASW) ausgeführt werden, mit jeweils niedrigerem Privilegienniveau als das Betriebssystem. In particular, the microcontroller has a processor unit with one or more processor cores and a memory unit (e.g., ROM, RAM, Flash, EEPROM) having different memory areas. Different processes (tasks, programs, arithmetic instructions, etc.) are executed by the microcontroller or by the processor unit. The processes are executed in particular with different privilege levels or hierarchy levels. An operating system or operating software (BSW) has in particular a highest privilege level or a highest hierarchical level. Furthermore, different application software (ASW) can be executed, each with a lower privilege level than the operating system.
Aus Sicherheitsgründen ist es nicht allen Prozessen erlaubt, in vollem Umfang auf alle Speicherbereiche zuzugreifen. Unterschiedlichen Prozessen sind daher insbesondere unterschiedliche Zugriffsrechte zugewiesen, d.h. unterschiedliche Prozesse dürfen jeweils in unterschiedlichem Umfang ("Wie") auf einzelne Speicherbereiche ("Wo") zugreifen (oder nicht). Zugriffsrechte von Prozessen auf Speicherbereiche können beispielsweise lesend, schreibend und/oder ausführend sein. For security reasons, not all processes are allowed to fully access all storage areas. Different processes are therefore assigned in particular different access rights, i. Different processes may (or may not) access individual storage areas ("where") to varying degrees ("how"). Access rights of processes to storage areas can be for example read, write and / or executing.
In einer Speicherschutzeinheit sind Zugriffsrechte (z.B. lesend, schreibend, ausführend) von in dem Mikrocontroller ausgeführten Prozessen auf In a memory protection unit, access rights (e.g., read, write, execute) of processes executed in the microcontroller are present
unterschiedliche Speicherbereiche (insbesondere gekennzeichnet durch eine Start- und eine End-Adresse) hinterlegt, d.h. in der Speicherschutzeinheit ist hinterlegt, in welchem Umfang Prozesse auf unterschiedliche Speicherbereiche zugreifen dürfen. Unterschiedliche Prozesse bzw. unterschiedliche Teile der Anwendungssoftware können z.B. durch eine Thread- oder Kontext-ID different memory areas (in particular characterized by a start and an end address) deposited, i. in the memory protection unit is deposited, to which extent processes may access different memory areas. Different processes or different parts of the application software may e.g. through a thread or context ID
unterschieden werden. be differentiated.
Die Speicherschutzeinheit kann insbesondere als eine Hardwareeinheit ausgebildet sein, insbesondere als eine Memory Protection Unit (MPU). Es ist auch denkbar, dass die Speicherschutzeinheit als ein Prozess bzw. als eine Software-Anwendung ausgeführt wird, insbesondere mit einem höchsten Privilegienniveau. Durch die Erfindung werden einzelne Prozesse privilegiert behandelt und diesenThe memory protection unit may in particular be designed as a hardware unit, in particular as a memory protection unit (MPU). It is It is also conceivable that the memory protection unit is executed as a process or as a software application, in particular with a highest privilege level. By the invention, individual processes are treated privileged and this
Prozessen werden auf einfache, unkomplizierte Weise höhere Zugriffsrechte eingeräumt. Wenn ein erster Prozess auf einen bestimmten Speicherbereich in einer bestimmten Weise zugreifen möchte, prüft die Speicherschutzeinheit für den Fall, dass eine Zugriffsbedingung erfüllt ist, nur, ob der erste Prozess auf diesen bestimmten Speicherbereich ("Wo") zugreifen darf, und nicht, ob der ersteProcesses are granted a higher degree of access rights in a simple, uncomplicated way. If a first process wants to access a particular storage area in a particular way, the storage protection unit checks, in the event that an access condition is met, only if the first process is allowed access to that particular storage area ("where") and not the first
Prozess in der bestimmten Weise ("Wie") zugreifen darf. Auch wenn der erste Prozess eigentlich nicht in der bestimmten Weise zugreifen darf, wird dieser Zugriff nicht von der Speicherschutzeinheit verhindert, wenn der erste Prozess auf diesen bestimmten Speicherbereich zugreifen darf. Die Zugriffsbedingung ist beispielsweise erfüllt, wenn ein entsprechend privilegierter zweiter Prozess für den ersten Prozess zugreifen will oder wenn die Speicherschutzeinheit in einem entsprechenden Betriebsmodus ohne Zugriffsrechteüberprüfung betrieben wird. Process in the specific way ("how") is allowed to access. Although the first process is not allowed to access in the specific way, the memory protection unit will not prevent that access if the first process is allowed to access that particular memory area. The access condition is satisfied, for example, if a correspondingly privileged second process wants to access the first process or if the storage protection unit is operated in a corresponding operating mode without access rights checking.
Die Zugriffsbedingung kann alternativ umfassen, dass die Speicherschutzeinheit in einem entsprechenden Betriebsmodus mit vorbestimmten Zugriffsrechten auf vorbestimmte Speicherbereiche für vorbestimmte Privilegienniveaus betrieben wird. In diesem Fall ist die Zugriffsbedingung erfüllt, wenn der erste Prozess in einer bestimmten Weise ("Wie") zugreifen will, die gemäß seinem The access condition may alternatively include operating the memory protection unit in a corresponding operating mode with predetermined access rights to predetermined memory areas for predetermined privilege levels. In this case, the access condition is satisfied if the first process wants to access in a particular way ("like"), according to his
Privilegienniveau für diesen bestimmten Speicherbereich ("Wo") zulässig ist. Privilege level for this particular space ("where") is allowed.
Vorzugsweise greift ein zweiter Prozess für den ersten Prozess auf den bestimmten Speicherbereich in der bestimmten Weise zu. Der zweite Prozess ist dabei insbesondere ein höher privilegierter Prozess als der erste Prozess. Von der Speicherschutzeinheit wird überprüft, ob der erste Prozess auf den bestimmten Speicherbereich ("Wo") zugreifen darf und ob der zweite Prozess in der bestimmten Weise ("Wie") auf den bestimmten Speicherbereich ("Wo") zugreifen darf. Der Zugriff wird nur zugelassen, wenn der erste Prozess auf den bestimmten Speicherbereich zugreifen darf und wenn der zweite Prozess in der bestimmten Weise auf den bestimmten Speicherbereich zugreifen darf. Gemäß einem weiteren Aspekt der Erfindung kann die Speicherschutzeinheit in einem ersten Betriebsmodus betrieben werden. Wenn der erste Prozess auf den bestimmten Speicherbereich in der bestimmten Weise zugreifen möchte, überprüft die Speicherschutzeinheit nur, ob der erste Prozess auf den Preferably, a second process for the first process accesses the particular memory area in the particular way. In particular, the second process is a higher privileged process than the first process. The memory protection unit checks whether the first process is allowed to access the specific memory area ("where") and whether the second process is allowed to access the particular memory area ("where") in the specific way ("how"). Access is allowed only if the first process is allowed access to the designated memory area and if the second process is allowed to access the particular memory area in the specific way. According to a further aspect of the invention, the memory protection unit can be operated in a first operating mode. If the first process wants to access the particular memory area in the particular way, the memory protection unit only checks to see if the first process is on the
bestimmten Speicherbereich zugreifen darf. Basierend auf dieser Überprüfung wird der Zugriff zugelassen oder verweigert. Die Speicherschutzeinheit ignoriert in dem ersten Betriebsmodus also die Zugriffsrechte des ersten Prozesses und lässt den Zugriff zu. certain memory area may access. Based on this verification, access is allowed or denied. The memory protection unit thus ignores the access rights of the first process in the first operating mode and allows access.
Wenn in einem herkömmlichen MikroController ein (erster) Prozess versucht, in einer Weise auf einen Speicherbreich zuzugreifen, welche ihm nicht erlaubt ist (beispielsweise wenn der Prozess schreibend oder ausführend zugreifen möchte, aber nur lesend zugreifen darf), wird dieser Zugriff durch die In a conventional microcontroller, if a (first) process attempts to access a memory space in a manner that is not permitted to it (e.g., if the process wants to access writing or executing, but is only allowed to read), that access is provided by the
Speicherschutzeinheit nach der Überprüfung der Zugriffsrechte unterbunden. DieMemory protection unit prevented after checking the access rights. The
Speicherschutzeinheit benachrichtigt in diesem Fall beispielsweise mittels eines Traps eine höhere Instanz, beispielweise einen zweiten Prozess mit hohem oder höchstem Privilegienniveau, insbesondere das Betriebssystem. Dieser höher privilegierter Prozess entscheidet in diesem Fall darüber, ob der gewünschte Zugriff des Prozesses erlaubt ist und durchgeführt werden darf oder ob derMemory protection unit notifies in this case, for example by means of a trap a higher instance, for example, a second process with high or highest privilege level, in particular the operating system. This higher privileged process decides in this case whether the desired access of the process is allowed and can be performed or whether the
Zugriff unterlassen werden soll, beispielsweise weil ein Fehler des Prozesses oder gar ein Angriff vorliegt. Entscheidet der höher privilegierte Prozess, dass der Zugriff durchgeführt werden darf, führt dieser höher privilegierte Prozess diesen Zugriff auf den Speicherbereich insbesondere selbst durch, da der andere Prozess nach wie vor keine ausreichenden Zugriffsrechte besitzt. Zu diesemAccess should be omitted, for example, because of an error of the process or even an attack is present. If the higher privileged process decides that the access may be made, then this higher priviledged process performs this access to the memory area itself, since the other process still does not have sufficient access rights. To this
Zweck überprüft der höher privilegierte Prozess zumeist, ob der andere Prozess auf den Speicherbereich zugreifen darf, beispielsweise indem der höher privilegierte Prozess zunächst die Zugriffsrechte aus der Speicherschutzeinheit holt und überprüft oder im Hauptspeicher gespeicherte Tabellen zur Prüfung verwendet. The purpose of the higher privileged process is usually to verify that the other process is allowed to access the memory area, for example, by having the higher privileged process first obtain and verify access privileges from the memory protection unit, or use tables stored in memory for checking.
Wenn kein Fehler oder Angriff vorliegt und der Zugriff schließlich durchgeführt wird, kann dies durch die vorangehende Prüfung durch den höher privilegierten Prozess mit einem erhöhten Laufzeit-Overhead verbunden sein. Insbesondere ist es vergleichsweise aufwendig, wenn ein höher privilegierter Prozess If there is no error or attack and the access is finally made, this may be associated with increased runtime overhead by the previous check by the higher privileged process. In particular It comparatively expensive when a higher privileged process
hinzugezogen wird und den gewünschten Zugriff selbst durchführt. Durch die Erfindung können ein derartiger Aufwand und Laufzeit-Overhead verringert werden, da die Frage des Wo weiterhin von der Speicherschutzeinheit beantwortet wird. is consulted and performs the desired access itself. Such an expense and runtime overhead can be reduced by the invention, since the question of Where continues to be answered by the memory protection unit.
Zweckmäßigerweise ist die Speicherschutzeinheit auch in einem zweiten Conveniently, the memory protection unit is also in a second
(herkömmlichen) Betriebsmodus betreibbar, in welchem im Falle eines (conventional) operating mode operable in which in the case of
Zugriffswunsches von der Speicherschutzeinheit überprüft wird, ob der erste Prozess in der bestimmten Weise zugreifen darf, und wobei basierend auf dieser Überprüfung der Zugriff des ersten Prozesses auf den Speicherbereich zugelassen oder verweigert wird. In dem zweiten Betriebsmodus kann die Speicherschutzeinheit insbesondere wie in einem herkömmlichen Mikrocontroller gemäß obiger Beschreibung betrieben werden. Somit kann durch den zweiten Betriebsmodus ein sichererer, zuverlässiger Schutz sämtlicher Speicherbereiche insbesondere vor Prozessfehlern oder gar vor feindlichen Angriffen gewährleistet werden. If desired, the memory protection unit checks whether the first process is allowed to access in the specific way, and based on this checking, the access of the first process to the memory area is permitted or denied. In the second operating mode, the memory protection unit can be operated in particular as in a conventional microcontroller as described above. Thus, the second operating mode can ensure a more secure, reliable protection of all memory areas, in particular against process errors or even against enemy attacks.
Insbesondere kann ein ausreichend privilegierter zweiter Prozess zwischen dem ersten und zweiten Betriebsmodus umschalten und somit den Zugriff des ersten Prozesses autorisieren. In particular, a sufficiently privileged second process may toggle between the first and second modes of operation, and thus authorize the access of the first process.
Wenn der erste Prozess in diesem ersten Betriebsmodus auf den If the first process in this first mode of operation on the
Speicherbereich beispielsweise schreibend oder ausführend zugreifen will, obwohl er nur lesende Zugriffsrechte besitzt, kann der erste Prozess in dem ersten Betriebsmodus privilegiert behandelt werden und der entsprechende schreibende bzw. ausführende Zugriff kann auf einfache Weise zugelassen werden. Insbesondere wird die Speicherschutzeinheit nach diesem Zugriff wieder in den zweiten Betriebsmodus versetzt, um sichereren und zuverlässigen Schutz sämtlicher Speicherbereiche zu gewährleisten. Memory area wants to access writing or executing, for example, although he has only read access rights, the first process in the first mode of operation can be privileged treated and the corresponding write or execute access can be easily admitted. In particular, the memory protection unit is put back into the second operating mode after this access in order to ensure more secure and reliable protection of all memory areas.
Der Mikrocontroller ist insbesondere in ein Steuergerät eines Kraftfahrzeugs implementiert, beispielsweise in ein Motorsteuergerät. Somit kann eine verbesserte Sicherheit des entsprechenden Steuergeräts gewährleistet werden und Sicherheitsanforderungen, welche im Kraftfahrzeugbereich gestellt werden, können eingehalten werden. Insbesondere können Sicherheitsanforderungen, wie sie in der ISO-Norm 26262 hinterlegt sind, eingehalten werden. Vorteilhafterweise schaltet ein zweiter Prozess mit einem höheren The microcontroller is in particular implemented in a control unit of a motor vehicle, for example in an engine control unit. Thus, an improved security of the corresponding control device can be ensured and safety requirements, which are made in the automotive sector, can be met. In particular, safety requirements as laid down in ISO standard 26262 can be complied with. Advantageously, a second process switches to a higher one
Privilegienniveau als der erste Prozess die Speicherschutzeinheit in den ersten Betriebsmodus (insbesondere aus dem zweiten) um. Somit wird verhindert, dass ein niedrig privilegierter Prozess seine Zugriffsrechte oder die Zugriffsrechte eines höher privilegierten Prozesses ändern bzw. erweitern kann. Insbesondere kann somit verhindert werden, dass ein Angreifer mit niedrigem Privilegienniveau unerlaubt Zugriffsrechte ändert bzw. außer Kraft setzen kann.  Privilege level as the first process the memory protection unit in the first operating mode (especially from the second) to. This prevents a low privileged process from changing or extending its access rights or the privileges of a more privileged process. In particular, it can thus be prevented that an attacker with a low privilege level can unauthorizedly change or override access rights.
Der zweite Prozess übermittelt der Speicherschutzeinheit vorzugsweise sein Privilegienniveau. Die Speicherschutzeinheit überprüft insbesondere, ob dieses Privilegienniveau ausreichend hoch ist, um einen Wechsel zwischen denThe second process preferably transmits the storage protection unit its privilege level. The memory protection unit checks in particular whether this privilege level is sufficiently high to allow a change between the
Betriebsmodi zu bewirken. Die Speicherschutzeinheit kann auch überprüfen, ob dieses Privilegienniveau höher als das Privilegienniveau des ersten Prozesses ist, welcher als nächstes einen Zugriff anfordert. Ist dies der Fall, wird der Wechsel zwischen den Betriebsmodi durchgeführt. Effect operating modes. The storage protection unit may also check to see if this privilege level is higher than the privilege level of the first process that will next request access. If this is the case, the change between the operating modes is performed.
Bevorzugt schaltet der zweite Prozess die Speicherschutzeinheit in den ersten Betriebsmodus um, bevor der erste Prozess auf den Speicherbereich zugreifen möchte. Somit wird verhindert, dass ein Trap von der Speicherschutzeinheit ausgelöst wird und dass ein höher privilegierter Prozess (z.B. der zweite Prozess selbst oder das Betriebssystem) informiert wird. The second process preferably switches the memory protection unit into the first operating mode before the first process wants to access the memory area. Thus, a trap is prevented from being triggered by the memory protection unit and a higher privileged process (e.g., the second process itself or the operating system) is informed.
Vorzugsweise informiert die Speicherschutzeinheit einen vierten Prozess mit einem höheren Privilegienniveau als der erste Prozess, beispielsweise mittels eines Traps, wenn ein dritter Prozess mit einem niedrigeren Privilegienniveau als der erste Prozess die Speicherschutzeinheit in den ersten Betriebsmodus umschalten möchte. Somit wird ein unautorisiertes Umschalten zwischen den Betriebsmodi durch einen niedrig privilegierteren Prozess verhindert. Dieser vierte Prozess kann insbesondere derselbe Prozess wie der oben beschriebene zweite Prozess sein. Vorzugsweise sind der zweite und der vierte Prozess das Betriebssystem. Der vierte Prozess kann auch ein eigenständiger Prozess sein, der beispielsweise explizit für ein derartiges unautorisiertes Umschalten durch niedrig privilegiertere Prozesse zuständig ist. Preferably, the storage protection unit informs a fourth process with a higher privilege level than the first process, for example by means of a trap, if a third process with a lower privilege level than the first process wants to switch the storage protection unit into the first operating mode. Thus, unauthorized switching between the modes of operation is prevented by a less privileged process. In particular, this fourth process may be the same process as the second process described above. Preferably, the second and fourth processes are Operating system. The fourth process may also be a stand-alone process, which, for example, is explicitly responsible for such unauthorized switching through low-priority processes.
Vorzugsweise ist die Speicherschutzeinheit als Memory Protection Unit (MPU) ausgebildet. Die Speicherschutzeinheit ist bevorzugt als eine Einheit bzw. ein Modul des Mikrocontrollers ausgebildet und ist insbesondere in den Preferably, the memory protection unit is designed as a memory protection unit (MPU). The memory protection unit is preferably designed as a unit or a module of the microcontroller and is in particular in the
Mikrocontroller integriert. Bevorzugt kann die Speicherschutzeinheit alternativ oder zusätzlich auch eine externe Einheit bzw. ein externes Modul ausgebildet sein, welche mit dem Mikrocontroller verbunden ist, beispielsweis über ein Busbzw. Feldbus-System. Integrated microcontroller. Preferably, the memory protection unit may alternatively or additionally be formed an external unit or an external module, which is connected to the microcontroller, for example via a Busbzw. Fieldbus system.
Eine erfindungsgemäße Recheneinheit, z.B. ein Steuergerät eines An arithmetic unit according to the invention, e.g. a control unit of a
Kraftfahrzeugs, ist, insbesondere programmtechnisch, dazu eingerichtet, ein erfindungsgemäßes Verfahren durchzuführen. Motor vehicle is, in particular programmatically, adapted to perform a method according to the invention.
Auch die Implementierung des Verfahrens in Form eines Computerprogramms ist vorteilhaft, da dies besonders geringe Kosten verursacht, insbesondere wenn ein ausführendes Steuergerät noch für weitere Aufgaben genutzt wird und daher ohnehin vorhanden ist. Geeignete Datenträger zur Bereitstellung des Also, the implementation of the method in the form of a computer program is advantageous because this causes very low costs, especially if an executive controller is still used for other tasks and therefore already exists. Suitable media for providing the
Computerprogramms sind insbesondere magnetische, optische und elektrische Speicher, wie z.B. Festplatten, Flash-Speicher, EEPROMs, DVDs u.a.m. Auch ein Download eines Programms über Computernetze (Internet, Intranet usw.) ist möglich. Computer programs are in particular magnetic, optical and electrical memories, such as e.g. Hard drives, flash memory, EEPROMs, DVDs, etc. It is also possible to download a program via computer networks (Internet, intranet, etc.).
Weitere Vorteile und Ausgestaltungen der Erfindung ergeben sich aus der Beschreibung und der beiliegenden Zeichnung. Further advantages and embodiments of the invention will become apparent from the description and the accompanying drawings.
Die Erfindung ist anhand von Ausführungsbeispielen in der Zeichnung The invention is based on embodiments in the drawing
schematisch dargestellt und wird im Folgenden unter Bezugnahme auf die Zeichnung beschrieben. schematically and will be described below with reference to the drawings.
Kurze Beschreibung der Zeichnungen Figur 1 zeigt schematisch bevorzugte Ausgestaltungen eines Brief description of the drawings Figure 1 shows schematically preferred embodiments of a
Steuergeräts eines Kraftfahrzeugs, die jeweils dazu eingerichtet sind, eine bevorzugte Ausführungsform eines  Control unit of a motor vehicle, each of which is adapted to a preferred embodiment of a
erfindungsgemäßen Verfahrens durchzuführen.  to carry out the inventive method.
Figuren 2 bis 6 zeigen jeweils schematisch eine bevorzugte Ausführungsform eines erfindungsgemäßen Verfahrens als ein Blockdiagramm. FIGS. 2 to 6 each schematically show a preferred embodiment of a method according to the invention as a block diagram.
Ausführungsform(en) der Erfindung Embodiment (s) of the invention
In Figur 1 a ist ein Steuergerät 100 eines Kraftfahrzeugs, beispielsweise ein Motorsteuergerät, schematisch dargestellt. Das Steuergerät 100 umfasst einen MikroController 101 mit einer Prozessoreinheit 1 10, einer als Memory Protection Unit (MPU) ausgebildeten Speicherschutzeinheit 120 und einer beispielsweise als RAM-Speicher ausgebildeten Speichereinheit 130. In Figure 1 a, a control device 100 of a motor vehicle, such as an engine control unit, shown schematically. The control unit 100 comprises a microcontroller 101 having a processor unit 1 10, a memory protection unit (MPU) designed as a memory protection unit 120 and an example designed as a RAM memory unit 130th
In der Prozessoreinheit 1 10 wird eine Vielzahl von Prozessen ausgeführt. In Figur 1 a sind beispielsweise vier ausgeführte Prozesse 1 1 1 , 1 12, 1 13 und 1 14 dargestellt. In the processor unit 110, a plurality of processes are executed. In FIG. 1 a, for example, four executed processes 1 1 1, 1 12, 1 13 and 1 14 are shown.
Prozess 1 1 1 sei in diesem Beispiel ein Betriebssystem, welches ein höchstes Privilegienniveau, z.B. Vier, besitzt. Die Prozesse 1 12, 1 13 und 1 14 sind etwa Tasks, die im Zuge einer Motorsteuerung ausgeführt werden. Prozess 1 12 besitzt beispielsweise ein Privilegienniveau von Drei, Prozess 1 13 ein Process 1 1 1 in this example is an operating system having a highest privilege level, e.g. Four, owns. The processes 1 12, 1 13 and 1 14 are about tasks that are executed in the course of a motor control. For example, process 1 12 has a privilege level of three, process 1 13
Privilegienniveau von Zwei und Prozess 1 14 besitzt beispielsweise ein Privilege level of two and process 1 14 has, for example
Privilegienniveau von Eins. Privilege level of one.
Der RAM-Speicher 130 umfasst eine Vielzahl unterschiedlicher The RAM memory 130 includes a variety of different ones
Speicherbereiche. Beispielsweise sind in Figur 1 a drei Speicherbereiche 131 , 132 und 133 dargestellt. Storage areas. For example, three memory areas 131, 132 and 133 are shown in FIG. 1a.
In der MPU 120 sind Zugriffsrechte der einzelnen Prozesse 1 1 1 bis 1 14 hinterlegt. Als Zugriffsrechte sind dabei für jeden der Prozesse 1 1 1 bis 1 14 hinterlegt, ob der jeweilige Prozess lesend, schreibend und/oder ausführend auf einen speziellen Speicherbereich zugreifen darf. In the MPU 120 access rights of the individual processes 1 1 1 to 1 14 are deposited. As access rights are for each of the processes 1 1 1 to 1 14th Defines whether the respective process may read, write and / or execute access to a specific memory area.
In Figur 1 b ist eine weitere Ausgestaltung eines Steuergeräts 100 dargestellt. Gleiche oder baugleiche Elemente sind in den Figuren 1 a und 1 b jeweils mit identischen Bezugszeichen versehen. Der MikroController 101 gemäß Figur 1 b umfasst neben dem Prozessorkern 1 10 einen zweiten Prozessorkern 140. Im Beispiel von Figur 1 b werden die Prozesse 1 1 1 und 1 12 von dem Prozessorkern 1 10 ausgeführt und die Prozesse 1 13 und 1 14 von dem Prozessorkern 140. Für jeden der Prozessorkerne 1 10 und 140 ist dabei jeweils eine eigene MPU 120 vorgesehen. Der RAM-Speicher 130 ist für beide Prozessorkerne 1 10 und 140 gemeinsam vorgesehen. FIG. 1 b shows a further embodiment of a control device 100. Identical or identical elements are each provided with identical reference numerals in FIGS. 1a and 1b. The microcontroller 101 according to FIG. 1 b comprises a second processor core 140 in addition to the processor core 110. In the example of FIG. 1 b, the processes 1 1 1 and 1 12 are executed by the processor core 1 10 and the processes 1 13 and 1 14 are executed by the processor core 140. In each case, a separate MPU 120 is provided for each of the processor cores 1 10 and 140. The RAM 130 is provided in common to both processor cores 1 10 and 140.
Das Steuergerät gemäß den Figuren 1 a und 1 b ist jeweils dazu eingerichtet, eine bevorzugte Ausführungsform eines erfindungsgemäßen Verfahrens The control device according to FIGS. 1 a and 1 b is in each case adapted to a preferred embodiment of a method according to the invention
durchzuführen, welches in den Figuren 2 bis 5 jeweils schematisch als to perform, which in the figures 2 to 5 each schematically as
Blockdiagramm dargestellt ist. Block diagram is shown.
Im Fall von Figur 2 möchte Prozess 1 13 in Schritt 201 auf eine Adresse innerhalb des Speicherbereichs 132 lesend zugreifen. Die MPU 120 wird dabei in einem zweiten Betriebsmodus betrieben, welcher eine Zugriffsbedingung nicht erfüllt, und die MPU überprüft in Schritt 202 einerseits, ob der Prozess 1 13 auf den Speicherbereich 132 zugreifen darf, und andererseits, ob der Prozess 1 13 lesend zugreifen darf. Beispielsweise besitzt der Prozess 1 13 ein lesendes Zugriffsrecht auf den Speicherbereich 132. Die MPU 120 lässt daher den Zugriff zu undIn the case of FIG. 2, process 1 13 wants to access an address within memory area 132 in step 201. In this case, the MPU 120 is operated in a second operating mode, which does not fulfill an access condition, and the MPU checks in step 202, on the one hand, whether the process 1 13 is allowed to access the memory area 132 and, on the other hand, whether the process 1 13 is allowed to read. For example, the process 1 13 has a read access right to the memory area 132. The MPU 120 therefore leaves access to and
Prozess 1 13 greift in Schritt 203 lesend auf die Adresse in dem Speicherbereich 132 zu. Process 1 13 accesses the address in memory area 132 in step 203.
Im Fall von Figur 3 möchte Prozess 1 13 in Schritt 301 schreibend auf eine Adresse in dem Speicherbereich 132 zugreifen. Die MPU 120 wird ebenfalls im zweiten Betriebsmodus betrieben und überprüft in Schritt 302 erneut einerseits, ob der Prozess auf den Speicherbereich 132 zugreifen darf, und andererseits, ob der Prozess 1 13 schreibend zugreifen darf. Da Prozess 1 13 nur lesendes Zugriffsrecht auf den Speicherbereich 132 besitzt, lässt die MPU 120 den Zugriff nicht zu und informiert in Schritt 303 mittels eines Traps den Prozess mit dem höchsten Privilegienniveau, in diesem Fall das Betriebssystem 1 1 1. Das In the case of FIG. 3, process 1 13 wants to write to an address in memory area 132 in step 301. The MPU 120 is also operated in the second operating mode and checks again in step 302, on the one hand, whether the process is allowed to access the memory area 132, and on the other hand, whether the process 1 13 may write access. Since process 1 13 has read-only access to storage area 132, MPU 120 leaves the access not and informs in step 303 by means of a trap the process with the highest privilege level, in this case the operating system 1 1 1. Das
Betriebssystem 1 1 1 prüft daraufhin in Schritt 304, ob der Zugriffsversuch des Prozesses 1 13 erlaubt ist oder beispielsweise auf einen Angriff oder einen Fehler hindeutet. Wird der Zugriffsversuch als legitim erkannt, führt das BetriebssystemOperating system 1 1 1 then checks in step 304 whether the access attempt of the process 1 13 is permitted or, for example, indicates an attack or an error. If the access attempt is detected as legitimate, the operating system executes
1 1 1 in Schritt 305 den entsprechenden schreibenden Zugriff selbst durch. 1 1 1 in step 305 the appropriate write access itself.
Im Beispiel von Figur 4 schaltet das Betriebssystem 1 1 1 die MPU 120 in Schritt 401 von dem zweiten Betriebsmodus in einen ersten Betriebsmodus um und übermittelt zu diesem Zweck sein Privilegienniveau. Die MPU 120 erkennt das höchste Privilegienniveau von Vier und schaltet in den ersten Betriebsmodus. Somit ist eine Zugriffsbedingung gemäß einer bevorzugten Ausführungsform der Erfindung erfüllt. Prozess 1 13 möchte in Schritt 402 schreibend auf eine Adresse in dem Speicherbereich 132 zugreifen. Die MPU 120 prüft nun, da die In the example of FIG. 4, the operating system 1100 switches the MPU 120 from the second operating mode into a first operating mode in step 401 and transmits its privilege level for this purpose. The MPU 120 recognizes the highest privilege level of four and enters the first mode of operation. Thus, an access condition according to a preferred embodiment of the invention is satisfied. Process 1 13 would like to write to an address in memory area 132 in step 402. The MPU 120 now checks because the
Zugriffsbedingung erfüllt ist, in dem ersten Betriebsmodus in Schritt 403 lediglich, ob der Prozess 1 13 auf den Speicherbereich 132 zugreifen darf, und nicht die Zugriffsrechte des Prozesses 1 13. Nachdem festgestellt wurde, dass der Prozess 1 13 auf den Speicherbereich 132 zugreifen darf, erlaubt die MPU 120 in Schritt 404 den schreibenden Zugriff des Prozesses 1 13 auf den Speicherbereich 132, obwohl dieser Prozess 1 13 nur lesende Zugriffsrechte besitzt. Prozess 1 13 führt daraufhin den Zugriff durch. In Schritt 405 schaltet das Betriebssystem 1 1 1 die MPU 120 wieder in den zweiten Betriebsmodus. Access condition is satisfied, in the first mode of operation in step 403, only whether the process 1 13 is allowed to access the memory area 132, and not the access rights of the process 1 13. After it has been determined that the process 1 13 may access the memory area 132, allows the MPU 120 in step 404 the write access of the process 1 13 to the memory area 132, although this process 1 13 has read-only access rights. Process 1 13 then performs the access. In step 405, the operating system 1100 switches the MPU 120 back to the second operating mode.
Gemäß Figur 5 möchte Prozess 1 13 erneut schreibend auf den Speicherbereich 132 zugreifen. Prozess 1 14 möchte die MPU 120 in Schritt 501 von dem zweitenAccording to FIG. 5, process 1 13 wishes to re-write to memory area 132. Process 1 14 wants the MPU 120 in step 501 from the second
Betriebsmodus in den ersten Betriebsmodus umschalten und übermittelt der MPU 120 sein Privilegienniveau von Eins. Die MPU 120 erkennt in Schritt 502, dass dieses Privilegienniveau geringer ist als das Privilegienniveau von Zwei des Prozesses 1 13. Die MPU 120 schaltet daraufhin nicht in den ersten Switch operating mode to the first mode of operation and transmit the MPU 120 its privilege level of one. The MPU 120 recognizes in step 502 that this privilege level is less than the privilege level of two of the process 1 13. The MPU 120 then does not switch to the first one
Betriebsmodus und informiert mittels eines Traps in Schritt 503 das Operating mode and informed by means of a trap in step 503 the
Betriebssystem 1 1 1 von dem Umschaltversuch. Das Betriebssystem 1 1 1 überprüft daraufhin in Schritt 504, ob der Umschaltversuch aufgrund eines Fehlers des Prozesses 1 14 oder im Zuge eines Angriffes durchgeführt wurde. Im Beispiel von Figur 6 möchte Prozess 1 13 in Schritt 601 erneut schreibend auf den Speicherbereich 132 zugreifen. Das Betriebssystem 1 1 1 greift in diesem Fall für den Prozess 1 13 schreibend auf den Speicherbereich 132 zu. Betriebssystem 1 1 1 übermittelt zu diesem Zweck der MPU 120 in Schritt 602 sein Operating system 1 1 1 from the switchover attempt. The operating system 1 1 1 then checks in step 504 whether the switch attempt was performed due to an error of the process 1 14 or in the course of an attack. In the example of FIG. 6, process 1 13 wants to re-write the memory area 132 in step 601. The operating system 1 1 1 accesses the memory area 132 in this case for the process 1 13 writing. Operating system 1 1 1 transmits for this purpose the MPU 120 in step 602
Privilegienniveau und die Identität von Prozess 1 13. Die MPU 120 prüft in SchrittPrivilege level and the identity of process 1 13. The MPU 120 checks in step
603, ob das Betriebssystem 1 1 1 schreibend auf den Speicherbereich 132 zugreifen darf. Da dies der Fall ist, ist eine Zugriffsbedingung gemäß einer bevorzugten Ausführungsform der Erfindung erfüllt. Die MPU 120 prüft nun, da die Zugriffsbedingung erfüllt ist, in Schritt 604, ob Prozess 1 13 auf den 603, whether the operating system 1 1 1 write access to the memory area 132 may access. Since this is the case, an access condition according to a preferred embodiment of the invention is met. The MPU 120 now checks, as the access condition is satisfied, in step 604, whether process 1 13 is on
Speicherbereich 132 zugreifen darf. Da dies der Fall ist, lässt die MPU 120 inMemory area 132 may access. Since this is the case, the MPU 120 in
Schritt 605 den schreibenden Zugriff des Prozesses 1 13 auf den Speicherbereich Step 605 the write access of the process 1 13 to the memory area

Claims

Ansprüche claims
1 . Verfahren zum Betreiben eines Mikrocontrollers (101 ), wobei in einer 1 . Method for operating a microcontroller (101), wherein in one
Speicherschutzeinheit (120) Zugriffsrechte von in dem MikroController (101 ) ausgeführten Prozessen (1 1 1 , 1 12, 1 13, 1 14) auf unterschiedliche  Memory protection unit (120) access rights of executed in the microcontroller (101) processes (1 1 1, 1 12, 1 13, 1 14) to different
Speicherbereiche (131 , 132, 133) hinterlegt sind, wobei, wenn ein erster Prozess (1 13) auf einen bestimmten Speicherbereich (132) in einer bestimmten Weise zugreifen möchte (402, 601 ), von der  Memory areas (131, 132, 133) are deposited, wherein, if a first process (1 13) to access a particular memory area (132) in a certain way (402, 601), of the
Speicherschutzeinheit (120) für den Fall, dass eine Zugriffsbedingung erfüllt ist,  Memory protection unit (120) in the event that an access condition is met,
überprüft wird, ob der erste Prozess (1 13) auf den bestimmten  Checks whether the first process (1 13) on the particular
Speicherbereich (132) zugreifen darf (403, 604), und nicht, ob der erste Prozess (1 13) in der bestimmten Weise zugreifen darf, und  Memory area (132) may access (403, 604), and not whether the first process (1 13) may access in the specific way, and
der Zugriff auf den Speicherbereich (132) nur zugelassen wird (404, 605), wenn der erste Prozess (1 13) auf den bestimmten Speicherbereich (132) zugreifen darf.  the access to the memory area (132) is only allowed (404, 605) if the first process (13) is allowed to access the particular memory area (132).
2. Verfahren nach Anspruch 1 , wobei die Zugriffsbedingung erfüllt ist, wenn ein zweiter Prozess (1 1 1 ) für den ersten Prozess (1 13) auf den bestimmten Speicherbereich (132) in der bestimmten Weise zugreifen möchte (601 , 602) und wenn der zweite Prozess (1 1 1 ) in der bestimmten Weise auf den bestimmten Speicherbereich (132) zugreifen darf. The method of claim 1, wherein the access condition is met when a second process (1 1 1) for the first process (1 13) wants to access the particular memory area (132) in the particular manner (601, 602) and the second process (1 1 1) is allowed to access the particular memory area (132) in the specific manner.
3. Verfahren nach Anspruch 1 oder 2, wobei die Zugriffsbedingung erfüllt ist, wenn die Speicherschutzeinheit (120) in einem ersten Betriebsmodus betrieben wird, in welchem von der Speicherschutzeinheit (120) nicht überprüft wird, ob der erste Prozess (1 13) in der bestimmten Weise zugreifen darf. Verfahren nach Anspruch 3, wobei die Speicherschutzeinheit (120) in einem zweiten Betriebsmodus betreibbar ist, in welchem von der 3. The method of claim 1 or 2, wherein the access condition is satisfied when the memory protection unit (120) is operated in a first operating mode in which is not checked by the memory protection unit (120), whether the first process (1 13) in the certain way. The method of claim 3, wherein the memory protection unit (120) is operable in a second mode of operation, in which of the
Speicherschutzeinheit (120) überprüft wird, ob der erste Prozess (1 13) in der bestimmten Weise zugreifen darf, (202, 302), und wobei basierend auf dieser Überprüfung der Zugriff des ersten Prozesses (1 13) auf den  Memory protection unit (120) is checked whether the first process (1 13) may access in the specific way, (202, 302), and based on this review, the access of the first process (1 13) on the
Speicherbereich (132) zugelassen (203) oder verweigert wird (303).  Memory area (132) is allowed (203) or denied (303).
Verfahren nach Anspruch 4, wobei ein zweiter Prozess (1 1 1 ) mit einem höheren Privilegienniveau als der erste Prozess (1 13) die The method of claim 4, wherein a second process (1 1 1) having a higher privilege level than the first process (1 13) the
Speicherschutzeinheit (120) zwischen dem zweiten und dem ersten  Memory protection unit (120) between the second and the first
Betriebsmodus umschaltet (401 ).  Operating mode switches (401).
Verfahren nach Anspruch 5, wobei der zweite Prozess (1 1 1 ) der The method of claim 5, wherein the second process (1 1 1) of the
Speicherschutzeinheit (120) sein Privilegienniveau übermittelt (401 ).  Memory protection unit (120) transmits its privilege level (401).
Verfahren nach Anspruch 5 oder 6, wobei der zweite Prozess (1 1 1 ) die Speicherschutzeinheit in den ersten Betriebsmodus umschaltet (401 ), bevor der erste Prozess auf den Speicherbereich zugreifen möchte. The method of claim 5 or 6, wherein the second process (1 1 1) switches the memory protection unit to the first operating mode (401) before the first process wants to access the memory area.
Verfahren nach einem der Ansprüche 4 bis 7, wobei die Method according to one of claims 4 to 7, wherein the
Speicherschutzeinheit (120), wenn ein dritter Prozess (1 14) mit einem niedrigeren Privilegienniveau als der erste Prozess (1 13) die  Memory protection unit (120), if a third process (1 14) with a lower privilege level than the first process (1 13) the
Speicherschutzeinheit in den ersten Betriebsmodus umschalten möchte (502), einen vierten Prozess (1 1 1 ) mit einem höheren Privilegienniveau als der erste Prozess informiert (503).  Memory protection unit wants to switch to the first mode of operation (502), a fourth process (1 1 1) with a higher privilege level than the first process informed (503).
Verfahren nach einem der vorstehenden Ansprüche 2 oder 5 bis 8, wobei der zweite Prozess (1 1 1 ) und/oder der vierte Prozess (1 1 1 ) ein Method according to one of the preceding claims 2 or 5 to 8, wherein the second process (1 1 1) and / or the fourth process (1 1 1) a
Betriebssystem sind.  Operating system are.
10. Verfahren nach einem der vorstehenden Ansprüche, wobei die 10. The method according to any one of the preceding claims, wherein the
Speicherschutzeinheit (120) als eine Einheit des MikroControllers (101 ) ausgebildet ist und/oder wobei die Speicherschutzeinheit als eine externe Einheit ausgebildet ist, welche mit dem Mikrocontroller (101 ) verbunden ist. Memory protection unit (120) is formed as a unit of the microcontroller (101) and / or wherein the memory protection unit is formed as an external unit, which is connected to the microcontroller (101).
1 1 . Recheneinheit (100), die dazu eingerichtet ist, ein Verfahren nach einem der vorstehenden Ansprüche durchzuführen. 1 1. Arithmetic unit (100) adapted to perform a method according to any one of the preceding claims.
12. Computerprogramm, das eine Recheneinheit (100) dazu veranlasst, ein Verfahren nach einem der Ansprüche 1 bis 10 durchzuführen, wenn es auf der Recheneinheit (100) ausgeführt wird. A computer program that causes a computing unit (100) to perform a method according to any one of claims 1 to 10 when executed on the computing unit (100).
13. Maschinenlesbares Speichermedium mit einem darauf gespeicherten 13. Machine-readable storage medium with a stored thereon
Computerprogramm nach Anspruch 12.  Computer program according to claim 12.
PCT/EP2016/077964 2015-11-30 2016-11-17 Method for operating a microcontroller WO2017093029A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
DE102015223757.5A DE102015223757A1 (en) 2015-11-30 2015-11-30 Method for operating a microcontroller
DE102015223757.5 2015-11-30

Publications (1)

Publication Number Publication Date
WO2017093029A1 true WO2017093029A1 (en) 2017-06-08

Family

ID=57389405

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/EP2016/077964 WO2017093029A1 (en) 2015-11-30 2016-11-17 Method for operating a microcontroller

Country Status (2)

Country Link
DE (1) DE102015223757A1 (en)
WO (1) WO2017093029A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10606771B2 (en) 2018-01-22 2020-03-31 Infineon Technologies Ag Real time stack protection

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040177261A1 (en) * 2002-11-18 2004-09-09 Watt Simon Charles Control of access to a memory by a device
US20120144140A1 (en) * 2010-12-03 2012-06-07 Robert Bosch Gmbh Memory Protection Unit and a Method for Controlling an Access to a Memory Device
EP2570930A1 (en) * 2011-09-16 2013-03-20 Freescale Semiconductor, Inc. Memory management unit (MMU) having region descriptor globalization controls and method of operation
DE102014201682A1 (en) * 2014-01-30 2015-07-30 Robert Bosch Gmbh Method for coexistence of software with different security levels in a multicore processor system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040177261A1 (en) * 2002-11-18 2004-09-09 Watt Simon Charles Control of access to a memory by a device
US20120144140A1 (en) * 2010-12-03 2012-06-07 Robert Bosch Gmbh Memory Protection Unit and a Method for Controlling an Access to a Memory Device
EP2570930A1 (en) * 2011-09-16 2013-03-20 Freescale Semiconductor, Inc. Memory management unit (MMU) having region descriptor globalization controls and method of operation
DE102014201682A1 (en) * 2014-01-30 2015-07-30 Robert Bosch Gmbh Method for coexistence of software with different security levels in a multicore processor system

Also Published As

Publication number Publication date
DE102015223757A1 (en) 2017-06-01

Similar Documents

Publication Publication Date Title
DE102007062745B4 (en) Device and method for fast and secure memory context change
WO2019072840A1 (en) Apparatus for protecting diagnosis commands to a controller, and corresponding motor vehicle
EP2907072B1 (en) Method for controlling separated running of linked program blocks and control device
DE102005021064B4 (en) Method and apparatus for protection against buffer overrun attacks
DE102010002472A1 (en) Method for verifying a memory block of a non-volatile memory
EP1804144A1 (en) Monitoring the control program of a control unit of a machine
DE10126281A1 (en) Program controlled unit
WO2017093029A1 (en) Method for operating a microcontroller
EP3695574A1 (en) Methods and system for controlling the access to an authentication-dependent function
DE10002204B4 (en) Method for protecting a microcomputer of a control device against manipulation of a program and device for carrying out the method
WO2015197544A1 (en) Method and circuit for preventing storage protection faults
DE102013209264A1 (en) Method for operating a communication module and communication module
WO2017089101A1 (en) Method for operating a microcontroller
DE102021201236A1 (en) Method for authenticating a message from an arithmetic unit, arithmetic unit, computer program and vehicle
DE102020207866A1 (en) Method for performing a secure start sequence of a control unit
EP1293858B1 (en) Method for protecting a microcomputer system against software manipulation
WO2018177720A1 (en) Method for controlling access of an electronic device to a system and security device
DE102009058754B4 (en) Method for reprogramming one or more control units of a vehicle and control unit
WO2018091334A1 (en) Method for the automatic and dynamic reconfiguration of a memory protection unit and microcontroller having a memory protection unit
EP4107592B1 (en) Method for producing software copy protection for a steering control device in a vehicle, steering control device and computer program product
DE102022203871A1 (en) control system
DE112020007053T5 (en) Control device and control method
DE102004050883B4 (en) System and procedure for the system
EP1274097A2 (en) Verification of data in a memory device
DE102022209778A1 (en) TECHNIQUES FOR MITIGATION OF MANIPULATION OF AN ONBOARD NETWORK

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16798691

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16798691

Country of ref document: EP

Kind code of ref document: A1