Repository navigation
A05 cfi fix - #12
Open
Evolution1X wants to merge 3 commits into
Open
A05 cfi fix#12Evolution1X wants to merge 3 commits into
Evolution1X wants to merge 3 commits into
Conversation
added 3 commits
November 27, 2026 22:49
…Samsung 6.6 ksu_handle_stat_sucompat, ksu_handle_faccessat_sucompat and ksu_handle_execve_sucompat_common call ksu_syscall_table[orig_nr](regs). The entries they reach are our own __nocfi hooks, so the KCFI type check generated at those call sites has no matching hash to compare and traps: Internal error: BRK handler: 00000000f2008228 pc: ksu_handle_stat_sucompat+0x68/0x17c [kernelsu] x16: 000000009431df7f x17: 00000000b02b34d9 Mark the callers __nocfi, matching the existing convention in kernel/hook/syscall_event_bridge.c. Hit on SM-A055F (6.6.127-android15-8).
The LKM is compiled against DDK/GKI trees, which enable CFI, so every indirect call in kernelsu.ko carries a kCFI type check. Kernels can ship the opposite configuration (Samsung/MTK android15-6.6 on SM-A055F reports "# CONFIG_CFI_CLANG is not set"), and then neither their kernel functions nor our own __nocfi helpers carry a type hash: any indirect call out of a CFI-enabled module function traps with Internal error: BRK handler: 00000000f2008228 pc: ksu_handle_stat_sucompat+0x68/0x17c [kernelsu] Default stays CFI-enabled to match GKI; kernels without KCFI opt out with KSU_MODULE_CFI=0 instead of patching call sites one by one.
Kernels built with CONFIG_CFI_CLANG=n (Samsung/MTK android15-6.6 on SM-A055F) have no kCFI hashes, so a module compiled with checks traps on its first indirect call. Pass the toggle through to make; set module_cfi: '1' in the caller for GKI targets.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.