
Android local privilege escalation for OnePlus Pad 3 Pro (OPD2513): posix-cpu-timers use-after-free yields uid 0, then loads KernelSU LKM for persistent root without unlocking bootloader.
简体中文 | English
Android local privilege escalation on the OnePlus Pad 3 Pro. The chain starts in a
shell context provided by Shizuku, uses a posix-cpu-timers use-after-free to obtain
uid 0, and then loads a kernel module through KernelSU in LKM mode. The result is a
root environment that supports su and module mounting.
The chain writes no partition, does not change the boot image, and does not touch vbmeta. A locked bootloader needs no unlock. SELinux stays Enforcing for the whole run.
| Item | Value |
|---|---|
| CVE | CVE-2026-98260 |
| Class | LPE (use-after-free, timerqueue rb-tree erase) |
| Device | OnePlus Pad 3 Pro OPD2513, ColorOS 17.0.0.105 (CN01) / Android 17 |
| Kernel | 6.12.69-android16-6-g242e1a07f878-ab15865446-4k |
| Profile | OPD2513 6.12.69, verified on one device only |
| SELinux | Enforcing |
| Bootloader | locked; no partition writes |
| Bridge | Shizuku 13.x (wireless debugging, uid 2000) |
| Root | KernelSU LKM late-load, KMI android16-6.12 |
| Component | Status | Result |
|---|---|---|
app/ (MagicRoot v2.1.0) | verified from a cold boot | Shizuku → exploit → uid 0 in u:r=ksu:s0 |
src/kernel_profile.h | OPD2513 profile added | call sites, selinux_state, 226-symbol table |
app/assets/ko-syms-6.12.69.txt | generated | 226 symbols, 0 missing |
| Module mount (bindhosts) | verified | /system/etc/hosts served after post-fs-data + soft reboot |
src/ exploit core and the profile table
kernel_profile.h per-release call sites, symbols and struct offsets
vuln_precheck.h profile and environment gate (--check / --force)
cve98260.c UAF trigger, cred overwrite, finit_module
ko_patch.c link-time symbol relocation and vermagic fixup
app/ Android app (MagicRoot)
src/.../MainActivity.java UI and chain orchestration
assets/run.sh on-device execution chain
assets/ko-syms-6.12.69.txt 226-symbol table for this kernel
devices/opd2513/ profile entry and symbol table for this device
upstream/ unmodified originals of the patched files
patches/opd2513.patch all changes against the upstream project
docs/
how-it-works.md exploit mechanics and design choices
porting.md porting method: symbol table and seven offsets
pitfalls.md observed ColorOS / Shizuku / late-load behaviour
troubleshooting.md symptom-indexed troubleshooting
limits.md reboot semantics, failure modes, recovery
upstream/ original documents from the upstream project
scripts/
setup.sh build the APK
doctor.sh build environment check
fetch-binaries.sh fetch kernelsu.ko and ksud
fetch-shizuku-jars.sh fetch the Shizuku compile-time jars
check-patches.sh verify patch and source are byte-identical
verify.sh independent check after escalation
release.sh build and publish a release
A non-leader thread creates a CLOCK_THREAD_CPUTIME_ID posix timer. After
de_thread(), execve() fails. The thread then exits through exit_itimers(),
which cannot disarm a timer whose task is already exiting. The kernel frees the
k_itimer while its timerqueue_node stays linked in the task's
posix_cputimers queue. When the parent reaps the zombie, release_task() calls
posix_cpu_timers_exit() and then cleanup_timerqueue(), which runs rb_erase()
on the freed node.
The erase is the write primitive. rb_erase() writes a controlled
__rb_parent_color value into a controlled rb_left target. The chain uses the
tracefs kmem events for KASLR resolution and slab/page reclaim, then applies three
writes to escalate and to load the module.
The mainline fix landed in 6.12.112
(d9ae467e617ca29b825493a362bf0d75ad5f4ac3). Kernel 6.12.69 predates it.
See docs/how-it-works.md and
docs/porting.md for the panic trace, the offset derivation and
the reclaim choreography.
Requirements: JDK 17+, Android SDK (build-tools 37.0.0, platform android-37) and the
Android NDK. Override the paths with ANDROID_SDK_ROOT and ANDROID_NDK_HOME. The
defaults target macOS with Homebrew.
./scripts/doctor.sh # check JDK / SDK / NDK / keystore
./scripts/fetch-binaries.sh # fetch kernelsu.ko and ksud at the pinned version
./scripts/setup.sh # -> MagicRoot-opd2513.apk
The repository does not ship kernelsu.ko or ksud. fetch-binaries.sh downloads
both from the official KernelSU release. fetch-shizuku-jars.sh downloads the
Shizuku compile-time jars from Maven Central.
CI (.github/workflows/build.yml) runs on tag pushes and manual dispatch: it
installs the pinned SDK/NDK, runs the full build, checks that four key entries are
present in the APK, and uploads the result as an artifact.
Before the build, setup.sh runs check-patches.sh. That script applies
patches/ to the unmodified originals in upstream/ and compares the result with
the source tree byte by byte. The build stops on any difference.
Prebuilt APK: see Releases.
Current version v1.0.0 (versionCode 8 / v2.1.0, 3.8 MB), installed and verified on
the target device.
curl -LO https://github.com/Haor/CVE-2026-98260-OPD2513/releases/download/v1.0.0/MagicRoot-opd2513.apk
adb push MagicRoot-opd2513.apk /data/local/tmp/mr.apk
adb shell 'su -c "pm install -r -g /data/local/tmp/mr.apk"' # when root is already available
Without root, use adb install -r. ColorOS shows a system install prompt in that
case.
The UI has one set of actions:
| Button | Action |
|---|---|
| 一键提权 | Check for leftovers → stage missing assets → run the exploit → load kernelsu.ko → install ksud → restore modules → offer a soft reboot |
| 授权 Shizuku | Request Shizuku permission. Needed after the first install or a reinstall |
| 部署资产 | Write scripts, symbol table, kernelsu.ko, ksud and the native library to /data/local/tmp/cveapp |
| 清理 | Delete the work directory. Refused while a PARKED marker or a leftover process exists |
| 验证 root | Run su -c id and show the uid and SELinux context |
| 软重启 | ksud soft-reboot. Keeps the kernel and root; makes module mounts take effect |
| 完整重启 | Reboot the system. Root is lost; PARKED and leftover processes are cleared |
Full flow after a cold boot:
wireless debugging -> Shizuku "start via wireless debugging" -> start
-> MagicRoot "一键提权"
-> "软重启" when modules are needed
Shizuku does not start at boot. Start it once after each full reboot. The starter
screen can stay on Waiting for service...; press back at that point, the service
is already up.
The output below comes from a cold-boot run on 2026-11-04. After a full reboot the
kernelsu module count was 0, and root and leftover processes were cleared. Shizuku
started as uid 2000. All steps ran on the device.
[+] plant3 burst hit=1 after 3ms
[+] plant3 reaped status=0x9
[child] setfsuid/setfsgid 0: prev=2000/2000 errno=0/0 uid=0 euid=2000
[child] finit_module(/data/local/tmp/cveapp/ksu-patched.ko)=0 errno=0
[ksu] kernelsu module live
[ksu] GRANT_ROOT rc=0 errno=0 uid=0 euid=0
[stage] uid=0 ctx=u:r=ksu:s0
[stage] ksud_install_rc=0 su_compat_rc=0 shell_su_adb_only_rc=0
[stage] enforce_rc=0 now=Enforcing
ROOT_STAGE_OK
KSU_CHAIN_OK
DONE
Device-side check: