kernel: Fix compatibility with old and 32bit programs #2084
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.
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