当前位置:网站首页>Think about the possibility of attacking secure memory through mmu/tlb/cache
Think about the possibility of attacking secure memory through mmu/tlb/cache
2022-06-13 02:12:00 【Code changes the world CTW】
Quick links :
.
Personal blog notes guide Directory ( All )
explain :
By default , This article is all about ARMV8-aarch64 framework
Related links :
ARM trustzone Learning and summary - One is enough
When designing the security architecture , We are Core and DDR There's an extra TZC As memory filter, The data stream is :Core ---> TZC---->DDR, Under this structure ,core Read / write to secure memory initiated as an unsecure , Will be TZC Block .

But this is in the ideal situation , in fact Core Initiate read / write to memory , Not necessarily through TZC Not necessarily DDR, It is possible to arrive at cache The stage is over , That is, data flow becomes Core ---> MMU(TLB+Addtress Translation)---->Cache, So in this case , No, TZC Thing , You might say MMU/Cache There are NS The bit , But you really understand here NS The use of bits ? If core When a read or write is initiated to a secure memory as an unsecure , I force MMU The security attribute flag bit in the page table is forcibly changed to NS=0, How will? ?

In fact, we just need to figure out the principle 、 Clear the data flow , Would not ask the above question S13 The problem. . Let's begin to analyze :
Suppose a security core Read a secure physical memory 0x2000_0000 data ( The virtual address may be 0x_xxxx_xxxx), Then there will be a behavior :
- Before reading and writing , It must be done MMU map, Such as physical address 0x2000_0000 MAP a 0x_xxxx_xxxx Address , here Page Descriptor Medium atrribute Medium
NS=0 - TLB Cache the translation , namely TLB Of entry Contained in the :
0x2000_0000、0x_xxxx_xxxx、NS=0 - Safe memory 0x2000_0000 The data will be cached to cache in ,entry Medium TAG contain
0x2000_0000、NS=0
meanwhile , I have a non safe core Initiate read / write virtual address 0x_yyyy_yyyy, I modify the table on this page by myself , Give Way 0x_yyyy_yyyy Force mapping to secure physical memory 0x2000_0000, There are two configurations :
(1)、0x_yyyy_yyyy—0x2000_0000, NS=0
(2)、0x_yyyy_yyyy—0x2000_0000, NS=1
Let's look at the two configurations respectively , Whether the safe memory can be read :
in the light of (1), Not safe core Initiate a visit , Find out TLB The entry in is 0x_yyyy_yyyy—0x2000_0000, NS=0, Nature will not be hit , And then use Address Translation transformation ,MMU Unsafe... Found Core To access security properties NS=0 Will be rejected directly .
in the light of (2), Not safe core Initiate a visit , because NS=1,TLB May be hit , That is, it can translate 0x2000_0000 Physical address , Even if you don't get hit , after Address Translation transformation , because NS=1, At this time, you can also correctly convert the correct 0x2000_0000 Physical address . Then I will go to cache Query this address in , But at this time cache Of entry Medium NS=0, therefore cache Will not be hit , The next step is to go TZC The flow , Obviously , You are a non safe core Want to access safe memory ,TZC Will stop you .
in summary : Safety is safety , Stop thinking about loopholes .
边栏推荐
- 华为设备配置双反射器优化虚拟专用网骨干层
- [51nod.3210] binary Statistics (bit operation)
- Get started quickly cmake
- I didn't expect that the index occupies several times as much space as the data MySQL queries the space occupied by each table in the database, and the space occupied by data and indexes. It is used i
- Why is "iFLYTEK Super Brain 2030 plan" more worthy of expectation than "pure" virtual human
- 华为设备配置私网IP路由FRR
- Basic exercise of test questions Yanghui triangle (two-dimensional array and shallow copy)
- ROS learning-6 detailed explanation of publisher programming syntax
- Day 1 of the 10 day smart lock project (understand the SCM stm32f401ret6 and C language foundation)
- Ruixing coffee moves towards "national consumption"
猜你喜欢

万字讲清 synchronized 和 ReentrantLock 实现并发中的锁
![[pytorch] kaggle image classification competition arcface + bounding box code learning](/img/1e/5e921987754da1e1750acdadb36849.jpg)
[pytorch] kaggle image classification competition arcface + bounding box code learning

Ruixing coffee moves towards "national consumption"

LabVIEW large project development tools to improve quality
![[the second day of actual combat of smart lock project based on stm32f401ret6 in 10 days] (lighting with library function and register respectively)](/img/f7/b2463d8ffe75113d352cae332046db.jpg)
[the second day of actual combat of smart lock project based on stm32f401ret6 in 10 days] (lighting with library function and register respectively)

Installing Oracle with docker for Mac

ROS learning-8 pit for custom action programming

Top level configuration + cooling black technology + cool appearance, the Red Devils 6S Pro is worthy of the flagship game of the year

Sensor: MQ-5 gas module measures the gas value (code attached at the bottom)

Luzhengyao, who has entered the prefabricated vegetable track, still needs to stop being impatient
随机推荐
Laptop touch pad operation
Configuring virtual private network FRR for Huawei equipment
Looking at Qianxin's "wild prospect" of network security from the 2021 annual performance report
[the fourth day of actual combat of stm32f401ret6 smart lock project in 10 days] voice control is realized by externally interrupted keys
Simple ranging using Arduino and ultrasonic sensors
The fastest empty string comparison method C code
Application and routine of C language typedef struct
ROS learning-6 detailed explanation of publisher programming syntax
Mac下搭建MySQL环境
Area of basic exercise circle ※
1000粉丝啦~
【LeetCode-SQL】1532. Last three orders
[the second day of the actual combat of the smart lock project based on stm32f401ret6 in 10 days] light up with the key ----- input and output of GPIO
Use mediapipe+opencv to make a simple virtual keyboard
LabVIEW大型项目开发提高质量的工具
js获取元素
[keras] generator for 3D u-net source code analysis py
[keras] train py
How to learn C language and share super detailed experience (learning note 1 -- basic data types of C language)
json,xml,txt