GithubHelp home page GithubHelp logo

secloak-kernel's Introduction

SeCloak: ARM Trustzone-based Mobile Peripheral Control

Overview

This is research prototype for the secure enforcement kernel used in the evaluation of our SeCloak system, as presented in our paper:

SeCloak: ARM Trustzone-based Mobile Peripheral Control Matthew Lentz, Rijurehkha Sen, Peter Druschel, Bobby Bhattacharjee MobiSys 2018 (International Conference on Mobile Systems, Applications, and Services)

SeCloak provides users with secure, "virtual" switches to control peripherals on their smart devices by providing a small, OS-agnostic enforcement layer that mediates untrusted accesses to devices.

Our prototype is based on OP-TEE, which is a open-source operating system for running trusted application using ARM TrustZone hardware security extensions. We heavily modified and reduced the codebase for our purposes. Specifically, we retained OP-TEE's kernel threading and debugging support, and the MMU code is also based on OP-TEE. The device drivers required for SeCloak (e.g., framebuffer and GPIO keypad), device tree parsing, instruction interception and emulation, and the code for securing device state was developed specifically for SeCloak. You learn more about OP-TEE, please see the OPTEE_README.md file.


Target Platform

We target the Boundary Devices Nitrogen6Q development board. While some parts of SeCloak are platform-agnostic (e.g., DT parsing, emulation), others such as the drivers were written specifically for this target platform.

You can find more information about the Nitrogen6Q board here.


Setup

  1. Update the UBoot version on the board. You can find the instructions here

  2. Assuming you are going to use Android/Linux in the non-secure world, you should follow the the instructions for setting up Android here, and then for building a custom Linux kernel here.

When building the custom Linux kernel, please checkout commit '1d9fc5c0d7' to serve as the base commit. Afterwards, apply the patch '0001-Modifications-to-run-Linux-in-the-non-secure-world-a.patch' included in the 'support' directory in this repository to enable Linux to operate in the non-secure world and expose interfaces for invoking SeCloak functionality via SMC instructions.

To build the Linux kernel and device tree blobs, you can run:

. setup_env.sh
make boundary_android_secpath_defconfig
make

This will generate the image for the kernel (as 'arch/arm/boot/zImage') and the device tree blob (as 'arch/arm/boot/dts/imx6q-nitrogen6x.dtb'). You will then place these files on the boot partition, replacing the existing files.

  1. To build the SeCloak kernel, you can run:
. setup_nitrogen6x.sh
make

This will generate a loadable image for the secure kernel (as 'out/arm-plat-imx/core/sImage'), which you will place on the boot partition as well.

  1. Configure a bootloader script to boot into the secure kernel. I included my script in the 'support/uboot' directory in this repository, with a Makefile to build the .scr file. Place the resulting sp_bootscript.scr file on the boot partition. In order to use the script, you should add the following UBoot environment variables:
setenv extbootargs 'mem=952m'
setenv loader 'load mmc 0:1'
setenv sp_boot 'setenv bootdev mmcblk0; ${loader} 0x10008000 sp_bootscript.scr && source 10008000'
savee

and then subsequently run the script via:

run sp_boot
  1. (Optional) I recommend using 'tftpboot' as the loader, which fetches the images to load over the network, instead of relying on updating the files on the MMC card.

secloak-kernel's People

Contributors

bogdan-liulko avatar cedric-chaumont-st avatar d3zd3z avatar delorme-jm avatar etienne-lms avatar glneo avatar guanchaoliang avatar jbech-linaro avatar jenswi-linaro avatar jforissier avatar liuyq avatar lorc avatar lws-team avatar mbriand avatar mrvan avatar pm215 avatar prime-zeng avatar seqlabs avatar sjaeckel avatar sorenb-xlnx avatar sunnyck avatar sunyanbang avatar sylvainpelissier avatar tbistm avatar vchong avatar xiaoqiangdu avatar yanyan-wrs avatar youssefesmat avatar zhizhouzh avatar zhupg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.