Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KernelSU: Use scope-minimized manual hooks #27

Merged
merged 2 commits into from
Mar 13, 2025

Conversation

ChiseWaguri
Copy link
Contributor

This refactors original KSU hooks to replace deep kernel function hooks with targeted hooks. This backports KernelSU pr#1657 and having pr#2084 elements (32-bit sucompat). This transition reduces the scope of kernel function interception while still maintaining full functionality.

references: backslashxx/KernelSU#5, tiann/KernelSU#1657, tiann/KernelSU#2084
https://kernelsu.org/guide/how-to-integrate-for-non-gki.html

What do you think about this?

ChiseWaguri and others added 2 commits February 24, 2025 12:18
This refactors original KSU hooks to replace deep kernel function hooks with targeted hooks.
This backports KernelSU pr#1657 and having pr#2084 elements (32-bit sucompat).
This transition reduces the scope of kernel function interception while still maintaining full functionality.

references:  backslashxx/KernelSU#5, tiann/KernelSU#1657, tiann/KernelSU#2084
	https://kernelsu.org/guide/how-to-integrate-for-non-gki.html

Co-Authored-by: backslashxx <[email protected]>
- This was done to stay in line with upstream KSU
- Input hook for safemode now hooks input_event instead of input_handle_event
- Devpts hook now hooks pts_unix98_lookup in drivers/tty instead of patching fs/devpts

Co-Authored-By: backslashxx <[email protected]>
@Pzqqt
Copy link
Owner

Pzqqt commented Feb 24, 2025

I plan to abandon manual hooks in the future, because KernelSU officials are planning to completely abandon manual hook support and will only support kprobe in the future.

@Pzqqt Pzqqt closed this Feb 24, 2025
@ChiseWaguri
Copy link
Contributor Author

We are trying to keep manual hook alive,

tiann/KernelSU#2475, seems like weishu would keep the KPROBE guard

@ChiseWaguri
Copy link
Contributor Author

@Pzqqt Official kernelsu reverted the kprobe guards KernelSU@97b2411

@Pzqqt Pzqqt reopened this Mar 12, 2025
@Pzqqt
Copy link
Owner

Pzqqt commented Mar 12, 2025

@Pzqqt Official kernelsu reverted the kprobe guards KernelSU@97b2411

backslashxx/KernelSU#5

Make sure your pull request's code changes match this. If they match, I will merge it.

@Pzqqt Pzqqt merged commit fdee7f0 into Pzqqt:melt-rebase Mar 13, 2025
@ChiseWaguri ChiseWaguri deleted the pr_ksu_syscall-hook branch March 14, 2025 09:18
@backslashxx
Copy link
Contributor

@Pzqqt we can achieve pure syscall, but I do NOT think tiann will accept a small handler for it
(judging by tiann/KernelSU#2506 (comment) response)

whats needed is this
tiann/KernelSU@c288f36

but yeap, its not really that much different for what you have now, just something to keep in mind.
having everything on syscalls is a good thing as syscalls never change.

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.

3 participants