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

[RFC] kernel: restore non-kprobe support, sucompat toggle for non-kp. #2475

Closed
wants to merge 5 commits into from

Conversation

backslashxx
Copy link
Contributor

@backslashxx backslashxx commented Feb 25, 2025

this will revert 500ff9b
"kernel: remove unused CONFIG guard becuase GKI kernel enable kprobe by default"

This pr can allow gki kernels to be built with manual hooks. It also comes with a port of
sucompat toggle for the sake of feature parity.

If this gets accepted, I also plan to get manual hooks guide on par with kprobes hook.
backslashxx#5

ofcourse, this will depend now on KernelSU policy, as this will re-introduce an ifdef hell.
This will make maintenance harder, you now have to keep track a lot of different states, etc etc,
but even if this does NOT get accepted, this can still be a demo on how you can have manual
hooks on gki kernels.

Restoring this will allow a user to build with manual hooks
even with kprobes enabled.

If a user uses manual hooks, he has to CONFIG_KSU_WITH_KPROBES=n
on his kernel config.

This is another take of 500ff9b.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
ext4_unregister_sysfs() on de29115
this is not really needed, if a user on 6.1 and further wants to hook vfs_statx
all he has to do is point to the proper member.

`ksu_handle_stat(&dfd, &filename->name, &flags);`

another is to hook vfs_fstatat or newfstatat instead
I have no idea if this is needed or any useful for manual hooks users.

While this is not exactly the same thing, this *CAN* achieve the same results.
The complete disabling of all KernelSU hooks.

While we can use a single variable for this, this is done like how vfs_read_hook,
input_hook and execve_hook are disabled, this will allow proper feature extension,
such as devpts hook toggling etc.

While this is probably not so useful for us, lets still port it for the sake
of feature parity.

Signed-off-by: backslashxx <118538522+backslashxx@users.noreply.github.com>
@ChiseWaguri
Copy link

+1, manual hooks are useful for both GKI and non-GKI users. Non-GKI users benefit from compatibility, while GKI users get an alternative. Supporting both keeps the flexibility, even if it turns into an #ifdef maze, just having the option is huge. I've been using manual hooks, even tho I am a gki user. ChiseWaguri/android_kernel_xiaomi_marble@3322eec

@hazepynut
Copy link

+1, manual hooks are useful for both GKI and non-GKI users. Non-GKI users benefit from compatibility, while GKI users get an alternative. Supporting both keeps the flexibility, even if it turns into an #ifdef maze, just having the option is huge. I've been using manual hooks, even tho I am a gki user. ChiseWaguri/android_kernel_xiaomi_marble@3322eec

+1

@tiann
Copy link
Owner

tiann commented Feb 25, 2025

Just reverting is fine; we don't want any extra complexity.

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.

4 participants