Skip to content

feat(backend): add cve_2026_98260 posix timer route for Nothing Phone (3) - #1053

Merged
NickJi2019 merged 9 commits into
LSPosed:98260from
Octobersama:feat/cve-2026-98260
Dec 4, 2026
Merged

NickJi2019 merged 9 commits into
LSPosed:98260from
Octobersama:feat/cve-2026-98260

Conversation

@Octobersama

@Octobersama Octobersama commented Dec 3, 2026 •

Copy link
Copy Markdown

概述 / Summary

新增 CVE-2026-98260 backend 与 posix_timer_uaf route,并为 Nothing Phone (3)
Metroid(A024,C5.0-260924-2115)增加 6.6.127-android15-8-gf0987337fa35-ab15756704-4k
profile。

该 backend 使用 POSIX tick timer 的 UAF 写入原语完成:
W1 SELinux byte-fix → W1b panic_on_warn → W2 fake credential → W3 seccomp
(shell 入口通常跳过)→ root manager handoff。

设计、最终结构和例外记录见:
docs/analysis/cve-2026-98260-refactor-plan.md

设备与验证 / Device and evidence

  • 设备:Nothing Phone (3) / A024 / Metroid
  • 构建:C5.0-260924-2115(Android 17)
  • 内核:6.6.127-android15-8-gf0987337fa35-ab15756704-4k
  • 入口:Shizuku UserService(shell,Seccomp: 0)

实测结果:

  • KernelSU v3.3.1:uid=0 ... context=u:r:ksu:s0、kernelsu Live、Enforcing
  • APatch e5b8618(越狱模式):kernelpatch Live、APatch ready、Enforcing
  • SukiSU Nova:随机名 ksud 被识别、su uid=0、kernelsu Live、Enforcing
  • 每次运行后 /data/local/tmp 只剩系统项 bin.mt.plus、dalvik-cache;最终重启后无 root 模块、Enforcing

变更 / Changes

1. 契约 / Contract

  • wire:route id 4 posix_timer_uaf,backend id 3 cve_2026_98260
  • profile:可选 backend token;route.posix_timer_uaf 私有字段
  • Kotlin/native registry、profile schema、agreement tests 同步
  • 未改动既有 backend/route 的 wire 值

2. 后端 / Backend

  • 移植 tick-timer 触发、order-1 喷射、leak、fake credential 与 page keeper
  • W1/W1b/W2/W3 与既有 43499 使用同一 retry_stage 重试语义
  • handoff 统一到 session/manager_handoff:
    • app 通过 --manager-package 传 manager 包名
    • backend 解析 daemon、APatch module 并生成唯一 late-load 命令
    • route core 只负责 fork 并执行准备好的命令
  • route 只由 root_child × cve_2026_98260 × posix_timer_uaf 组合驱动

3. 结构重构 / Refactor

  • RoutePolicyList 包含全部路由;PI 攻击窗口使用 PiRoutePolicyList 子集
  • 1773 行 C 单体拆成 route/posix_timer/{trace,spray,cred},状态收敛到
    ptimer_state()
  • route lifecycle 只保留一个 ptimer_setup owner
  • app 两条入口共用 RunArtifacts 清理
  • 43499/98260 共用 session/backend/retry_stage.hpp

4. Profile

  • 新增 Metroid profile 与 index 注册
  • SUPPORTED_DEVICES{,_ZH} 增加 Nothing Phone (3)(A024),Shizuku recommended

