# matisse-public — Redmi K50 Pro (MT6983) / kernel 5.10.209 Privilege Escalation and KernelSU Loading Record
> **English TL;DR** — A fully documented, from-scratch writeup + toolkit for obtaining `uid=0` with a
> kernel SID on a **Redmi K50 Pro (matisse, MediaTek MT6983, kernel 5.10.209)** and loading **KernelSU via
> LKM late-load**, without unlocking the bootloader. Full source is published on purpose: a root tool you
> cannot audit is a root tool you should not trust.
---
## Why Source Code is Fully Published
This repository does **privilege escalation**. Any closed-source tool that "gives you root" should be questioned:
it can equally well do other things quietly while you cannot verify. Therefore we **proactively publish all source code, log formats, failure processes and reproduction steps**, including:
- Complete exploit source code (`payload_src/`) — you can read line-by-line, compile yourself, compare hashes
- All scripts and criteria (`tools/`, `ksu_persist.sh`) — including **failed attempts**
- Real kernel panic excerpts (`evidence/`) — proving we encountered crashes and their root causes
- Build recipes and product hashes (`payload_src/mt87_build/BUILD_INFO.txt`, `SHA256SUMS`) — for you to verify
- Clear **scope boundaries and disclaimers** (see below)
**Does NOT contain**: any device identifiers (serial numbers / MAC addresses), personal data. Third-party derived code sources and licenses are **listed item-by-item in [`NOTICE.md`](NOTICE.md) and [`payload_src/PROVENANCE.md`](payload_src/PROVENANCE.md)**.
---
## Results (Verifiable)
| Item | Tested Evidence |
|---|---|
| `uid=0` | `su -c id` → `uid=0(root) gid=0(root) groups=0(root)` |
| **kernel SID** | Same line: `context=u:r:ksu:s0` |
| **KernelSU Loaded** | `/proc/modules` → `kernelsu … - Live` |
| Loader Log | `/data/local/tmp/ksu_go.log` → `uid=0` / `load_policy rc=0` / `late-load rc=0` / `modules: 1` |
| Device Intact | Same `boot_id` throughout, `uptime` increases continuously |
Full report: [WIN_20261003_1620_uid0_kernelsu.md](WIN_20261003_1620_uid0_kernelsu.md)
> **Verification**: Hashes of this repository's published artifacts are in [`SHA256SUMS`](SHA256SUMS); exploit product build recipes and expected sha256 are in
> [`payload_src/mt87_build/BUILD_INFO.txt`](payload_src/mt87_build/BUILD_INFO.txt). If you trust no binaries, use source code to compile yourself.
---
## What It Does (High Level)
1. **R Round**: Heap layout on `pselect`'s `fd_set`, combined with `rt_waiter` freed dangling `pi_blocked_on`
to trigger `rt_mutex_adjust_prio_chain` traversal, landing on a controlled write (`task->real_cred`).
2. **E5 Round**: Zero out SELinux enforcing (Per-Android `enforcing-8` write), enter Permissive.
3. **C Round**: Write `task->cred` (true `uid=0` + kernel SID).
4. **gate Branch** (this repository's key patch): At the **exact moment of acquiring `uid=0`**,
`system("sh /data/local/tmp/ksu_go.sh &")` — use official userspace loader `k`