secloak - cs.umd.edu

34
SeCloak: ARM TrustZone-based Mobile Peripheral Control Matthew Lentz, Rijurekha Sen, Peter Druschel, Bobby Bhattacharjee

Upload: others

Post on 17-Jan-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: secloak - cs.umd.edu

SeCloak:ARM TrustZone-based

Mobile Peripheral ControlMatthew Lentz, Rijurekha Sen,

Peter Druschel, Bobby Bhattacharjee

Page 2: secloak - cs.umd.edu

Control Over Your DevicesPowerful sensing and communication capabilities But can be misused by malicious software!

Consider important scenarios: Journalists use airplane mode while meeting with source Turn off microphone to prevent snooping

Sensing CommunicationCamera

Microphone Location

Motion Orientation

NFC Bluetooth WiFi Cellular …

Page 3: secloak - cs.umd.edu

Users Have Limited ControlThere are two fundamental issues: Incomplete settings e.g., Motion sensors on Android No assurance that settings are enforced Platform shown to be hard to secure as a whole

Page 4: secloak - cs.umd.edu

Problem Statement

What is minimally required to give users secure control over their devices?

affecting usability or stability

changes to existing software

Without

Page 5: secloak - cs.umd.edu

SeCloak - “Secure Cloak”

What is minimally required to give users secure control over their devices?

Sensing CommunicationCamera

Microphone Location

Motion Orientation

NFC Bluetooth WiFi Cellular

SeCloak provides secure “virtual” switches to users

Page 6: secloak - cs.umd.edu

SeCloak - “Secure Cloak”

What is minimally required to give users secure control over their devices?

Sensing CommunicationCamera

Microphone Location

Motion Orientation

NFC Bluetooth WiFi Cellular

SeCloak provides secure “virtual” switches to users

Untrusted Apps & OS

SeCloak Enforcement

Page 7: secloak - cs.umd.edu

SeCloak Design

SeKernelSeCloakSettings App

Trusted

Untrusted

Page 8: secloak - cs.umd.edu

SeCloak DesignTrusted

Untrusted

SeKernelSeCloakSettings App

Provides UI similar to traditional settings menus

Communicates policy settings to SeKernel

Policy

Page 9: secloak - cs.umd.edu

SeCloak DesignTrusted

Untrusted

SeKernelSeCloakSettings App

Provides UI similar to traditional settings menus

Communicates policy settings to SeKernel

Secure (re)display and user confirmation of policy

Configure HW protections to disable untrusted access

Handle access faults to enforce user policy

Policy

Page 10: secloak - cs.umd.edu

SeCloak on ARM TrustZone

Kernel(e.g., Linux) SeKernel

SeCloakSettings App

Trusted

Untrusted

ARM TrustZone supports two “worlds” Isolates SeKernel from untrusted kernel and apps Allows SeKernel to configure hardware protections

Non-Secure (NS)World

Secure (S)World

Policy

SMC

Page 11: secloak - cs.umd.edu

Hardware Protections

Kernel(e.g., Linux) SeKernel

SeCloakSettings App

Trusted

Untrusted

SMC

IRQ Controller

IRQ

Set IRQ owner to Kernel or SeKernel

1

1

Page 12: secloak - cs.umd.edu

Hardware Protections

Kernel(e.g., Linux) SeKernel

SeCloakSettings App

Trusted

Untrusted

SMC

IRQ Controller

MMIO IRQ

Dev

System Bus

Firewall

DevSet IRQ owner to Kernel or SeKernel

1

2

1

Configure to deny accesses made by Kernel Reports access faults to SeKernel2

Page 13: secloak - cs.umd.edu

Hardware Protections

Kernel(e.g., Linux) SeKernel

SeCloakSettings App

Trusted

Untrusted

SMC

IRQ Controller

MMIO IRQ

Dev

System Bus

Firewall

DevSet IRQ owner to Kernel or SeKernel

1

2

1

Configure to deny accesses made by Kernel Reports access faults to SeKernel2

How do we securely identify theseprotection domains for devices?

Page 14: secloak - cs.umd.edu

Device Tree (DT)soc

aips2

uart3

bt

Bus

Peripheral

InterruptController

MMIO = <Addr, Size> IRQ = <28>

MMIO = <Addr, Size>

Device Tree specifies embedded hardware Each node represents a device

Nodes contain configuration properties

intc

Page 15: secloak - cs.umd.edu

DT with SeCloak Properties

Added Security and Class properties Security corresponds to HW firewall configuration Class associates a known setting name with a device

SeKernel verifies and parses a signed DT

Bus

Peripheral

InterruptController

Class = “Bluetooth”

soc

aips2

uart3

bt

MMIO = <Addr, Size> IRQ = <28> Security = <70>

MMIO = <Addr, Size>intc

Page 16: secloak - cs.umd.edu

Application Functionality

