SlideShare a Scribd company logo
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
2018-10-23, ETAS Connections 2018, Stuttgart, Germany
Alexander Much, Alexander Mattausch
Is Linux ready for
safety related applications?
2
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Interesting times...
Is Linux ready for safety related applications?
Machine learning Crowd-sourced data System of systems Third party access
Evolution after SOPPersonalization Shortened
development cycles
New topics
new business models
?
3
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
We need to completely re-think the E/E architecture!
• Domain and then zonal architectures
• Centralized computing units
• High-speed, reliable and dependable networking
• Connected vehicle within an infrastructure eco-system
• The industry is losing with the approach „Adaptive is
just Classic on Linux“!
What comes first?
Philosophy: Mobile on wheels or wheels on mobile?
Is Linux ready for safety related applications?
Source: https://pxhere.com/en/photo/1064249, CC0 Public Domain
Cloud and mobile first!
4
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Most prominent answer of our „car“ guys:
„Of course, my car!“
People don‘t realize:
• How many security solutions are in today‘s phones
• Cloud and phones set the „state-of-the-art“
• ... not cars!
What needs to be „more“ secure?
Phone and cloud vs. vehicle
Is Linux ready for safety related applications?
Source: https://www.kompulsa.com/wordpress/wp-content/uploads/2018/06/bigstock-Cyber-security-information-
pr-205808125.jpg, CC0 Creative Commons
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
What is Linux?
6
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Linux is everywhere!
Is Linux ready for safety related applications?
7
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• First release 17 September 1991
• March 1994: release of version 1.0
• Linus Torvalds maintains the mainline kernel
• Development is driven by
• Kernel contains
– Process and thread handling
– Memory Management
– Networking and file systems
– Drivers
– …
• No application functionality is provided by the kernel!
Linux distributionLinux kernel
Is Linux ready for safety related applications?
What is meant by “Linux”?
• A “distribution” consists of the Linux kernel plus applications
• Size of a distribution varies from few hundred up to 50.000
software packages
• Many distributions are for special purposes:
– Servers and desktop PCs
– Embedded systems and IoT devices
– Special use cases, e.g. system administration, networking, …
• All packages are tightly coupled within a distribution
When using the term “Linux”, we refer to the kernel from now on.
8
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• Monolithic kernel
– All drivers run within and are distributed with the kernel
– ~25 Mio. lines of code
• Divided into various subsystems
– About 100 subsystem trees: e.g. networking, mm, x86, …
• DON’T BREAK USERSPACE !!!!!!
– Only new API functions are added, existing remain stable
– Further abstraction via glibc
• Internal API functions are volatile
– “mainline” functions are adapted by the kernel
maintainers
– “off-the-tree” kernel patches need to be adjusted by
patch providers
Architecture of the Linux kernel
Is Linux ready for safety related applications?
Source: http://www.makelinux.net/kernel_map/
9
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Cycle Changesets
4.15 14,866
4.16 13,630
4.17 13.541
4.18 13.283
4.19 13,657 (so far)
In 8 weeks of development for v4.19:
• 1,710 different contributors, 253 first-time contributors
• 307,000 lines added
For a start, e.g. read the report:
„2017 State of Linux Kernel Development”
A note on the community
Is Linux ready for safety related applications?
Source: https://lwn.net/Articles/767635/
Some people think: Linux is driven by „hobbyists“.
Today, it is super-professional and improving constantly.
Some people think: Linux is driven by „hobbyists“.
Today, it is super-professional and improving constantly.
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Linux development process?
(Some of you may be assessors,
well I am and I love it ;-))
11
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Merge window
• Patches are collected from subsystem
branches
• Duration: 2 weeks
Stabilization phase
• Testing of new kernel version
• Defect fixes
• New rc-Kernel releases every week
Stable branches
• Only bug fixes are merged to stable
branches
• Every release gets a new patch version
• Long-term support (LTS) kernels have a
dedicated maintainer
Linux development process
Is Linux ready for safety related applications?
4.4-rc1 4.4-rc2 4.4-rc3 4.4-rc4 4.4-rc5 4.4-rc6 4.4-rc7 4.4-rc8 4.5-rc1 4.5-rc24.3-rc7 4.4.04.3.0
4.4.1 4.4.2 4.4.3 4.4.4 4.4.54.3.1 4.3.2 4.3.3 4.3.4 4.3.5
Merge window Merge windowStabilization phase
Stable branch Stable branch (LTS)
12
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• Analyze fixes over time for LTS kernel version
• Predict bug evolution using statistical methods
– Assumptions: bugs follow a negative binomial distribution
– Take confidence interval of 95%
– Verify prognosis by randomly selecting subsets of the data
(“bootstrapping”)
• Prerequisites and assumptions
– Sufficient data points are available (i.e. high patch level)
– Every patch is a bug fix
• Can also be performed on individual subsystems
OSADL approach: statistical analysis
Is Linux ready for safety related applications?
Quality evolution of a LTS kernel
Source: Nicholas McGuire, OSADL SIL2LinuxMP project
13
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Courtesy of Nicholas McGuire, OSADL/SIL2LinuxMP project
• Analysis of all commits between 2.6.12-rc1 – 4.12-rc2
• Bugs introduced by individual developers related to their
overall number of commits
• Results of the analysis
– Risk of introducing a bug with first patch: ~3%
– Maximum at ~220 patches: ~6%
• Assumptions
– 35% of all patches have a „Fixes“ tag
Bug rate analysis of individual developers
Linux deveaIs Linux ready for safety related applications?lopment process
Quality assessment of contributions
14
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Involve two different parties:
• Linux kernel team
– analyze kernel bugs and their fixes
– Can be done generically
– Linux expert knowledge needed, possibly on certain submodules
• System architecture team
– Analyze impact of kernel bugs on systems
– Can the bug violate a safety requirement?
– System knowledge needed
– Needs to be done by project using the Linux kernel
Linux kernel monitoring team needs to be established!
Main content of root cause analysisRoot-cause analysis of bug fixes
Linux development process
Root cause analysis of kernel bugs
• Commit overview information
– Backport commit / up-stream commit on mainline
• Sources
– Findings – discussions on mailing lists (lkml.org)
– Related commits – backport to other LTS versions?
• Analysis of commit
– Analysis of behavioral change
– Bug introduction / bug detection
• Impact on Userspace and System
– Relevant for system analysis
• Measures for detection/avoidance
– Root cause identification, test case creation, static analysis…
• Open Actions
15
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• Developed specifically for the Linux kernel
• Allows verifying and modifying code according to “semantic
patches”
– Check for common programming fault
– Support and automate internal API changes
• Samples of error patterns that are checked (and corrected)
– Size of a pointer (8 patches)
– Move dereference to after a NULL test. (20 patches)
– Add missing kfree (34 matches)
– …
• Coccinelle check scripts are provided in the kernel repository
Usage of further analysis toolsCoccinelle – a static code analysis tool
Is Linux ready for safety related applications?
Analysis of the Linux kernel code
• SPARSE – semantic C checker (static)
– Developed by Linus Torvalds to support kernel development
– Used for type checking, lock checking etc.
• KASAN – Kernel address space sanitizer (dynamic)
– Verify access to freed memory and out-of-bounds access
– Uses compile-time instrumentation of GCC
• UBSAN – Undefined Behavior Sanitizer (dynamic)
– Compile-time instrumentation adding checks to the code
• Kmemleak/Kmemcheck (dynamic)
– Used for the detection of memory leaks by tracing memory
allocations
– Detection of uninitialized memory accesses in the kernel
(Dynamic checks are activated via kernel compilation switches)
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Process & Product: Product
17
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
The overall system (e.g. for autonomous driving) has ASIL-D
• The ASIL is on requirements, not on components
• Decomposition of requirements (!) and diverse redundancy in
system architecture (!)
 resulting in ASIL-B(D) requirements and subsystems
• Subsystems should be (mainly) fail-safe
• Safety requirements are realized as safety mechanisms and
safety integrity mechanisms
…from the software perspective…from a system perspective
Is Linux ready for safety related applications?
The target ASIL…
• Linux does follow a strict and professional software
development process, but not Automotive SPICE or ISO 26262
• Every kernel release is thoroughly tested by various companies
(Intel, ARM, Amazon, Google, Facebook, Microsoft, Netflix, Red
Hat, SuSE, IBM, Oracle, …)
• Allocation of safety integrity requirements only on:
– Spatial and temporal independence
– System and hardware integrity monitoring
Process approaches:
Follow OSADL SIL2LinuxMP project working on a SIL-2 certified Linux kernel for a reference project
18
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• Usage of MPU or MMU for spatial independence
– ?
• Usage of secondary time source, e.g. a windowed watchdog,
that is extended to timing and execution monitoring
 See e.g. Classic AUTOSAR watchdog stack
• Activating and using hardware fault detection mechanisms
• E2E protection of communication
Security mechanismsFreedom from interference mechanisms
Is Linux ready for safety related applications?
Freedom from interference vs. (?) security
• Usage of MMU for spatial independence
– Adding ASLR, stack protection, control flow integrity, asan and ubsan
sanitizers, automatic const, no read/exec pages, etc.
• Same, but add control flow integrity, monitoring of timing
attacks, integrity checks of external attacks on timing hardware
 internal knowledge, but cool stuff
