Android Binder
Android Interprocess Communication
Thorsten Schreiber
First Advisor: Juraj somorovsky
Second Advisor: Daniel Bu beta Meyer
When reading the android binder document, read:
1. the privileged level is called ring in English and must be supported by hardware. Intel hardware implements four privileged levels. Linux uses only 0 and 3.
2. Linux communication mechanism: signal, pipeline, socket, message queue, semaphore, and shared memory.
3. The meaning of native is that it can run programs on specific machine platforms, unlike Java running on virtual machines.
4. Dalvik vitual machine: different from JVM. JVM focuses on platform independence, while DVM focuses on arm adaptation, performance, and power consumption. The two have different design concepts.
1. privileged level
More than actly, the concept of security boundaries of an operating system introduces the term ring.
Note, that this must be a hardware supported feature of the platform. a certain group of rights is assigned to a ring.
Intel hardware supports four rings, but only two rings are used by Linux.
2. Linux Communication Mechanism
Signals
Oldest IPC method. A process can send signals to processes with
Same UID and GID or in the same process group.
Pipes
Pipes are unidirectional bytestreams that connect the standard output
From one process with the standard input of another process.
Sockets
A socket is an endpoint of bidirectional communication. Two processescan communicate with bytestreams by opening the same socket.
Message Queues
Processes can write a message to a message queue that is read-able for other processes.
Semaphores
A semaphore is a shared variable that can be read and written
Using processes.
Shared Memory
A location in system memory mapped into virtual address
Spaces of two processes, that each process can fully access.
3. native code
Programs compiled for a specific platform are called native.
Because Java is executed in a virtual machine with its own byte-code, no native code can be executed directly.
Due to the need to access low-level OS mechanic like kernel cals, Java has to overcome this obstacle.
This is done by the Java Native Interface (JNI), which allows Java to execute compiled code from libraries written in other languages ages, e.g. C ++.
4. Dalvik
The Sun JVM is stack based, because a stack machine can be run on every hardware. Hardware and platform independence were major design principles of Java.
The DVM is register based for performance reasons and well adapted to ARM hardware. this is a different design principle, taking the advantage of hardware independence for high performance and less power consumption, which is essential for mobile purposes
With limited battery capability.
The possibility to use the Java Native Interface weakens the Security guarantying property of Java to implicit checking the bounds of variables and to encapsulate system CILS and
The force to use JVM defined interfaces to the system.
The use of native libraries can allow bypassing the type and border checking of the Virtual Machine and opens the door to stack-overflow attacks.