SlideShare a Scribd company logo
12/19/16 1
ARMv7-M
Memory Protection Unit
(MPU)
eXecution Never (XN) demo
Louie Lu
<me@louie.lu>
12/19/16 2
BitSec Demo
Memory protection using MPU
Each MPU can set 8 region on
Cortex-M4
To achieve program isolation
And, can set the region to
eXecution Never (XN)
12/19/16 3
BitSec Demo
12/19/16 4
BitSec Demo
PC 0x08008000
12/19/16 5
BitSec Demo
PC 0x08008000
If attacker put malicious code at
0x20004000, and set PC to
0x20004000
12/19/16 6
BitSec Demo
Then, CPU will try to fetch
0x20004000 value as next instruction
PC 0x20004000
12/19/16 7
BitSec Demo
Attack done.
PC 0x20004000
12/19/16 8
BitSec Demo
But If we setting MPU region
and set region not to execute
12/19/16 9
BitSec Demo
But If we setting MPU region
and set region not to execute
Base: 0x20004000, Size: 2 ** 12, Attr: 1000
Range: 0x20004000 ~ 0x20005000
MPU protect, XN is true
0x20004000
0x20005000
12/19/16 10
BitSec Demo
When PC value been changed to 0x20004008
CPU try to fetch 0x20004008
as next instruction
MPU protect, XN is true
PC 0x20004008
0x20004000
0x20005000
12/19/16 11
BitSec Demo
This invalid memory access will trigger MPU
then generate a
memory manage fault exception
MPU protect, XN is true
PC 0x20004008
0x20004000
0x20005000
12/19/16 12
BitSec Demo
It will handle by
mem_manage_fault_handler
to avoid attack
MPU protect, XN is true
PC 0x0800605E
mem manage fault handler
0x20004000
0x20005000

More Related Content

ODP
A tour of F9 microkernel and BitSec hypervisor
ODP
三分鐘送 first kernel patch (for 新手)
PPTX
The management-of-cancer-treating-the-underlying-problems-of-cancer(1)
PPTX
What is Chondrosarcoma
PPTX
What Are The Potential Complications Of Liposuction
PPTX
Saguiaran, lanao del sur
PPTX
B2 b marketing
PPTX
B2 b marketing part 1 prof abha wankhede
A tour of F9 microkernel and BitSec hypervisor
三分鐘送 first kernel patch (for 新手)
The management-of-cancer-treating-the-underlying-problems-of-cancer(1)
What is Chondrosarcoma
What Are The Potential Complications Of Liposuction
Saguiaran, lanao del sur
B2 b marketing
B2 b marketing part 1 prof abha wankhede

Similar to ARMv7-M MPU (Memory Protection Unit) XN example (20)

PDF
Bots.pdf
PDF
XBMC USB Controller for Media Center PCs
PDF
Datasheet of SEN-10061(JPEG Camera)
PDF
Powerful SoM based on i.MX 8M Mini processor for various embedded applications
PPTX
Chapter_01_See_Program_Running.pptx
PPTX
Multimedia Steganography
PDF
Lecture 5-Embedde.pdf
PPTX
utmippt
PPTX
IP Concept in LTE
PPTX
DTMF Mobile Operated Robot using Atmega16
PDF
Development Board for NXP i.MX 8M Quad Application Processors
PPT
presentation_microcontroller_1457634560_181219.ppt
PDF
Tft touch screen manufacturers
PDF
Introduction to Microprocessor lecture 01
PDF
MYS-8MMX Single Board Computer
PPTX
Chapter_01_See_Program_Running Yifeng Zhu
PPT
Microprocessor Presentation.ppt
PPT
Microprocessor Presentation.ppt
PDF
WiFi mesh network(ESP32 mStar and mesh topology)
DOCX
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Bots.pdf
XBMC USB Controller for Media Center PCs
Datasheet of SEN-10061(JPEG Camera)
Powerful SoM based on i.MX 8M Mini processor for various embedded applications
Chapter_01_See_Program_Running.pptx
Multimedia Steganography
Lecture 5-Embedde.pdf
utmippt
IP Concept in LTE
DTMF Mobile Operated Robot using Atmega16
Development Board for NXP i.MX 8M Quad Application Processors
presentation_microcontroller_1457634560_181219.ppt
Tft touch screen manufacturers
Introduction to Microprocessor lecture 01
MYS-8MMX Single Board Computer
Chapter_01_See_Program_Running Yifeng Zhu
Microprocessor Presentation.ppt
Microprocessor Presentation.ppt
WiFi mesh network(ESP32 mStar and mesh topology)
Customizable Microprocessor design on Nexys 3 Spartan FPGA Board
Ad

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Machine Learning_overview_presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
A Presentation on Artificial Intelligence
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Machine learning based COVID-19 study performance prediction
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Encapsulation theory and applications.pdf
Teaching material agriculture food technology
Empathic Computing: Creating Shared Understanding
Machine Learning_overview_presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
A Presentation on Artificial Intelligence
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Weekly Chronicles - August'25-Week II
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Machine learning based COVID-19 study performance prediction
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Group 1 Presentation -Planning and Decision Making .pptx
A comparative analysis of optical character recognition models for extracting...
Advanced methodologies resolving dimensionality complications for autism neur...
MYSQL Presentation for SQL database connectivity
Encapsulation theory and applications.pdf
Ad

ARMv7-M MPU (Memory Protection Unit) XN example