当前位置:网站首页>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 .
边栏推荐
- Why is Huawei matebook x Pro 2022 leading a "laptop" revolution
- Combining strings and numbers using ssstream
- Viewing the ambition of Xiaodu technology from intelligent giant screen TV v86
- Application and routine of C language typedef struct
- [work with notes] NDK compiles the open source library ffmpeg
- [51nod.3210] binary Statistics (bit operation)
- Basic exercise of test questions Yanghui triangle (two-dimensional array and shallow copy)
- STM32 sensorless brushless motor drive
- The scientific innovation board successfully held the meeting, and the IPO of Kuangshi technology ushered in the dawn
- 【Unity】打包WebGL项目遇到的问题及解决记录
猜你喜欢

The scientific innovation board successfully held the meeting, and the IPO of Kuangshi technology ushered in the dawn
![[pytorch] kaggle large image dataset data analysis + visualization](/img/b0/7b8aff44d6bedd7ca2c705f13a8556.jpg)
[pytorch] kaggle large image dataset data analysis + visualization

【Unity】打包WebGL項目遇到的問題及解决記錄
![[learning notes] xr872 GUI littlevgl 8.0 migration (file system)](/img/9b/0bf88354e8cfdbcc1ea91311c9a823.jpg)
[learning notes] xr872 GUI littlevgl 8.0 migration (file system)

What did Hello travel do right for 500million users in five years?

C语言压缩字符串保存到二进制文件,从二进制文件读取压缩字符串后解压。

Review the history of various versions of ITIL, and find the key points for the development of enterprise operation and maintenance

ROS learning-7 error in custom message or service reference header file

如何解决通过new Date()获取时间写出数据库与当前时间相差8小时问题【亲测有效】

ROS learning -5 how function packs with the same name work (workspace coverage)
随机推荐
Using atexit to realize automatic destruct of singleton mode
Simple ranging using Arduino and ultrasonic sensors
Yovo3 and yovo3 tiny structure diagram
SWD debugging mode of stm32
拍拍贷母公司信也季报图解:营收24亿 净利5.3亿同比降10%
STM32 external interrupt Usage Summary
Build MySQL environment under mac
[analysis notes] source code analysis of siliconlabs efr32bg22 Bluetooth mesh sensorclient
10 days based on stm32f401ret6 smart lock project practice day 1 (environment construction and new construction)
The commercial value of Kwai is being seen by more and more brands and businesses
LeetCode每日一题——890. 查找和替换模式
[pytorch] kaggle large image dataset data analysis + visualization
Share three stories about CMDB
[learning notes] xr872 GUI littlevgl 8.0 migration (display part)
Record: how to solve the problem of "the system cannot find the specified path" in the picture message uploaded by transferto() of multipartfile class [valid through personal test]
Sensorless / inductive manufacturing of brushless motor drive board based on stm32
[keras learning]fit_ Generator analysis and complete examples
如何解决通过new Date()获取时间写出数据库与当前时间相差8小时问题【亲测有效】
Viewing the ambition of Xiaodu technology from intelligent giant screen TV v86
Top level configuration + cooling black technology + cool appearance, the Red Devils 6S Pro is worthy of the flagship game of the year