SeCloakSettings App

Page 17: secloak - cs.umd.edu

Example: Disabling Bluetooth

Kernel(e.g., Linux) SeKernel

SeCloakSettings App

SMC

Bluetooth DisabledCLOAK_SET([010…0])

Page 18: secloak - cs.umd.edu

Example: Disabling Bluetooth

Kernel(e.g., Linux) SeKernel

SeCloakSettings App

SMC

Bluetooth DisabledCLOAK_SET([010…0])

Policy could be modified bymalicious software!

Page 19: secloak - cs.umd.edu

SeKernel: Confirming Policy

1

2

3

4

Acquire the display and input devicesTurn on the LED to notify user that SeKernel is active

(Re)Display settings to user

Wait for user confirmation for whether to apply settings…

SeKernel CLOAK_SET([010…0])

Page 20: secloak - cs.umd.edu

SeKernel: Applying Policy

Class = “Bluetooth”

soc

aips2

uart3

bt

Bus

Peripheral

InterruptController

intc

i2c3

ft5x06Class = “Touchscreen”

CLOAK_SET([010…0])

Security = <70>Security = <25>

Page 21: secloak - cs.umd.edu

SeKernel: Applying Policy

Class = “Bluetooth”

soc

aips2

Bus

Peripheral

InterruptController

Security = <25>

intc

i2c3

ft5x06Class = “Touchscreen”

CLOAK_SET([010…0])

Security = <70>uart3

bt

Page 22: secloak - cs.umd.edu

Security = <25>

SeKernel: Applying Policy

Class = “Bluetooth”bt

Bus

Peripheral

InterruptController

intc

i2c3

ft5x06Class = “Touchscreen”

CLOAK_SET([010…0])

Security = <70>uart3

soc

aips2

Page 23: secloak - cs.umd.edu

Security = <25>

SeKernel: Applying Policy

Class = “Bluetooth”bt

Bus

Peripheral

InterruptController

intc

i2c3

ft5x06Class = “Touchscreen”

CLOAK_SET([010…0])

Security = <70>uart3

soc

aips2

Page 24: secloak - cs.umd.edu

SeKernel: Applying Policy

For all devices in the subtree: Secure and disable IRQs Configure firewall protections Setup fault handler for MMIO accesses

Bus

Peripheral

InterruptController

Class = “Bluetooth”

soc

aips2

bt

intc

i2c3

ft5x06Class = “Touchscreen”

Security = <25> uart3MMIO = <Addr, Size>IRQ = <28>Security = <70>

Page 25: secloak - cs.umd.edu

SeKernel: Fault Handling

Kernel(e.g., Linux)

SeKernel

MMIO

BT

System Bus

Firewall

Access Fault

What happens if the Kernel accesses a protected device?

Page 26: secloak - cs.umd.edu

SeKernel: Fault Handling

Kernel(e.g., Linux)

SeKernel

MMIO

BT

System Bus

Firewall

Access Fault

1 Determine instruction and data address

(LDR|STR) Reg, [Address]

From disassembling the instruction

From CPU fault information

Page 27: secloak - cs.umd.edu

SeKernel: Fault Handling

Kernel(e.g., Linux)

SeKernel

MMIO

BT

System Bus

Firewall

Access Fault

1 Determine instruction and data address

(LDR|STR) Reg, [Address]

From disassembling the instruction

From CPU fault information

2 Lookup and enforce policy for address

Allow

Deny

Issue LDR/STR & Optionally modify value

Discard STR / Return 0 for LDR

Set of devices with common security group (or) Device shared between NS/S worlds

Page 28: secloak - cs.umd.edu

EvaluationPrototype for Nitrogen6X board i.MX6 SoC with ARM Cortex A9 (1GHz)

SeKernel implemented in <15k LoC Based on pared-down OP-TEE OS Includes drivers for CSU, Framebuffer, GPIO, and Keypad

Benchmarks demonstrate reasonable overhead:

Instruction Time (µs)Execution Load (LDR) Store (STR)Baseline 0.11 0.29Emulated 1.14 1.19

Repeated accesses to WiFi controller register

Page 29: secloak - cs.umd.edu

Summary

Source code is available at:www.cs.umd.edu/projects/secureio

SeCloak enforces user-specified on/off control policiessmall enforcement kernel runs alongside any OS

Camera Microphone

Location Motion

Orientation …

NFC Bluetooth WiFi Cellular

Untrusted Apps & OS

SeCloak Enforcement

Page 30: secloak - cs.umd.edu

Backup Slides

Page 31: secloak - cs.umd.edu

SeKernel: LoC Breakdown

Page 32: secloak - cs.umd.edu

Micro: Emulated LDR/STRs

Page 33: secloak - cs.umd.edu

Macro: Emulated Wi-Fi

Page 34: secloak - cs.umd.edu

SeKernel: Emulation Details