News for hackers. Stuff that matters.
Re:Android in Docker without QEMU/emulator by 0x0 on Tuesday January 04, 2022 @06:24AM (#29793665)
Interesting concept but seems to require custom android-specific kernel modules (ashmem, binderfs), which means the android containers aren't very containerized but leak into the host kernel.
Re:Android in Docker without QEMU/emulator by captn3m0 on Tuesday January 04, 2022 @07:12AM (#29793951)
All Linux containers leak the host kernel no?

The Anbox project relies on the exact same 2 modules: https://docs.anbox.io/userguide/install_kernel_modules.html. While these are "android-specific", they are present in the linux kernel tree, and even come pre-installed in Ubuntu 19.04 (and probably more distros).

Re:Android in Docker without QEMU/emulator by NotEvil on Tuesday January 04, 2022 @07:51AM (#29794164)
Not all linux kernel leak to host. Docker security is way better than nefore. And there also projects like podman and docker unprivileged that don't require any root intraction to set up a kernel
Re:Android in Docker without QEMU/emulator by captn3m0 on Tuesday January 04, 2022 @07:58AM (#29794207)
Depends on your definition of "leak" I suppose. You can't get a different kernel version inside a container so there must be a "leak" in some sense. Reducing capabilities etc will just leak lesser information about the system in general, but your kernel is always shared.
Re:Android in Docker without QEMU/emulator by j4hdufd8 on Tuesday January 04, 2022 @07:44AM (#29794116)
> All Linux containers leak the host kernel no?

Curious in what way?

Re:Android in Docker without QEMU/emulator by captn3m0 on Tuesday January 04, 2022 @07:55AM (#29794193)
See any explanation of what a linux container is[0]. Containers in linux are a patchwork of various features that "contain" a process group in different ways while sharing the kernel with the rest of the system.

Running either of

    docker run --rm --entrypoint /bin/uname alpine:latest -a
or

    uname -a
gives you the same kernel version. The only difference will be in the hostname.

[0]: https://embeddedbits.org/introduction-linux-containers/

Re:Android in Docker without QEMU/emulator by IceWreck on Tuesday January 04, 2022 @08:06AM (#29794269)
That's the difference between a container and a VM. VM runs its own kernel. A container relies on the host kernel and the host machine's kernel does all the scheduling, memory management, etc.
Re:Android in Docker without QEMU/emulator by pmontra on Tuesday January 04, 2022 @10:36AM (#29795849)
See the other replies and if you're on Linux run

  ps -ef
on the host and you'll see the processes in the containers too. That doesn't happen if those processes run in a VM.
Re:Android in Docker without QEMU/emulator by mkdirp on Tuesday January 04, 2022 @12:05PM (#29797034)
This is by design. The kernel still runs the processes inside the container. If you namespace the user running `ps`, it will not be able to see the container processes. The only reason you're seeing them is because you're in the default (root?) namespace.

The container on the other hand cannot see the host's processes or other things. At least not without an exploit.

Re:Android in Docker without QEMU/emulator by jeroenhd on Tuesday January 04, 2022 @06:28AM (#29793688)
The Docker container also needs to be run in privileged mode, so you should probably treat this as if it were an emulator running root. It does work around dependencies on VT-x and such, though, and cuts down on the performance overhead of virtualising an extra kernel.
Re:Android in Docker without QEMU/emulator by christophilus on Tuesday January 04, 2022 @07:29AM (#29794036)
Or try running it with podman.
Re:Android in Docker without QEMU/emulator by 2OEH8eoCRo0 on Tuesday January 04, 2022 @03:39PM (#29800104)
Sounds scary. That's a no from me dog.