To run L-SAP you will need to download a version of the Linux kernel, build the kernel, map the kernel code in the Atlas program analysis framework, and finally invoke the L-SAP analysis.
Downloading the Source Code of Linux Kernel
You can download a specific Linux kernel versions from here. Or you can download any of the kernel versions used in the L-SAP paper: 3.17-rc1, 3.18-rc1, or 3.19-rc1.
Once downloaded, extract the downloaded linux-
tar -zxvf linux-<version>.tar.gz ~/linux-workspace/
Then, go to the directory /linux-workspace/linux-<version>/
cd ~/linux-workspace/linux-<version>/
Then, configure the Linux kernel with your own taste of configurations. To configure the Linux kernel with the same configurations as in the L-SAP paper, run the following command:
make allmodconfig
Analysis Configuration
-
Because indexing the Linux kernel with Atlas requires a lot of space, we recommend that you change the parameter
-Xmsand-Xmsin eclipse/eclipse.ini to bigger values according to your system. Note that Atlas provides a handy interface under theAtlas>Manage Project Settings>Advancedmenu. -
Run Eclipse and select
~/linux-workspace/directory as the current Eclipse workspace. -
Once Eclipse opens, go to
File>Import>Existing Code as Makefile Project. -
Next, browse to directory
~/linux-workspace/linux-<version>/and chooseLinux GCCas the Toolchain for Indexer Setting, then pressFinish. -
Right click on the imported Linux Kernel project and select
Properties. -
From
Atlas C/C++ Buildtab, click theEnable Atlas Error Parserbutton. Check (enable) the checkboxes corresponding toExistential IndexerandDataflow Indexer. -
From
C/C++ Buildtab, set theBuild commandtomake V=1, From theBehaviortab, set theBuild (Incremental build)field to the folder of interest to build (for example,drivers/). Finally, set theCleancommand tomrproper. -
From
C/C++ Buid/Settings/Error Parserstab, enable theAtlas Error Parser. -
Build the Linux kernel by right clicking on the Linux kernel project from Eclipse and selecting
Build Project. This process will take around 10 minutes if you have a powerful machine. -
Next map the Linux kernel in Atlas by selecting the Linux kernel project under
Atlas>Manage Project Settings, moving the project to theMapcolumn, and pressingSave & Re-map. Mapping the workspace will take some time (approximately 2-3 hours based on your machine). -
You are now ready to run L-SAP on the Linux kernel. Please, refer to the Tutorials page for more info on how to run L-SAP pairing analysis.
Once Atlas has mapped the Linux kernel, you can now run the analysis scripts.
Running L-SAP Analysis
First open the Atlas Shell to invoke L-SAP. To open the Atlas Shell from the Eclipse menu toolbar, navigate to Atlas > Open Atlas Shell.
Next run the L-SAP analysis. All the analysis logic reside in the Java class LinuxScripts. Before invoking the analysis scripts, you need to set the following flags/strings in code to your preferences:
-
SHOW_GRAPHSfield: if it is set to true, the script will produce the CFGs, MPGs, and EFGs for each signature in the lock/unlock pairing analysis. -
WORKSPACE_PATHfield: to determine the path where the analysis results will be written.
If you want to invoke the spin/mutex lock/unlock pairing analysis, then write into the Atlas Shell the respective commands:
var analysis = new LinuxScripts()
analysis.verifySpin(true)
For spin lock/unlock pairing analysis OR analysis.verifyMutex(true) for mutex lock/unlock pairing analysis. The true/false argument passed to each function correspond to whether to enable feasibility checking for the potentially-error paths if found.
The analysis results will written into WORKSPACE_PATH folder.
