use syscall table hook, replace some GFP_ATOMIC to GFP_KERNEL - #32
Draft
5ec1cff wants to merge 16 commits into
Draft
use syscall table hook, replace some GFP_ATOMIC to GFP_KERNEL#325ec1cff wants to merge 16 commits into
5ec1cff wants to merge 16 commits into
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.
5ec1cff
force-pushed
the
syscallhook
branch
2 times, most recently
from
December 22, 2025 14:04
db69319 to
c563f00
Compare
5ec1cff
force-pushed
the
main
branch
4 times, most recently
from
December 30, 2025 03:23
b8623e1 to
290df4f
Compare
5ec1cff
force-pushed
the
main
branch
2 times, most recently
from
January 1, 2026 13:21
d729fef to
76ec0b9
Compare
5ec1cff
force-pushed
the
syscallhook
branch
2 times, most recently
from
January 3, 2026 01:18
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
5ec1cff
force-pushed
the
main
branch
4 times, most recently
from
March 3, 2026 05:23
af9284c to
a93f91c
Compare
5ec1cff
marked this pull request as draft
March 6, 2026 07:21
5ec1cff
force-pushed
the
main
branch
6 times, most recently
from
March 15, 2026 05:20
45955b9 to
683384c
Compare
5ec1cff
force-pushed
the
main
branch
2 times, most recently
from
July 8, 2026 09:04
9205850 to
dcf9b04
Compare
5ec1cff
force-pushed
the
main
branch
7 times, most recently
from
September 1, 2026 12:28
b2301b2 to
6a4cac0
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.