• Monitoring attacks on hardware (resilience)
• Cryptographic signatures and encryption of messages
Security mechanisms are more expensive and complicated,
but much stronger than their Classic AUTOSAR counterparts for safety!
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Functional Safety Aspects
21
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• Fail-safe system
– A “Kernel Oops” is totally acceptable
– No change to Classic AUTOSAR ;-)
• ASIL-capable SoC
– SoC supports the target ASIL-B
– Next-gen
– Safety Manual for SoC is available and useful!
• External monitoring facility available
– E.g. external watchdog with separate time-base
System requirementsAssumptions to the system
Is Linux ready for safety related applications?
System approach for derivation of safety requirements
• 3-Level Hazop
– Technologically unaware (“safety goals”)
– Technologically aware, but unspecified (“functional requirements”)
– Analysis on implementation level (“technical requirements”)
• Input to software safety architecture and application design
– Goal: remove safety requirements from Linux kernel as far as possible
• Identify safety requirements that are actually applicable to the
Linux kernel
General design rule: Safety is a system property!
22
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
• Take results from HAZOP
• Identify affected Linux System Calls
• Specify requirements
– From man-pages
– From POSIX standard
• Derive test cases (requirements-based and interface testing)
– Identify possibly existing test cases (e.g. LTP)
– Check if IEC criteria are met (equivalence classes, boundary values)
– Extend or create new test cases
• Coverage measurement
– Tools exist, methodology yet open
(kcov kernel interface, LCOV/GCOV)
Test suites: Linux test projectApproach
Is Linux ready for safety related applications?
Verification of the Linux kernel and libraries
• Open-source test suite to verify the Linux kernel
• Started in 2000 by SGI
• Collaborators: IBM, Cisco, Fujitsu, SUSE, Red Hat, …
• Components under test:
– Open POSIX Test Suite
• POSIX interfaces and conformity
– Linux kernel tests
• Linux specifics (syscalls, file systems, memory, containers, …)
– Userland tools (cp, mv, cron, gzip, cpio, …)
– Networking
– Some CVEs
23
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Classic AUTOSAR
components
Distributed safety management
Safety & Security Aspects of Automotive High-Performance Controllers
Classic AUTOSAR
components
Lockstep
Safety OS
WDG
Core CoreCore Core
Safety
core
Safety
core
Core…. CoreCore
Health
control
Bootloader
Hypervisor
Privileged partition
Adaptive AUTOSAR on
Linux
Health manager
Vehicle functions partition
Adaptive AUTOSAR on Linux
Container
Vehicle
function
Virtual
resources
Container
Vehicle
function
Virtual
resources
Container
Vehicle
function
Virtual
resources
Pesistency
manager
Execution
manager
Health
manager
Diagnostic
manager
Virtual
resources
Physical resources
….
Classic AUTOSAR
Safety
core
Safety
core
Lockstep
Safety OS
WDG
Health
control
Classic AUTOSAR
Monitor Control
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
The “system” and outlook
25
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Generic Software Architecture
Is Linux ready for safety related applications?
AUTOSAR OS
Adaptive AUTOSAR
App App
High-performance computer
Classic AUTOSAR
Hypervisor
Adaptive AUTOSAR
App
POSIX OS POSIX OS
Trusted Execution
Environment
App
Trusted OS
Classic AUTOSAR
App
Safety cores
AUTOSAR Safety OS
New CPU-intensive
(safety-relevant)
functions:
e.g. sensor fusion
Novel user functions:
e.g. App Store
Reuse of existing
vehicle functions from
Classic AUTOSAR
(SWCs)
Secure startup,
authentication
Safety-relevant vehicle
functions, monitoring
of performance
partitions
Security partition Safety partition
Virtual machineVirtual machine Virtual machine
Performance cores
Secure Boot
Performance partitions
26
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
EB product line
Individual building blocks
Is Linux ready for safety related applications?
EB tresos
AutoCore OS
EB corbos
AdaptiveCore
App App
High-performance computer
EB tresos
AutoCore
EB corbos Hypervisor
EB corbos
AdaptiveCore
App
EB corbos Linux POSIX RTOS
Trusted Execution
Environment
App
Trusted OS
EB tresos
AutoCore
App
Safety cores
EB tresos
Safety OS
Security partition Safety partition
Performance cores
Secure Boot
Performance partitions
EB tresos Studio
Logging and debugging
EB corbos Studio
Code generation
Configuration
Application development
Integration and deployment
Tools
EB tresos EB corbos Services 3rd party
Software
Hardware
(SoC)
27
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Solutions for interesting times
Is Linux ready for safety related applications?
Machine learning
Crowd-sourced data System of systems
Third party access
Evolution after SOP
Personalization
Shortened development
cycles
New topics
new business models
?
High-assurance security
Automotive safety up to
ASIL-D
Real-time capable
Based on open-source
and established, well-
proven implementations
Long-term maintenance
and operations
28
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
Let‘s rant
Is Linux ready for safety related applications?
Some off-slide remarks before questions
(unfinished, but maybe worthwile…)
A remark from four days ago (!): https://www.zdnet.com/article/windows-10-will-banish-spectre-slowdowns-with-googles-retpoline-patch/
2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights.
www.elektrobit.com
alexander.much@elektrobit.com
Get in touch!

More Related Content

PPT
GPU Virtualization in Embedded Automotive Solutions
PDF
OpenStack Ironic - Bare Metal-as-a-Service
ODP
Q4.11: Porting Android to new Platforms
PDF
PDF
eBPF - Rethinking the Linux Kernel
PDF
Embedded Android : System Development - Part IV
PPTX
CloudStack Metering - Working with Usage Data #CCCNA14
PPT
Learning AOSP - Android Linux Device Driver
GPU Virtualization in Embedded Automotive Solutions
OpenStack Ironic - Bare Metal-as-a-Service
Q4.11: Porting Android to new Platforms
eBPF - Rethinking the Linux Kernel
Embedded Android : System Development - Part IV
CloudStack Metering - Working with Usage Data #CCCNA14
Learning AOSP - Android Linux Device Driver

What's hot (20)

PDF
Network Programming: Data Plane Development Kit (DPDK)
PDF
Introducing the Vitis Unified Software Platform for Programming FPGAs
PDF
X-Road. E-Estonia, el modelo racional de toma de decisiones.
PDF
DPDK & Layer 4 Packet Processing
PDF
Android Things : Building Embedded Devices
PDF
Embedded Android : System Development - Part II (HAL)
PDF
Introduction to eBPF and XDP
PDF
EB corbos and the L4Re microhypervisor: Open-source automotive safety
PDF
Kubernetes Networking with Cilium - Deep Dive
PDF
VLAN vs VXLAN
PDF
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
PPTX
Practical Packet Analysis: Wireshark
PDF
Cilium - Fast IPv6 Container Networking with BPF and XDP
PDF
Security Monitoring with eBPF
PDF
QNX Software Systems
PDF
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
PDF
Introduction to eBPF
PDF
Virtualization Architecture & KVM
PDF
Uboot startup sequence
PDF
PCI DSS en la Nube
Network Programming: Data Plane Development Kit (DPDK)
Introducing the Vitis Unified Software Platform for Programming FPGAs
X-Road. E-Estonia, el modelo racional de toma de decisiones.
DPDK & Layer 4 Packet Processing
Android Things : Building Embedded Devices
Embedded Android : System Development - Part II (HAL)
Introduction to eBPF and XDP
EB corbos and the L4Re microhypervisor: Open-source automotive safety
Kubernetes Networking with Cilium - Deep Dive
VLAN vs VXLAN
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Practical Packet Analysis: Wireshark
Cilium - Fast IPv6 Container Networking with BPF and XDP
Security Monitoring with eBPF
QNX Software Systems
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Introduction to eBPF
Virtualization Architecture & KVM
Uboot startup sequence
PCI DSS en la Nube
Ad

Similar to Is Linux ready for safety related applications? (20)

