Skip to content

Ckb custom#258

Open
hugoxue1 wants to merge 9 commits intobmax121:mainfrom
hugoxue1:ckb-custom
Open

Ckb custom#258
hugoxue1 wants to merge 9 commits intobmax121:mainfrom
hugoxue1:ckb-custom

Conversation

@hugoxue1
Copy link
Copy Markdown

No description provided.

- supercall before/after: 不设 skip_origin,两路径均执行原始 brk,消除时序差异
- 新增 before_compat/after_compat: hook compat 32位表 nr45,对齐时间开销
- 防止 Hunter 等检测工具通过 64/32 位表时序差异识别 KernelPatch
- supercall.c: 新增 supercall_wrapper/supercall_slow_path/supercall_compat_wrapper
  用 fp_hook() 直接替换 sys_call_table[45],绕过 fp_hook_wrap transit 框架开销
  out-of-range cmd: tail-call 原始函数(零开销)
  in-range cmd + 非特权进程: uid 预检查后 tail-call(极小开销)
  #ifdef ANTI_SIDECHANNEL_V4 条件编译,可回退到 v3
- syscall.h: 新增 extern uintptr_t *sys_call_table/compat_sys_call_table 声明
问题:supercall_wrapper的uid预检查把APatch Manager的合法key验证请求也拦截了,
因为APatch Manager是普通app uid,不是root也不在su允许列表。
修复:in-range cmd直接进慢路径做key验证,不做uid预检查。
方案F的快速路径(out-of-range tail-call零开销)导致in/out ratio≈1.45被Hunter检测。
F2方案:所有cmd都走slow_path统一做strncpy+auth,消除in/out时间差异。
同时compat表也做统一路径对齐。
预期ratio→~1.0。
…+execve fp_hook+KPM callback(G7)+trampoline bug fix
当 su_path 改为 /system/bin/cu 时,/system/bin/su 仍然可用。
确保第三方 root 应用(RE、MT 管理器等)不受影响。

实现:IS_SU_PATH 宏同时匹配 current_su_path 和 LEGACY_SU_PATH(/system/bin/su)
覆盖 3 处匹配点:handle_before_execve、su_handler_arg1_ufilename_before、
sucompat_check_and_replace_path
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.

1 participant