Review 路线 / Suggested review route

  1. 设计边界

    • docs/analysis/cve-2026-98260-refactor-plan.md
    • 重点看 C primitive 的 §5.4 例外、process-lifetime ownership 和 out-of-scope list
  2. 契约与 wire

    • profile/model.h、profile/binary.cpp、profile-core/.../RouteKind.kt、
      PosixTimerConfig.kt、ComponentKind.kt
    • 测试:route_catalog_test / RouteCatalogAgreementTest、
      profile_binary_test、PosixTimerConfigTest
  3. 路由注册与调度

    • route/route_policy.hpp、route/component_catalog.hpp、
      route/orchestrator.hpp
    • 重点:canonical list 与 PI subset 的分离,43499 的实例化形状不变
  4. 98260 后端

    • session/backend/cve_2026_98260_backend.cpp
    • 按 W1 → W1b → W2 → W3 → handoff 阅读;对照 43499 的 shared helper
  5. 原语与 handoff

    • route/posix_timer/*:只看状态边界和 API,不要求逐行审 syscall 常量
    • session/manager_handoff.*:包名校验、APatch module 解析、失败关闭路径
  6. App/cleanup

    • RunArtifacts.kt、两条入口的 argv 与 cleanup 调用
  7. Profile/docs

    • Metroid profile、index、SUPPORTED_DEVICES、gate 文档

Commit 映射:

Commit 内容
ffb2eba0 contract:ids、profile schema、wire tests
45d5509f backend:98260 实现、route、catalog、gate 记录
344b09c0 profile:Metroid profile
f62ae279 contract fix:availability、field metadata、route agreement
ce3dd519 refactor:完整 registry + PI subset
62857bc0 refactor:primitive 拆分、handoff、shared retry
511ea966 refactor:app manager package + cleanup
63ff2777 docs:gate re-run
12f51720 docs:refactor plan

验证 / Verification

  • make -C src lsprivilege:0 error / 0 warning
  • make -C src lint-tidy:0 findings
  • cmp_disasm.py vs 9b51c391:6 个攻击函数全部 LAYOUT-SHIFT
    (仅标注的全局地址操作数不同),RESULT: PASS
  • host tests:route_policy_test、component_catalog_test、
    backend_contract_test、profile_binary_test、route_catalog_test 全 ok
  • :profile-core:test:ok
  • :app:testDebugUnitTest:99 tests,3 failed;三者均为既有 golden/fixture
    问题(NativeDocumentEquivalenceTest、ExporterAgreementTest、
    ProfileMigrationEquivalenceTest),在未改动的 upstream main 上同样失败
  • :app:assembleDebug:成功

兼容性与回滚 / Compatibility and rollback

  • wire v2 与 profile key 均为加法;旧 profile 继续默认 backend 1
  • 未修改 bootloader、分区或持久设备状态;只产生临时 /data 文件并在运行后清理
  • 回滚为 revert 本 PR 的提交;无数据迁移

已知边界 / Known limitations

  1. C primitive 保持 C 实现

    • 该文件是时序敏感的已验证 port;重写为 C++ 属于独立高风险变更
    • 已在计划文档按 engineering-standards §5.4 登记例外,并保留单一状态
      accessor、拆分文件、明确 process-lifetime ownership
  2. 43499 retry helper 未设备复测

    • 该改动由 host tests + cmp_disasm 覆盖;本目标设备的 profile 只验证
      98260,无法在设备上跑 43499 路径
  3. APatch module 解析

    • 优先使用 manager 已解出的 kernelpatch.ko;缺失时从 manager APK 的
      assets/androidNN-X.Y_kernelpatch.ko 解压
    • helper 失败时 backend 显式失败,不会继续盲目 handoff
  4. PR 规模

    • 包含 contract、backend、profile 与结构重构;如果维护者希望拆成 stacked
      PR,可按上表拆为 contract/backend/profile 与 refactor 两组

Checklist

  • L 级 plan 文档已提交
  • host tests / Kotlin tests / NDK build / clang-tidy
  • cmp_disasm
  • device gate(KernelSU / APatch / SukiSU Nova)
  • 临时文件清理
  • 未修改 kernelsnitch、LegacyProfileConverter、既有三条 route

- wire: route id 4 / route.posix_timer_uaf, backend id 3 / cve_2026_98260.
- profile: optional backend token, posix timer geometry fields, HOCON schema.
- app/profile-core plumbing and contract tests.
- ported tick-timer UAF trigger, spray, leak and fake credential primitives.
- registered root_child x cve_2026_98260 x posix_timer_uaf in the catalogue.
- KernelSU/APatch/Nova handoff with per-manager package and temp cleanup.
- design, device gate and verification records.
- 6.6.127-android15-8-gf0987337fa35-ab15756704-4k on C5.0-260924-2115.
- posix_timer_uaf geometry and cve_2026_98260 backend selection.
- index registration and supported-device tables.
- Kotlin availability now mirrors the native catalog for backend 3.
- PosixTimerConfig.Fields is the single posix field descriptor used by app validation.
- RouteCatalogAgreementTest pins ProfileConfig.Routes to RouteKind tokens.
- RoutePolicyList now contains all four routes for generic consumers.
- PiRoutePolicyList keeps the 43499 race window on its original three policies.
- route_policy_test covers the full registry and the PI default.
- Split the 1773-line ported primitive into trace/spray/cred units with one ptimer_state accessor.
- Move KernelSU/APatch/Nova command construction into session/manager_handoff; the core executes a prepared command.
- Add --manager-package and share the retry_stage helper across both backends.
- Remove the unused root-script write and duplicate route setup owner.
- Both entry paths forward the selected manager package to native.
- RunArtifacts owns the work dir and direct-run artifact cleanup, with logged failures.
- KernelSU, APatch and SukiSU Nova all passed after the handoff/core refactor.
- Temporary directories were clean after each run.
- Records the review findings, final structure and registered C primitive exception.
- Includes the verification matrix and explicit preservation list.
@Octobersama Octobersama changed the title probe feat(backend): add cve_2026_98260 posix timer route for Nothing Phone (3) Dec 3, 2026
Octobersama added a commit to Octobersama/LSPrivilege that referenced this pull request Dec 3, 2026
feat: add cve_2026_98260 posix timer route (fork mirror of LSPosed#1053)
@NickJi2019
NickJi2019 changed the base branch from main to 98260 December 4, 2026 13:25
@NickJi2019

Copy link
Copy Markdown
Collaborator

merge to another branch first

@NickJi2019
NickJi2019 merged commit 4aac6cd into LSPosed:98260 Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants