SlideShare a Scribd company logo
Prabindh Sundareson
Memory Protection Features in ARM and Linux
Contents
• Security features in ARM HW
– Memory Protection
• Memory Protection Status in Software
– Linux
– Android
• External security frameworks
Memory Protection Features in ARM
• Derived from Page Table entries, applicable to different types of pages
– pages, sections …
• Consists of Read-Only (RO), and Execute Never (XN)
• This is available in ARMv6 and above systems, only with MMU enabled
• Memory protection is a combination of HW, Kernel usage of HW
features, and information embedded in userland applications by
toolchain for region protection
Execute Never (XN)
• Part of First and Second Level Page Table Entries
• A15 adds an extra entity - PXN (Privileged XN)
Read Only (RO)
• Part of AP and APX Data Access Permissions in Page Table entry
ARM First Level Descriptor
ARM Second Level Descriptor
Linux handling of Page Tables
• Linux standardises Page Table across architectures, independent of
specific HW – x86, ARM or other
– Linux bit encodings are different from that of ARM Page Table entries, but
mapping is straightforward to an extent
Native Linux – Memory Protection Status
Note –
1. All object files in an application have to be built with noexecstack, including assembly.
Even if one file is not built with this, the entire application is built without XN for the stack
2. Xorg, some media players in Linux are reported to have issues with XN in stack
3. This status is as of Sep 2012
Desired Mapping x86 Linux Kernel ARM Linux Kernel User Applications TI Confirmed
Kernel Code (.text) RO Yes (CONFIG_DEBUG_RODATA) No NA -
Kernel Read Only Data RO Yes (CONFIG_DEBUG_RODATA) No NA -
Kernel Stack XN Yes (CONFIG_DEBUG_RODATA) No NA -
User Stack XN NA NA
Applications to be
rebuilt with
noexecstack (all
.obj files, including
assembly)
gcc4.1x, glibc 2.5.
noexecstack is
default in gcc4.x
toolchains -
IO Region (Device) XN (MT_DEVICE) Yes Yes NA No
relro (Read-Only
relocations for shared
libraries) RO NA NA
Needs to be
explicitly enabled
in application build.
Linker makes text
read-only after
correct relocation -
gcc4.1x, glibc 2.5 No
Stack Layout
Randomisation randomisation Yes Yes - No
String Vulnerability String checks NA NA
format-security to
be added to
application builds
explicitly No
Other Security Techniques
• Commonly used are - grsecurity, PaX
• These are not in mainline Linux kernel including for ARM, and need to
be applied separately
• grsecurity provides kernel hardening features (ex devmem, ports)
• PaX provides memory protection features (including XN emulation)
• These also include patches for toolchains to ensure protection mapping
Android Status
• Starting from Android 2.3 onwards, Android adds
– Address space layout (ASLR) randomisations
– Support for XN
– Other features described in (http://source.android.com/tech/security/)
References
• MT_DEVICE ioremap
– http://lkml.indiana.edu/hypermail/linux/kernel/1108.2/02745.html
• GCC patch for GNU-STACK
– https://android.googlesource.com/toolchain/gcc/+/f68bf0c483879d30c4d97b9eaf8f9eb558ea1c45%5E1..f68bf0c483879d30c4d97b9eaf8f9e
• Russell King on .text RO
– http://www.spinics.net/lists/arm-kernel/msg120951.html
• Bypassing XN/ ASLR
– http://www.phrack.org/issues.html?issue=58&id=4#article
• Grsecurity Patchset for 3.x
– http://mirrors.muarf.org/grsecurity/stable/grsecurity-2.9-3.2.18-201206011935.patch.gz
• Gentoo Hardened
– http://www.gentoo.org/proj/en/hardened/pax-quickstart.xml
• Ubuntu Security
– https://wiki.ubuntu.com/Security
• ROM filesystems and booting
– http://elinux.org/images/b/b1/Filesystems-for-embedded-linux.pdf
– http://lugatgt.org/content/booting.inittools/downloads/presentation.pdf
– http://processors.wiki.ti.com/index.php/Creating_a_Root_File_System_for_Linux_on_OMAP35x#Configure_the_Linux_Kernel_f
or_RAMDISK_support
• Loadable Kernel Modules - introduction
– http://www.ibm.com/developerworks/linux/library/l-lkm
Linux Kernel References
• ELF loading
– arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c, fs/binfmt_elf.c
• Contains elf loading and protection settings based on elf information
• Page Table operations
• archarmincludeasmpgtable-2level-types.h
• archarmincludeasmpgtable-2level-hwdef.h
• archarmincludeasmpgtable.h
• archarmmmmmu.c

More Related Content

What's hot (20)

DOC
Type of Embedded core
mukul bhardwaj
 
PPTX
Linux Kernel I/O Schedulers
RajKumar Rampelli
 
PDF
OpenWrt From Top to Bottom
Kernel TLV
 
PPTX
Linux IO
Liran Ben Haim
 
PDF
ARM Architecture and Meltdown/Spectre
GlobalLogic Ukraine
 
PDF
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Anne Nicolas
 
PDF
Tuning systemd for embedded
Alison Chaiken
 
PPTX
Kernel Proc Connector and Containers
Kernel TLV
 
PDF
Linux Module Programming
Amir Payberah
 
PDF
Fun with FUSE
Kernel TLV
 
DOCX
Tier 2 net app baseline design standard revised nov 2011
Accenture
 
PDF
Architecture Of The Linux Kernel
guest547d74
 
PDF
Tuned
Reanimation Bk
 
PDF
Linux Kernel Platform Development: Challenges and Insights
GlobalLogic Ukraine
 
PDF
Linux Locking Mechanisms
Kernel TLV
 
PPT
Multi threaded rtos
James Wong
 
DOCX
Perf stat windows
Accenture
 
PDF
The Linux Kernel Scheduler (For Beginners) - SFO17-421
Linaro
 
PPTX
Hardware Probing in the Linux Kernel
Kernel TLV
 
PPTX
Linux Initialization Process (1)
shimosawa
 
Type of Embedded core
mukul bhardwaj
 
Linux Kernel I/O Schedulers
RajKumar Rampelli
 
OpenWrt From Top to Bottom
Kernel TLV
 
Linux IO
Liran Ben Haim
 
ARM Architecture and Meltdown/Spectre
GlobalLogic Ukraine
 
Kernel Recipes 2015: Solving the Linux storage scalability bottlenecks
Anne Nicolas
 
Tuning systemd for embedded
Alison Chaiken
 
Kernel Proc Connector and Containers
Kernel TLV
 
Linux Module Programming
Amir Payberah
 
Fun with FUSE
Kernel TLV
 
Tier 2 net app baseline design standard revised nov 2011
Accenture
 
Architecture Of The Linux Kernel
guest547d74
 
Linux Kernel Platform Development: Challenges and Insights
GlobalLogic Ukraine
 
Linux Locking Mechanisms
Kernel TLV
 
Multi threaded rtos
James Wong
 
Perf stat windows
Accenture
 
The Linux Kernel Scheduler (For Beginners) - SFO17-421
Linaro
 
Hardware Probing in the Linux Kernel
Kernel TLV
 
Linux Initialization Process (1)
shimosawa
 

Similar to ARM Linux Embedded memory protection techniques (20)

PDF
Android Security, From the Ground Up
Opersys inc.
 
PDF
Android Attacks
Michael Scovetta
 
PDF
Squash Those IoT Security Bugs with a Hardened System Profile
Steve Arnold
 
PDF
CNIT 127 14: Protection Mechanisms
Sam Bowne
 
PDF
CNIT 127 14: Protection Mechanisms
Sam Bowne
 
PDF
System Integrity
Vasily Sartakov
 
PPTX
Racing with Droids
Peter Hlavaty
 
PPTX
Ice Age melting down: Intel features considered usefull!
Peter Hlavaty
 
PPTX
History of Android Security – from linux to jelly bean
Jung Pil (J.P.) Choi
 
PDF
Brief Tour about Android Security
National Cheng Kung University
 
PDF
Cc4201519521
IJERA Editor
 
PDF
olibc: Another C Library optimized for Embedded Linux
National Cheng Kung University
 
PPTX
Operating Systems A-Z
RavinJ
 
PDF
Intra process memory protection for applications on ARM and x86
Priyanka Aash
 
PDF
You Can Run but You Can’t Read: Preventing Disclosure Exploits in Executable ...
ch0psticks
 
PPTX
The Benefits of POSIX
Whitfield Thomas
 
PPTX
128-ch4.pptx
SankalpKabra
 
PPTX
grsecurity and PaX
Kernel TLV
 
PPTX
Linux Improvements in Memory Corruption Based Protections
Vlatko Kosturjak
 
PDF
CNIT 128 Ch 4: Android
Sam Bowne
 
Android Security, From the Ground Up
Opersys inc.
 
Android Attacks
Michael Scovetta
 
Squash Those IoT Security Bugs with a Hardened System Profile
Steve Arnold
 
CNIT 127 14: Protection Mechanisms
Sam Bowne
 
CNIT 127 14: Protection Mechanisms
Sam Bowne
 
System Integrity
Vasily Sartakov
 
Racing with Droids
Peter Hlavaty
 
Ice Age melting down: Intel features considered usefull!
Peter Hlavaty
 
History of Android Security – from linux to jelly bean
Jung Pil (J.P.) Choi
 
Brief Tour about Android Security
National Cheng Kung University
 
Cc4201519521
IJERA Editor
 
olibc: Another C Library optimized for Embedded Linux
National Cheng Kung University
 
Operating Systems A-Z
RavinJ
 
Intra process memory protection for applications on ARM and x86
Priyanka Aash
 
You Can Run but You Can’t Read: Preventing Disclosure Exploits in Executable ...
ch0psticks
 
The Benefits of POSIX
Whitfield Thomas
 
128-ch4.pptx
SankalpKabra
 
grsecurity and PaX
Kernel TLV
 
Linux Improvements in Memory Corruption Based Protections
Vlatko Kosturjak
 
CNIT 128 Ch 4: Android
Sam Bowne
 
Ad

More from Prabindh Sundareson (20)

PDF
Synthetic Data and Graphics Techniques in Robotics
Prabindh Sundareson
 
PDF
Work and Life
Prabindh Sundareson
 
PPTX
GPU Algorithms and trends 2018
Prabindh Sundareson
 
PPTX
Machine learning in the Indian Context - IEEE talk at SRM Institute
Prabindh Sundareson
 
PDF
Students Hackathon - 2017
Prabindh Sundareson
 
PPTX
ICCE Asia 2017 - Program Outline
Prabindh Sundareson
 
PDF
Call for Papers - ICCE Asia 2017
Prabindh Sundareson
 
PDF
Technology, Innovation - A Perspective
Prabindh Sundareson
 
PDF
Open Shading Language (OSL)
Prabindh Sundareson
 
PDF
IEEE - Consumer Electronics Trends Opportunities (2015)
Prabindh Sundareson
 
PPTX
GFX part 8 - Three.js introduction and usage
Prabindh Sundareson
 
PPTX
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
Prabindh Sundareson
 
PPTX
GFX Part 6 - Introduction to Vertex and Fragment Shaders in OpenGL ES
Prabindh Sundareson
 
PPTX
GFX Part 5 - Introduction to Object Transformations in OpenGL ES
Prabindh Sundareson
 
PPTX
GFX Part 4 - Introduction to Texturing in OpenGL ES
Prabindh Sundareson
 
PPTX
GFX Part 3 - Vertices and interactions in OpenGL
Prabindh Sundareson
 
PPTX
GFX Part 2 - Introduction to GPU Programming
Prabindh Sundareson
 
PPTX
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
Prabindh Sundareson
 
PPTX
John Carmack talk at SMU, April 2014 - Virtual Reality
Prabindh Sundareson
 
PPTX
GFX2014 OpenGL ES Quiz
Prabindh Sundareson
 
Synthetic Data and Graphics Techniques in Robotics
Prabindh Sundareson
 
Work and Life
Prabindh Sundareson
 
GPU Algorithms and trends 2018
Prabindh Sundareson
 
Machine learning in the Indian Context - IEEE talk at SRM Institute
Prabindh Sundareson
 
Students Hackathon - 2017
Prabindh Sundareson
 
ICCE Asia 2017 - Program Outline
Prabindh Sundareson
 
Call for Papers - ICCE Asia 2017
Prabindh Sundareson
 
Technology, Innovation - A Perspective
Prabindh Sundareson
 
Open Shading Language (OSL)
Prabindh Sundareson
 
IEEE - Consumer Electronics Trends Opportunities (2015)
Prabindh Sundareson
 
GFX part 8 - Three.js introduction and usage
Prabindh Sundareson
 
GFX Part 7 - Introduction to Rendering Targets in OpenGL ES
Prabindh Sundareson
 
GFX Part 6 - Introduction to Vertex and Fragment Shaders in OpenGL ES
Prabindh Sundareson
 
GFX Part 5 - Introduction to Object Transformations in OpenGL ES
Prabindh Sundareson
 
GFX Part 4 - Introduction to Texturing in OpenGL ES
Prabindh Sundareson
 
GFX Part 3 - Vertices and interactions in OpenGL
Prabindh Sundareson
 
GFX Part 2 - Introduction to GPU Programming
Prabindh Sundareson
 
GFX Part 1 - Introduction to GPU HW and OpenGL ES specifications
Prabindh Sundareson
 
John Carmack talk at SMU, April 2014 - Virtual Reality
Prabindh Sundareson
 
GFX2014 OpenGL ES Quiz
Prabindh Sundareson
 
Ad

Recently uploaded (20)

PDF
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
PDF
UiPath on Tour London Community Booth Deck
UiPathCommunity
 
PPTX
Top Managed Service Providers in Los Angeles
Captain IT
 
PPTX
Lecture 5 - Agentic AI and model context protocol.pptx
Dr. LAM Yat-fai (林日辉)
 
PPTX
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PDF
Generative AI in Healthcare: Benefits, Use Cases & Challenges
Lily Clark
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
PDF
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
PDF
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
PDF
Integrating IIoT with SCADA in Oil & Gas A Technical Perspective.pdf
Rejig Digital
 
PDF
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PPTX
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 
OpenInfra ID 2025 - Are Containers Dying? Rethinking Isolation with MicroVMs.pdf
Muhammad Yuga Nugraha
 
UiPath on Tour London Community Booth Deck
UiPathCommunity
 
Top Managed Service Providers in Los Angeles
Captain IT
 
Lecture 5 - Agentic AI and model context protocol.pptx
Dr. LAM Yat-fai (林日辉)
 
python advanced data structure dictionary with examples python advanced data ...
sprasanna11
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Generative AI in Healthcare: Benefits, Use Cases & Challenges
Lily Clark
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Novus-Safe Pro: Brochure-What is Novus Safe Pro?.pdf
Novus Hi-Tech
 
Meetup Kickoff & Welcome - Rohit Yadav, CSIUG Chairman
ShapeBlue
 
Alpha Altcoin Setup : TIA - 19th July 2025
CIFDAQ
 
Integrating IIoT with SCADA in Oil & Gas A Technical Perspective.pdf
Rejig Digital
 
TrustArc Webinar - Data Privacy Trends 2025: Mid-Year Insights & Program Stra...
TrustArc
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Simplifying End-to-End Apache CloudStack Deployment with a Web-Based Automati...
ShapeBlue
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
Market Wrap for 18th July 2025 by CIFDAQ
CIFDAQ
 

ARM Linux Embedded memory protection techniques

  • 1. Prabindh Sundareson Memory Protection Features in ARM and Linux
  • 2. Contents • Security features in ARM HW – Memory Protection • Memory Protection Status in Software – Linux – Android • External security frameworks
  • 3. Memory Protection Features in ARM • Derived from Page Table entries, applicable to different types of pages – pages, sections … • Consists of Read-Only (RO), and Execute Never (XN) • This is available in ARMv6 and above systems, only with MMU enabled • Memory protection is a combination of HW, Kernel usage of HW features, and information embedded in userland applications by toolchain for region protection
  • 4. Execute Never (XN) • Part of First and Second Level Page Table Entries • A15 adds an extra entity - PXN (Privileged XN)
  • 5. Read Only (RO) • Part of AP and APX Data Access Permissions in Page Table entry
  • 6. ARM First Level Descriptor
  • 7. ARM Second Level Descriptor
  • 8. Linux handling of Page Tables • Linux standardises Page Table across architectures, independent of specific HW – x86, ARM or other – Linux bit encodings are different from that of ARM Page Table entries, but mapping is straightforward to an extent
  • 9. Native Linux – Memory Protection Status Note – 1. All object files in an application have to be built with noexecstack, including assembly. Even if one file is not built with this, the entire application is built without XN for the stack 2. Xorg, some media players in Linux are reported to have issues with XN in stack 3. This status is as of Sep 2012 Desired Mapping x86 Linux Kernel ARM Linux Kernel User Applications TI Confirmed Kernel Code (.text) RO Yes (CONFIG_DEBUG_RODATA) No NA - Kernel Read Only Data RO Yes (CONFIG_DEBUG_RODATA) No NA - Kernel Stack XN Yes (CONFIG_DEBUG_RODATA) No NA - User Stack XN NA NA Applications to be rebuilt with noexecstack (all .obj files, including assembly) gcc4.1x, glibc 2.5. noexecstack is default in gcc4.x toolchains - IO Region (Device) XN (MT_DEVICE) Yes Yes NA No relro (Read-Only relocations for shared libraries) RO NA NA Needs to be explicitly enabled in application build. Linker makes text read-only after correct relocation - gcc4.1x, glibc 2.5 No Stack Layout Randomisation randomisation Yes Yes - No String Vulnerability String checks NA NA format-security to be added to application builds explicitly No
  • 10. Other Security Techniques • Commonly used are - grsecurity, PaX • These are not in mainline Linux kernel including for ARM, and need to be applied separately • grsecurity provides kernel hardening features (ex devmem, ports) • PaX provides memory protection features (including XN emulation) • These also include patches for toolchains to ensure protection mapping
  • 11. Android Status • Starting from Android 2.3 onwards, Android adds – Address space layout (ASLR) randomisations – Support for XN – Other features described in (http://source.android.com/tech/security/)
  • 12. References • MT_DEVICE ioremap – http://lkml.indiana.edu/hypermail/linux/kernel/1108.2/02745.html • GCC patch for GNU-STACK – https://android.googlesource.com/toolchain/gcc/+/f68bf0c483879d30c4d97b9eaf8f9eb558ea1c45%5E1..f68bf0c483879d30c4d97b9eaf8f9e • Russell King on .text RO – http://www.spinics.net/lists/arm-kernel/msg120951.html • Bypassing XN/ ASLR – http://www.phrack.org/issues.html?issue=58&id=4#article • Grsecurity Patchset for 3.x – http://mirrors.muarf.org/grsecurity/stable/grsecurity-2.9-3.2.18-201206011935.patch.gz • Gentoo Hardened – http://www.gentoo.org/proj/en/hardened/pax-quickstart.xml • Ubuntu Security – https://wiki.ubuntu.com/Security • ROM filesystems and booting – http://elinux.org/images/b/b1/Filesystems-for-embedded-linux.pdf – http://lugatgt.org/content/booting.inittools/downloads/presentation.pdf – http://processors.wiki.ti.com/index.php/Creating_a_Root_File_System_for_Linux_on_OMAP35x#Configure_the_Linux_Kernel_f or_RAMDISK_support • Loadable Kernel Modules - introduction – http://www.ibm.com/developerworks/linux/library/l-lkm
  • 13. Linux Kernel References • ELF loading – arch/arm/kernel/elf.c b/arch/arm/kernel/elf.c, fs/binfmt_elf.c • Contains elf loading and protection settings based on elf information • Page Table operations • archarmincludeasmpgtable-2level-types.h • archarmincludeasmpgtable-2level-hwdef.h • archarmincludeasmpgtable.h • archarmmmmmu.c