-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
kernel: Fix compatibility with old and 32bit programs #2084
base: main
Are you sure you want to change the base?
Conversation
5fb13c1
to
c228c23
Compare
In order to be compatible with these applications that do not upgrade to 64-bit, we have to intercept these system calls on the devices of most users who probably won't even use these applications, which is very frustrating. |
NetHunter Terminal is an 64bit app but using 32bit binaries. |
In v0.9.3 and v0.9.4, we replaced `vfs_statx` and `do_execveat_common` with syscall hooks. But we missed `fstatat64` and `compat_execve` and break compatibility with old and 32bit programs. In NetHunter Terminal compat_execve is directly called, but `fstatat64` is called before it in JuiceSSH bash-4.2. So add these two hooks back to fix them. Signed-off-by: hamjin <[email protected]>
In v0.9.3 and v0.9.4, we replaced `vfs_statx` and `do_execveat_common` with syscall hooks. But we missed `fstatat64` and `compat_execve` and break compatibility with old and 32bit programs. In NetHunter Terminal compat_execve is directly called, but `fstatat64` is called before it in JuiceSSH bash-4.2. So add these two hooks back to fix them. Rissu's note: "I still thinking about this comment tiann#2084 (comment), i'll drop it if this changed." Co-authored-by: hamjin <[email protected]> Signed-off-by: Rissu <[email protected]>
In v0.9.3 and v0.9.4, we replaced `vfs_statx` and `do_execveat_common` with syscall hooks. But we missed `fstatat64` and `compat_execve` and break compatibility with old and 32bit programs. In NetHunter Terminal compat_execve is directly called, but `fstatat64` is called before it in JuiceSSH bash-4.2. So add these two hooks back to fix them. Rissu's note: "I still thinking about this comment tiann/KernelSU#2084 (comment), i'll drop it if this changed." Co-authored-by: hamjin <[email protected]> Signed-off-by: Rissu <[email protected]>
This commit integrates manual hooks for KernelSU, replacing the kprobe-based approach. 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 minimizes the scope of kernel function interception while still maintaining full functionality. references: tiann/KernelSU#1657, tiann/KernelSU#2084 https://kernelsu.org/guide/how-to-integrate-for-non-gki.html Co-Authored-by: backslashxx <[email protected]>
This commit integrates manual hooks for KernelSU, replacing the kprobe-based approach. 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 minimizes the scope of kernel function interception while still maintaining full functionality. references: tiann/KernelSU#1657, tiann/KernelSU#2084, backslashxx/KernelSU#5 https://kernelsu.org/guide/how-to-integrate-for-non-gki.html Co-Authored-by: backslashxx <[email protected]>
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]>
References: tiann/KernelSU#1657 and tiann/KernelSU#2084 Signed-off-by: Samuel Pascua <[email protected]>
This commit integrates manual hooks for KernelSU, replacing the kprobe-based approach. 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 minimizes the scope of kernel function interception while still maintaining full functionality. references: tiann/KernelSU#1657, tiann/KernelSU#2084, backslashxx/KernelSU#5 https://kernelsu.org/guide/how-to-integrate-for-non-gki.html Co-Authored-by: backslashxx <[email protected]>
References: tiann/KernelSU#1657 and tiann/KernelSU#2084 Signed-off-by: Samuel Pascua <[email protected]>
References: tiann/KernelSU#1657 and tiann/KernelSU#2084 Signed-off-by: Samuel Pascua <[email protected]>
References: tiann/KernelSU#1657 and tiann/KernelSU#2084 Signed-off-by: Samuel Pascua <[email protected]>
References: tiann/KernelSU#1657 and tiann/KernelSU#2084 Signed-off-by: Samuel Pascua <[email protected]>
References: tiann/KernelSU#1657 and tiann/KernelSU#2084 Signed-off-by: Samuel Pascua <[email protected]>
In v0.9.3 and v0.9.4, we replaced
vfs_statx
anddo_execveat_common
with syscall hooks. But we missedfstatat64
andcompat_execve
and break compatibility with old and 32bit programs.In one of the origin pull request(#1657), @tiann says "The compat_ series is not needed; because we don't support 32-bit ourselves; for the case of "kernel is 64-bit, but system is 32-bit", this situation did exist, but we have never provided a 32-bit manager, so it has never been supported, too." In fact, some 32bit binaries are still using compat syscalls to exec other programs.


In
kali
(NetHunter Terminal)__arm64_compat_sys_execve
is directly called, while__arm64_sys_fstatat64
is called before it in JuiceSSHlibcom_sonelli_bash.so
(32bit bash-4.2) like the strace in #1813.So add these two hooks back to fix them.
Fixes #2045, #1813