use syscall table hook, replace some GFP_ATOMIC to GFP_KERNEL#32
Draft
use syscall table hook, replace some GFP_ATOMIC to GFP_KERNEL#32
Conversation
There was a problem hiding this comment.
Pull request overview
This PR replaces kprobe-based syscall hooking with direct syscall table modification for execve and read syscalls, and changes memory allocation flags from GFP_ATOMIC to GFP_KERNEL in SELinux policy functions. The change aims to improve reliability and performance by using syscall table hooks instead of kprobes.
- Replaced kprobe hooks with direct syscall table modifications for
sys_execveandsys_read - Changed
GFP_ATOMICtoGFP_KERNELfor memory allocations in SELinux policy manipulation functions - Added official manager APK signature verification alongside custom signature checks
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| kernel/ksud.c | Implements syscall table hooking mechanism replacing kprobe handlers; adds cache invalidation logic and removes kprobe-related work queues for execve and read hooks |
| kernel/selinux/sepolicy.c | Changes allocation flags from GFP_ATOMIC to GFP_KERNEL for kzalloc, kcalloc, kstrdup, and kvrealloc calls |
| kernel/apk_sign.c | Adds fallback check for official manager APK signature in addition to custom signature |
| kernel/Kbuild | Adds build-time detection for dcache invalidation API variant and defines official APK signature constants |
| kernel/Makefile | Adds CONFIG_KSU=m flag to module build command |
| .github/workflows/build-lkm.yml | Disables fail-fast strategy to allow all matrix builds to complete |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
db69319 to
c563f00
Compare
b8623e1 to
290df4f
Compare
d729fef to
76ec0b9
Compare
0376f48 to
171eb6e
Compare
backslashxx
added a commit
to backslashxx/KernelSU
that referenced
this pull request
Feb 5, 2026
since we are not on atomic context of any kind on ksud stage this can be done. though with allocations as many as this a memory pool can be considered? ref: 5ec1cff#32
af9284c to
a93f91c
Compare
829fa18 to
6a312d2
Compare
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.