PPTX
Linux internals v4
PDF
Linux Kernel and Multimedia
PDF
Applying Linux to the Civil Infrastructure
PDF
Using open source software to build an industrial grade embedded linux platfo...
PDF
From Zero to Hero - Contribute to Linux Kernel in 15 Minutes
PDF
LinuxCon Europe 2013
PDF
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
PPSX
linux kernel overview 2013
PDF
Using Embedded Linux for Infrastructure Systems
PDF
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
PPTX
Design, Build,and Maintain the Embedded Linux Platform
PDF
CS8493-OS-Unit-5.pdf
PDF
Time is ready for the Civil Infrastructure Platform
PDF
Cs8493 unit 5
PPTX
Manage kernel vulnerabilities in the software development lifecycle
PDF
Embedded Linux primer
PDF
Linux for embedded_systems
PDF
Introduction to Linux
PPTX
Linux Operating System. UOG MARGHAZAR Campus
PDF
What's New in RHEL 6 for Linux on System z?
Linux internals v4
Linux Kernel and Multimedia
Applying Linux to the Civil Infrastructure
Using open source software to build an industrial grade embedded linux platfo...
From Zero to Hero - Contribute to Linux Kernel in 15 Minutes
LinuxCon Europe 2013
Embedded Webinar #13: "From Zero to Hero: contribute to Linux Kernel in 15 mi...
linux kernel overview 2013
Using Embedded Linux for Infrastructure Systems
TSC Sponsored BoF: Can Linux and Automotive Functional Safety Mix ? Take 2: T...
Design, Build,and Maintain the Embedded Linux Platform
CS8493-OS-Unit-5.pdf
Time is ready for the Civil Infrastructure Platform
Cs8493 unit 5
Manage kernel vulnerabilities in the software development lifecycle
Embedded Linux primer
Linux for embedded_systems
Introduction to Linux
Linux Operating System. UOG MARGHAZAR Campus
What's New in RHEL 6 for Linux on System z?
Ad

More from Alexander Much (6)

PDF
Safety and Security Aspects of Automotive High Performance Controllers
PDF
2017-05-31 Praxiswerkstatt Agilität und digitale Transformation
PDF
2017-05-10 Gate4SPICE: "Legacy Software"
PDF
20160706 Automotive SYS: "Evolving Needs for Software Systems - Demonstrated"
PDF
20160914 EuroSPI: "Automotive Security: Challenges, Standards and Solutions"
PDF
20161115 Agile in Automotive: "Balanceability is the new 'Agile'"
Safety and Security Aspects of Automotive High Performance Controllers
2017-05-31 Praxiswerkstatt Agilität und digitale Transformation
2017-05-10 Gate4SPICE: "Legacy Software"
20160706 Automotive SYS: "Evolving Needs for Software Systems - Demonstrated"
20160914 EuroSPI: "Automotive Security: Challenges, Standards and Solutions"
20161115 Agile in Automotive: "Balanceability is the new 'Agile'"

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
CH1 Production IntroductoryConcepts.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
DOCX
573137875-Attendance-Management-System-original
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PDF
Structs to JSON How Go Powers REST APIs.pdf
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
composite construction of structures.pdf
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Digital Logic Computer Design lecture notes
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Lesson 3_Tessellation.pptx finite Mathematics
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
CH1 Production IntroductoryConcepts.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
573137875-Attendance-Management-System-original
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Structs to JSON How Go Powers REST APIs.pdf
Mechanical Engineering MATERIALS Selection
Foundation to blockchain - A guide to Blockchain Tech
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
composite construction of structures.pdf
Arduino robotics embedded978-1-4302-3184-4.pdf
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Digital Logic Computer Design lecture notes
Internet of Things (IOT) - A guide to understanding
bas. eng. economics group 4 presentation 1.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS

Is Linux ready for safety related applications?

  • 1. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. 2018-10-23, ETAS Connections 2018, Stuttgart, Germany Alexander Much, Alexander Mattausch Is Linux ready for safety related applications?
  • 2. 2 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Interesting times... Is Linux ready for safety related applications? Machine learning Crowd-sourced data System of systems Third party access Evolution after SOPPersonalization Shortened development cycles New topics new business models ?
  • 3. 3 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. We need to completely re-think the E/E architecture! • Domain and then zonal architectures • Centralized computing units • High-speed, reliable and dependable networking • Connected vehicle within an infrastructure eco-system • The industry is losing with the approach „Adaptive is just Classic on Linux“! What comes first? Philosophy: Mobile on wheels or wheels on mobile? Is Linux ready for safety related applications? Source: https://pxhere.com/en/photo/1064249, CC0 Public Domain Cloud and mobile first!
  • 4. 4 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Most prominent answer of our „car“ guys: „Of course, my car!“ People don‘t realize: • How many security solutions are in today‘s phones • Cloud and phones set the „state-of-the-art“ • ... not cars! What needs to be „more“ secure? Phone and cloud vs. vehicle Is Linux ready for safety related applications? Source: https://www.kompulsa.com/wordpress/wp-content/uploads/2018/06/bigstock-Cyber-security-information- pr-205808125.jpg, CC0 Creative Commons
  • 5. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. What is Linux?
  • 6. 6 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Linux is everywhere! Is Linux ready for safety related applications?
  • 7. 7 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • First release 17 September 1991 • March 1994: release of version 1.0 • Linus Torvalds maintains the mainline kernel • Development is driven by • Kernel contains – Process and thread handling – Memory Management – Networking and file systems – Drivers – … • No application functionality is provided by the kernel! Linux distributionLinux kernel Is Linux ready for safety related applications? What is meant by “Linux”? • A “distribution” consists of the Linux kernel plus applications • Size of a distribution varies from few hundred up to 50.000 software packages • Many distributions are for special purposes: – Servers and desktop PCs – Embedded systems and IoT devices – Special use cases, e.g. system administration, networking, … • All packages are tightly coupled within a distribution When using the term “Linux”, we refer to the kernel from now on.
  • 8. 8 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • Monolithic kernel – All drivers run within and are distributed with the kernel – ~25 Mio. lines of code • Divided into various subsystems – About 100 subsystem trees: e.g. networking, mm, x86, … • DON’T BREAK USERSPACE !!!!!! – Only new API functions are added, existing remain stable – Further abstraction via glibc • Internal API functions are volatile – “mainline” functions are adapted by the kernel maintainers – “off-the-tree” kernel patches need to be adjusted by patch providers Architecture of the Linux kernel Is Linux ready for safety related applications? Source: http://www.makelinux.net/kernel_map/
  • 9. 9 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Cycle Changesets 4.15 14,866 4.16 13,630 4.17 13.541 4.18 13.283 4.19 13,657 (so far) In 8 weeks of development for v4.19: • 1,710 different contributors, 253 first-time contributors • 307,000 lines added For a start, e.g. read the report: „2017 State of Linux Kernel Development” A note on the community Is Linux ready for safety related applications? Source: https://lwn.net/Articles/767635/ Some people think: Linux is driven by „hobbyists“. Today, it is super-professional and improving constantly. Some people think: Linux is driven by „hobbyists“. Today, it is super-professional and improving constantly.
  • 10. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Linux development process? (Some of you may be assessors, well I am and I love it ;-))
  • 11. 11 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Merge window • Patches are collected from subsystem branches • Duration: 2 weeks Stabilization phase • Testing of new kernel version • Defect fixes • New rc-Kernel releases every week Stable branches • Only bug fixes are merged to stable branches • Every release gets a new patch version • Long-term support (LTS) kernels have a dedicated maintainer Linux development process Is Linux ready for safety related applications? 4.4-rc1 4.4-rc2 4.4-rc3 4.4-rc4 4.4-rc5 4.4-rc6 4.4-rc7 4.4-rc8 4.5-rc1 4.5-rc24.3-rc7 4.4.04.3.0 4.4.1 4.4.2 4.4.3 4.4.4 4.4.54.3.1 4.3.2 4.3.3 4.3.4 4.3.5 Merge window Merge windowStabilization phase Stable branch Stable branch (LTS)
  • 12. 12 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • Analyze fixes over time for LTS kernel version • Predict bug evolution using statistical methods – Assumptions: bugs follow a negative binomial distribution – Take confidence interval of 95% – Verify prognosis by randomly selecting subsets of the data (“bootstrapping”) • Prerequisites and assumptions – Sufficient data points are available (i.e. high patch level) – Every patch is a bug fix • Can also be performed on individual subsystems OSADL approach: statistical analysis Is Linux ready for safety related applications? Quality evolution of a LTS kernel Source: Nicholas McGuire, OSADL SIL2LinuxMP project
  • 13. 13 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Courtesy of Nicholas McGuire, OSADL/SIL2LinuxMP project • Analysis of all commits between 2.6.12-rc1 – 4.12-rc2 • Bugs introduced by individual developers related to their overall number of commits • Results of the analysis – Risk of introducing a bug with first patch: ~3% – Maximum at ~220 patches: ~6% • Assumptions – 35% of all patches have a „Fixes“ tag Bug rate analysis of individual developers Linux deveaIs Linux ready for safety related applications?lopment process Quality assessment of contributions
  • 14. 14 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Involve two different parties: • Linux kernel team – analyze kernel bugs and their fixes – Can be done generically – Linux expert knowledge needed, possibly on certain submodules • System architecture team – Analyze impact of kernel bugs on systems – Can the bug violate a safety requirement? – System knowledge needed – Needs to be done by project using the Linux kernel Linux kernel monitoring team needs to be established! Main content of root cause analysisRoot-cause analysis of bug fixes Linux development process Root cause analysis of kernel bugs • Commit overview information – Backport commit / up-stream commit on mainline • Sources – Findings – discussions on mailing lists (lkml.org) – Related commits – backport to other LTS versions? • Analysis of commit – Analysis of behavioral change – Bug introduction / bug detection • Impact on Userspace and System – Relevant for system analysis • Measures for detection/avoidance – Root cause identification, test case creation, static analysis… • Open Actions
  • 15. 15 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • Developed specifically for the Linux kernel • Allows verifying and modifying code according to “semantic patches” – Check for common programming fault – Support and automate internal API changes • Samples of error patterns that are checked (and corrected) – Size of a pointer (8 patches) – Move dereference to after a NULL test. (20 patches) – Add missing kfree (34 matches) – … • Coccinelle check scripts are provided in the kernel repository Usage of further analysis toolsCoccinelle – a static code analysis tool Is Linux ready for safety related applications? Analysis of the Linux kernel code • SPARSE – semantic C checker (static) – Developed by Linus Torvalds to support kernel development – Used for type checking, lock checking etc. • KASAN – Kernel address space sanitizer (dynamic) – Verify access to freed memory and out-of-bounds access – Uses compile-time instrumentation of GCC • UBSAN – Undefined Behavior Sanitizer (dynamic) – Compile-time instrumentation adding checks to the code • Kmemleak/Kmemcheck (dynamic) – Used for the detection of memory leaks by tracing memory allocations – Detection of uninitialized memory accesses in the kernel (Dynamic checks are activated via kernel compilation switches)
  • 16. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Process & Product: Product
  • 17. 17 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. The overall system (e.g. for autonomous driving) has ASIL-D • The ASIL is on requirements, not on components • Decomposition of requirements (!) and diverse redundancy in system architecture (!)  resulting in ASIL-B(D) requirements and subsystems • Subsystems should be (mainly) fail-safe • Safety requirements are realized as safety mechanisms and safety integrity mechanisms …from the software perspective…from a system perspective Is Linux ready for safety related applications? The target ASIL… • Linux does follow a strict and professional software development process, but not Automotive SPICE or ISO 26262 • Every kernel release is thoroughly tested by various companies (Intel, ARM, Amazon, Google, Facebook, Microsoft, Netflix, Red Hat, SuSE, IBM, Oracle, …) • Allocation of safety integrity requirements only on: – Spatial and temporal independence – System and hardware integrity monitoring Process approaches: Follow OSADL SIL2LinuxMP project working on a SIL-2 certified Linux kernel for a reference project
  • 18. 18 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • Usage of MPU or MMU for spatial independence – ? • Usage of secondary time source, e.g. a windowed watchdog, that is extended to timing and execution monitoring  See e.g. Classic AUTOSAR watchdog stack • Activating and using hardware fault detection mechanisms • E2E protection of communication Security mechanismsFreedom from interference mechanisms Is Linux ready for safety related applications? Freedom from interference vs. (?) security • Usage of MMU for spatial independence – Adding ASLR, stack protection, control flow integrity, asan and ubsan sanitizers, automatic const, no read/exec pages, etc. • Same, but add control flow integrity, monitoring of timing attacks, integrity checks of external attacks on timing hardware  internal knowledge, but cool stuff • Monitoring attacks on hardware (resilience) • Cryptographic signatures and encryption of messages Security mechanisms are more expensive and complicated, but much stronger than their Classic AUTOSAR counterparts for safety!
  • 19. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Functional Safety Aspects
  • 20. 21 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • Fail-safe system – A “Kernel Oops” is totally acceptable – No change to Classic AUTOSAR ;-) • ASIL-capable SoC – SoC supports the target ASIL-B – Next-gen – Safety Manual for SoC is available and useful! • External monitoring facility available – E.g. external watchdog with separate time-base System requirementsAssumptions to the system Is Linux ready for safety related applications? System approach for derivation of safety requirements • 3-Level Hazop – Technologically unaware (“safety goals”) – Technologically aware, but unspecified (“functional requirements”) – Analysis on implementation level (“technical requirements”) • Input to software safety architecture and application design – Goal: remove safety requirements from Linux kernel as far as possible • Identify safety requirements that are actually applicable to the Linux kernel General design rule: Safety is a system property!
  • 21. 22 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. • Take results from HAZOP • Identify affected Linux System Calls • Specify requirements – From man-pages – From POSIX standard • Derive test cases (requirements-based and interface testing) – Identify possibly existing test cases (e.g. LTP) – Check if IEC criteria are met (equivalence classes, boundary values) – Extend or create new test cases • Coverage measurement – Tools exist, methodology yet open (kcov kernel interface, LCOV/GCOV) Test suites: Linux test projectApproach Is Linux ready for safety related applications? Verification of the Linux kernel and libraries • Open-source test suite to verify the Linux kernel • Started in 2000 by SGI • Collaborators: IBM, Cisco, Fujitsu, SUSE, Red Hat, … • Components under test: – Open POSIX Test Suite • POSIX interfaces and conformity – Linux kernel tests • Linux specifics (syscalls, file systems, memory, containers, …) – Userland tools (cp, mv, cron, gzip, cpio, …) – Networking – Some CVEs
  • 22. 23 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Classic AUTOSAR components Distributed safety management Safety & Security Aspects of Automotive High-Performance Controllers Classic AUTOSAR components Lockstep Safety OS WDG Core CoreCore Core Safety core Safety core Core…. CoreCore Health control Bootloader Hypervisor Privileged partition Adaptive AUTOSAR on Linux Health manager Vehicle functions partition Adaptive AUTOSAR on Linux Container Vehicle function Virtual resources Container Vehicle function Virtual resources Container Vehicle function Virtual resources Pesistency manager Execution manager Health manager Diagnostic manager Virtual resources Physical resources …. Classic AUTOSAR Safety core Safety core Lockstep Safety OS WDG Health control Classic AUTOSAR Monitor Control
  • 23. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. The “system” and outlook
  • 24. 25 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Generic Software Architecture Is Linux ready for safety related applications? AUTOSAR OS Adaptive AUTOSAR App App High-performance computer Classic AUTOSAR Hypervisor Adaptive AUTOSAR App POSIX OS POSIX OS Trusted Execution Environment App Trusted OS Classic AUTOSAR App Safety cores AUTOSAR Safety OS New CPU-intensive (safety-relevant) functions: e.g. sensor fusion Novel user functions: e.g. App Store Reuse of existing vehicle functions from Classic AUTOSAR (SWCs) Secure startup, authentication Safety-relevant vehicle functions, monitoring of performance partitions Security partition Safety partition Virtual machineVirtual machine Virtual machine Performance cores Secure Boot Performance partitions
  • 25. 26 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. EB product line Individual building blocks Is Linux ready for safety related applications? EB tresos AutoCore OS EB corbos AdaptiveCore App App High-performance computer EB tresos AutoCore EB corbos Hypervisor EB corbos AdaptiveCore App EB corbos Linux POSIX RTOS Trusted Execution Environment App Trusted OS EB tresos AutoCore App Safety cores EB tresos Safety OS Security partition Safety partition Performance cores Secure Boot Performance partitions EB tresos Studio Logging and debugging EB corbos Studio Code generation Configuration Application development Integration and deployment Tools EB tresos EB corbos Services 3rd party Software Hardware (SoC)
  • 26. 27 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Solutions for interesting times Is Linux ready for safety related applications? Machine learning Crowd-sourced data System of systems Third party access Evolution after SOP Personalization Shortened development cycles New topics new business models ? High-assurance security Automotive safety up to ASIL-D Real-time capable Based on open-source and established, well- proven implementations Long-term maintenance and operations
  • 27. 28 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. Let‘s rant Is Linux ready for safety related applications? Some off-slide remarks before questions (unfinished, but maybe worthwile…) A remark from four days ago (!): https://www.zdnet.com/article/windows-10-will-banish-spectre-slowdowns-with-googles-retpoline-patch/
  • 28. 2018-10-23 | ETAS Connections 2018 | Public | © Elektrobit Automotive GmbH 2018 | All rights reserved, also regarding any disposal, exploitation, reproduction, editing, distribution, as well as in the event of applications for industrial property rights. www.elektrobit.com alexander.much@elektrobit.com Get in touch!