PeronGH/ghostlock-selinux-disabler

GitHub: PeronGH/ghostlock-selinux-disabler

利用 Linux 内核 CVE-2026-43499 漏洞,在 bootloader 锁定的 OnePlus Android 设备上仅通过一次写入操作禁用 SELinux enforcing 模式的精简 PoC 工具。

Stars: 2 | Forks: 1

# GhostLock SELinux Disabler 针对 [CVE-2026-43499](https://nvd.nist.gov/vuln/detail/CVE-2026-43499) 的仅 Write-1 版本,提取自 [JoinChang/ghostlock-oneplus](https://github.com/JoinChang/ghostlock-oneplus)。 它会在 bootloader 已锁定且存在漏洞的受支持 OnePlus 内核上禁用 SELinux 的 `enforcing` 模式,除此之外不做任何其他操作:没有 cred 覆盖,没有 root shell,没有 KernelSU,没有 bootstrap,也没有 KASLR 泄露。 ## 漏洞说明 CVE-2026-43499 是 Linux 内核在 futex PI requeue 路径中的一个 rtmutex use-after-free 漏洞。 在 proxy-lock 回滚期间,`remove_waiter()` 会对 `current` 进行操作,而不是 waiter 的 task,导致 waiter 的 `pi_blocked_on` 指针 悬空。该漏洞已在 Linux 6.12.86 及更新的 6.12 版本中在上游修复。 ## 功能说明 执行一次 child-node PI 写入: ``` fake_right = base + 0x100 -> byte0 = 0 (enforcing), byte1 = 1 ``` 它重用了完整漏洞利用中的 heap spray + `pselect` PI 路由,但绕过了 KASLR (`kaslr_slide = 0`)。它会最多重试 20 次(在尝试之间会进行 slab 耗尽操作), 并在 `/sys/fs/selinux/enforce` 读取为 `0` 时退出。 ## 从完整漏洞利用中移除的内容 | 移除项 | 原因 | |--------|--------| | `slide.c` | KASLR SLIDE 泄露 — 不需要(slide = 0) | | `pipe.c` | 基于 pipe 的物理读写 — 仅由 CFI/root 阶段使用 | | `root.c` | cred 修补 / `install_android_root` — 仅限 Write 2 | | `miniadb.c` | bootstrap mini ADB 客户端 — 未使用 | | `try_cfi_stage`, `install_child_root`, `repair/refresh/leak/restore` 辅助函数 (fops.c) | CFI / KASLR 泄露 / pipe 物理读写阶段 — 在自定义写入路径中永远不会到达 | | `perf_find_task`, `spawn_child`, `write_root_script`, `run_exploit`, `run_bootstrap` (main.c) | Write 2(cred → init_cred)、root shell、KSU、bootstrap | 共享的基础组件(`util.c` heap spray、`fops.c` pselect 路由、 `kernelsnitch` 和偏移量表)已被保留。 ## 测试过的内核 参见 `src/devices/offsets.h`,以 `uname -r` 为键: - OnePlus Ace 6T — `6.12.38-android16-5-...-ab14275539-4k` - OnePlus Ace 6T — `6.12.38-android16-5-...-ab14552068-4k` - OnePlus 15 — `6.12.23-android16-5-...-ab14541642-4k`(仅有偏移量,未经证实) ## 构建 ``` make # uses /opt/android-ndk (or $ANDROID_NDK_HOME) ``` 生成 `selinux_disabler`,这是一个适用于 Android API 35 的 aarch64 PIE。 ## 使用方法 ``` adb push selinux_disabler /data/local/tmp/a/e && chmod 755 /data/local/tmp/a/e adb shell /data/local/tmp/a/e ``` 验证: ``` adb shell cat /sys/fs/selinux/enforce # -> 0 ``` ## 添加设备 只需要 `boot.img`。使用上游项目的 [tools 目录](https://github.com/JoinChang/ghostlock-oneplus/tree/main/tools) 中的提取工具, 然后在 `src/devices//offsets.h` 下添加一个条目,并在 `src/devices/offsets.h` 中将其 `#include`。 ## 许可证 仅用于授权的安全研究和教育目的。
标签:Android, DSL, Web报告查看器, 内核漏洞, 安全渗透, 客户端加密, 权限管理, 模型越狱