Saeed Mirzamohammadi, Ardalan Amiri Sani, “Viola: Trustworthy Sensor Notifications for Enhanced Privacy on Mobile Systems “ in Proc. ACM MobiSys, June 2016 (PDF) (Link to the video).
In these instructions, we will show you how to set up Viola on Galaxy Nexus for microphone -> led blinking invariant and Nexus5 for camera -> vibrator invariant in Sections 1 and 2 respectively. You can also generate your own invariant check and also check out the proof in Section 3.
**Note: We have implemented our work based on Cyanogenmod. Cyanogenmod is discontinued. So we use the instructions for LineageOS which is its successor. In the instructions for LineageOS, simply replace every LineageOS with Cyanogenmod.
Follow the instructions in the link below to build CyanogenMod For Google Galaxy Nexus (GSM) (“maguro”) and apply the changes discussed below: https://wiki.lineageos.org/devices/maguro/build
We have built Viola on top of CyanogenMod version 10.1.3-RC1. So you have to apply the following changes in section 4.5 (Thanks to Seunghyun Choi):
repo init -u https://github.com/CyanogenMod/android.git -b cm-10.1 -m cm-10.1.3-RC1.xml
<project path="external/svox" name="platform/external/svox" groups="pdk-cw-fs" remote="aosp" revision="refs/tags/android-4.2.2_r1" />
Change your current directory to the android system kernel directory and check out Viola repository using the following instructions:
cd ~/android/system/kernel/samsung/tuna
git add remote viola_origin https://github.com/trusslab/Viola_tuna_kernel.git
git checkout Viola_tuna_v1
cd ~/android/system/external/tinyalsa
git add remote viola_origin https://github.com/trusslab/Viola_tinyalsa.git
git checkout Viola_tinyalsa_v1
The invariant implemented on Galaxy Nexus is the microphone -> led blinking invariant. You can test it using a recorder application on your Galaxy Nexus.
Follow the instructions here to build CyanogenMod For Google Nexus 5 (“hammerhead”):
https://wiki.lineageos.org/devices/hammerhead/build
Change your current directory to the android system kernel directory and check out Viola repository using the following instructions:
cd ~/android/system/kernel/lge/hammerhead
git add remote viola_origin https://github.com/trusslab/Viola_hammerhead_kernel.git
git checkout Viola_hammerhead_v1
The invariant implemented on Nexus5 is the camera -> vibrator invariant. You can test it using a camera application on your Nexus5.
Clone the source files with the command below:
git clone https://github.com/trusslab/Viola_InvariantChecks.git
Follow the instructions on README file to build the Coq files and to generate the invariant checks for ARM. Once you generated the checks, you can replace your generated .S file with the .S file already existing in ~/kernel/viola/, in the main directory of your kernel repository and then edit the Makefile accordingly.
You can also go over the proof files using the Coq Proof Assistant: https://coq.inria.fr/download
The work was supported in part by NSF Award #1617513.