[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1033176: linux: Future Android/Waydroid support



I've worked on Waydroid support in Mobian and tried to keep our wiki article
(https://wiki.mobian-project.org/doku.php?id=waydroid) updated with installation
instructions from source.

In my opinion there are two main considerations regarding the binder modules:
1. Waydroid really wants to use binderfs as a replacement for the now legacy
method of predefining binder interfaces. From what I understand this isn't
really within the control of Waydroid but rather what Android expects of the
underlying kernel, but predefining the right ones when loading the module works
for now. I would expect this latter part could change in the future without much
notice from upstream (upstream in this case would be AOSP).
2. Until Waydroid is packaged for Debian we probably can't be expected to make
specific accommodations for Waydroid, given it's a very niche use case. On the
other hand Waydroid is almost essential for some Mobian users. Since Mobian aims
to reintegrate into Debian it's a problem we'll have to address sooner or later.

Both of these considerations would be easily solved by packaging Waydroid in
Debian. With official Debian packaging it would be possible to keep changes in
sync as they happen, in this case updating the binder interface names when
required by new versions of Waydroid. With official Debian packaging it would
also be easily justifiable to include the binder module in the Debian kernel
tree. Debian packaging of Waydroid and its dependencies mostly exists upstream
but with some trivial errors preventing easy builds.

With that in mind, until Waydroid is in the Debian repos I see two somewhat
readily available options:
1. Drop the "binder" string from CONFIG_ANDROID_BINDER_DEVICES and leave the
default value (which then becomes "binder,hwbinder,vndbinder"). This way we're
reducing the delta between the default linux config and makes Waydroid work out
of the box (for now). Supposedly this wasn't needed for some users where
Waydroid had explicitly loaded the module with the right device names, but that
does not match my experience on amd64 where I had to add 'options
binder_linux devices="binder,hwbinder,vndbinder"' to
"/etc/modprobe.d/binder-linux.conf".
2. Essentially option 1 but with binderfs enabled. This would ensure
compatibility with newer versions of Waydroid (with newer AOSP), at least for
the foreseeable future.

Option 2 is better in my opinion but currently "CONFIG_ANDROID_BINDERFS=y"
breaks compilation of "binder_linux" (modpost says "put_ipc_ns" and
"init_ipc_ns" is undefined). I don't know how easy of a fix this would be and I
would be more comfortable with having the modular build patch upstreamed to
ensure this is widely tested.

Ideally there would be a third option if the kernel could drop the legacy
device names entirely and only allow creation of devices through binderfs. In
that case I wouldn't see any reason to have this compiled as a module at all,
since there would be no devices to exploit security holes in without first
creating them through binderfs (and if you can create them without going through
Waydroid you probably have access to other exploitable code as well).

For reference, Mobian has both the current legacy device names in
CONFIG_ANDROID_BINDER_DEVICES and binderfs enabled.

Finally, it would be great if we could find someone who can take the role of a
Waydroid package maintainer. Updating the Mobian wiki on and off has proved to
me that I don't have the time to properly maintain the package, but I can assist
someone else in packaging it to the best of my abilities. I don't have enough
experience with Debian packaging to clean up the existing package without
assistance either but I think I have a decently good grasp of the Waydroid
internals at this point.


Reply to: