Commit Graph

11 Commits

Author SHA1 Message Date
Anthony
a59d8a3b10 binder: call looked-up kernel functions through a push+ret trampoline with IBT
The kernel seals the ENDBR64 of functions it never calls indirectly
(kallsyms_lookup_name, can_nice, the security_binder_* hooks...), so
stepping back over ENDBR64 is not enough: there is none left, and the
indirect call still raises #CP when binderfs is mounted. Reach these
functions with push+ret, which IBT does not track.
2026-10-13 22:39:31 +02:00
Anthony
63e80d8ea7 binder: fix kallsyms_lookup_name address with X86_KERNEL_IBT
With IBT the kprobe address skips the ENDBR64 at function entry, so
calling it indirectly raises a control-protection fault (kernel BUG at
arch/x86/kernel/cet.c) the first time binderfs is mounted. Step back
over the ENDBR64 when it is there.
2026-10-13 22:28:42 +02:00
ssfdust
44e5ba79f5 Fixes for kernel 6.8 2024-02-10 08:49:38 +01:00
TheSola10
abead1debf Fixes for kernel 6.3+ 2023-06-18 16:49:05 +02:00
TheSola10
2325d6fe45 Fixed page fault by matching in-tree binder behavior 2022-09-11 19:24:41 +02:00
TheSola10
68444958fe Patches for kernel 5.19 2022-09-11 19:24:41 +02:00
Etaash Mathamsetty
2699623c48 patches for 5.18 kernel 2022-07-17 20:05:49 +02:00
Christian Hoff
516144c6a0 Compile fixes for kernels 5.11, 5.12 & 5.13 2021-10-29 17:50:10 +02:00
Christian Hoff
0338a34979 Update binder to the latest version
Over the last years, many fixes and changes have been applied to
Binder in the Linux kernel, but these fixes were never backported
to anbox-modules. The meant that the version of Binder in anbox-modules
was very outdated.

With this commit, Binder has been update to the latest state from
the Linux kernel. This should also fix the compile on kernel 5.12
and later.
2021-09-26 18:54:51 +02:00
Christian Hoff
4af9d5d591 Fix compilation of binder and ashmem on kernel 5.7 and later
On kernel 5.7 and later, kallsyms_lookup_name() can no longer be called from a kernel
module for reasons described here: https://lwn.net/Articles/813350/
As binder really needs to use kallsysms_lookup_name() to access some kernel
functions that otherwise wouldn't be accessible, KProbes are used on later
kernels to get the address of kallsysms_lookup_name(). The function is
afterwards used just as before. This is a very dirty hack though and the much
better solution would be if all the functions that are currently resolved
with kallsysms_lookup_name() would get an EXPORT_SYMBOL() annotation to
make them directly accessible to kernel modules.
2021-03-08 20:19:16 +01:00
Simon Fels
f3d77d660c Import kernel module source from original Anbox repository 2018-06-08 17:20:21 +02:00