BarriCCAde:
Isolating Closed-Source Drivers with ARM CCA
Matti Schulze, Christian Lindenmeier, Jonas Röckl
Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

1

ARM CCA

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

2

Attacker Model●●CCA offers protection from untrusted
software running „outside“ the R-VM
Attacker „inside“ the R-VM still a siginificant
dangerMatti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

3

Attacker Model●●●

CCA offers protection from untrusted
software running „outside“ the R-VM
Attacker „inside“ the R-VM still a siginificant
dangerMost privilege escalations stem fromvulnerable drivers

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

4

Attacker Model
●

●

●

●

CCA offers protection from untrusted
software running „outside“ the R-VM
Attacker „inside“ the R-VM still a siginificant
dangerMost privilege escalations stem fromvulnerable drivers
Apps can exploit these vulnerabilies

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

5

Attacker Model●●●

CCA offers protection from untrusted
software running „outside“ the R-VM
Attacker „inside“ the R-VM still a siginificant
dangerMost privilege escalations stem fromvulnerable drivers●

Apps can exploit these vulnerabilies●

Peripherals can trigger vulnerabilies

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

6

Attacker Model●●●

CCA offers protection from untrusted
software running „outside“ the R-VM
Attacker „inside“ the R-VM still a siginificant
dangerMost privilege escalations stem fromvulnerable drivers●Apps can exploit these vulnerabilies●Peripherals can trigger vulnerabilies

Monolithic Kernel => System
Compromise

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

7

Challenges●

State of the art solutions isolate
Drivers into VMs

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

8

Challenges●●

State of the art solutions isolate
Drivers into VMs
Add Interface to Drivers tocommunicate with the Kernel VM–

Forward Kernel requests–

Synchronize Resources

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

9

Challenges●●●

State of the art solutions isolate
Drivers into VMs
Add Interface to Drivers tocommunicate with the Kernel VM–

Forward Kernel requests–

Synchronize Resources

Problems:–

Adding Hypervisor to the TCB

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

10

Challenges●●●

State of the art solutions isolate
Drivers into VMs
Add Interface to Drivers tocommunicate with the Kernel VM–

Forward Kernel requests–

Synchronize Resources

Problems:–

Adding Hypervisor to the TCB–

What about closed-source Drivers?

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

11

Challenges●●●

State of the art solutions isolate
Drivers into VMs
Add Interface to Drivers tocommunicate with the Kernel VM–

Forward Kernel requests–

Synchronize Resources

Problems:–

Adding Hypervisor to the TCB–

What about closed-source drivers?

–How to actually filter out „evil“requests?

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

12

BarriCCAde

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

13

BarriCCAde●

Utilize CCA to not increase the TCB

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

14

BarriCCAde●●Utilize CCA to not increase the TCB
Expand the RMM to implement modules
handling–The setup of Driver-VMs

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

15

BarriCCAde●●

Utilize CCA to not increase the TCB
Expand the RMM to implement modules
handling–

The setup of Driver-VMs–

The synchronization of resources including
for closed-source drivers

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

16

BarriCCAde●●

Utilize CCA to not increase the TCB
Expand the RMM to implement modules
handling–

The setup of Driver-VMs–

The synchronization of resources including
for closed-source drivers–Configurable filtering of malicious accesses

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

17

BarriCCAde●●●Utilize CCA to not increase the TCB
Expand the RMM to implement modules
handling–The setup of Driver-VMs–

The synchronization of resources including
for closed-source drivers–Configurable filtering of malicious accesses

Expand other untrusted components asneededMatti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

18

BarriCCAde - Setup

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

19

BarriCCAde – Setup●

For resource synchronization memory
locations, size and semantics of theresources must be understood

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

20

BarriCCAde – Setup●●

For resource synchronization memory
locations, size and semantics of theresources must be understood
Kernel creates Sync-Config by analyzing
the used Kernel resources from the Driver
ELF

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

21BarriCCAde – Setup●●●

For resource synchronization memory
locations, size and semantics of theresources must be understood
Kernel creates Sync-Config by analyzing
the used Kernel resources from the Driver
ELF
Matches resources to the debug
information in the Kernel–Operands, size of operands, pointers, …

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

22

BarriCCAde – Setup●●●

For resource synchronization memory
locations, size and semantics of theresources must be understood
Kernel creates Sync-Config by analyzing
the used Kernel resources from the Driver
ELF
Matches resources to the debug
information in the Kernel–●Operands, size of operands, pointers, …

Evaluate recursively, load into Sync-M

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

23

BarriCCAde – Setup●Config gives hint how to filter accessess–e.g., prevent access to task structs–e.g., prevent accessess to resources notlisted in the config–…

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

24

BarriCCAde – Setup●●Config gives hint how to filter accessess–e.g., prevent access to task structs–e.g., prevent accessess to resources notlisted in the config–…

Manual effort

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

25

BarriCCAde – Setup●

Config gives hint how to filter accessess–e.g., prevent access to task structs–e.g., prevent accessess to resources notlisted in the config

–

…

●

Manual effort●Vendor provided

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

26

BarriCCAde – Setup●

Config gives hint how to filter accessess–e.g., prevent access to task structs–e.g., prevent accessess to resources notlisted in the config–…

●

Manual effort●Vendor provided●

Compile into eBPF Program and load into
Filter-M

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

27

BarriCCAde – Setup●

Load module via modprobe

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

28

BarriCCAde – Setup●Load module via modprobe●Forward bounds to Setup-M–Creates Driver-VM

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

29

BarriCCAde - Runtime

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

30

BarriCCAde – Runtime●At runtime, requests for Kernel/Driver resources must be forwarded accordingly

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

31

BarriCCAde – Runtime●At runtime, requests for Kernel/Driver resources must be forwarded accordingly●

Usually done via software added to the Driver=> What about a closed source scenario?

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

32

BarriCCAde – Runtime●At runtime, requests for Kernel/Driver resources must be forwarded accordingly●

Usually done via software added to the Driver=> What about a closed source scenario?

●

Mark module pages in kernel as inacessible via the RMM=> Accesses trapped to RMM

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany15.07.24

33

BarriCCAde – Runtime●At runtime, requests for Kernel/Driver resources must be forwarded accordingly●

Usually done via software added to the Driver=> What about a closed source scenario?

●Mark module pages in kernel as inacessible via the RMM=> Accesses trapped to RMM●

Copy Driver after relocation=> Kernel resources not mapped=> Accesses trapped to RMM

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

34

BarriCCAde – Runtime●At runtime, requests for Kernel/Driver resources must be forwarded accordingly●

Usually done via software added to the Driver=> What about a closed source scenario?

●Mark module pages in kernel as inacessible via the RMM=> Accesses trapped to RMM●Copy Driver after relocation=> Kernel resources not mapped=> Accesses trapped to RMM●

Trap context contains address accessed and state of the VM (e.g., params in registers)=> Implicitly contains all information needed for access forwarding

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

35

BarriCCAde – Runtime●Driver VM init function is called

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

36

BarriCCAde – Runtime●

Driver VM init function is called●

Accessess kernel function

1=> Not mapped=> Trap to RMM

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

37

BarriCCAde – Runtime●

Driver VM init function is called●

Accessess kernel function=> Not mapped

2=> Trap to RMM●Forward state, filter rules, config to theeBPF program

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

38

BarriCCAde – Runtime●●Extract information for accessed resourcefrom sync config
Synchronize resources according to configto kernel state

3Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

39

BarriCCAde – Status and Outlook●

Work in Progress●eBPF Filter fully functional●

Basic Sychronization implemented●

Prototype can load and execute dummy modules●

So far 2195 LOC added to TCB (1722 formally verified eBPF Interpreter, 473 „untrusted“)●Evaluation on real drivers TBD

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

40

BarriCCAde – Status and Outlook●Work in Progress●eBPF Filter fully functional●Basic Sychronization implemented●

Prototype can load and execute dummy modules●

So far 2195 LOC added to TCB (1722 formally verified eBPF Interpreter, 473 „untrusted“)●

Evaluation on real drivers TBD●

Improve (automatic) generation of Sync Configs●

Improve (automatic) generation of Filter Rules

Matti Schulze, IT Security Infrastructures Lab, FAU Erlangen-Nürnberg (FAU), Germany

15.07.24

41

SummaryThanks for your attention!

BarriCCAde is a step forward to isolating vulnerable drivers●Introduces novel resource synchronization technique based on
debug information and trap based access forwarding to target closed source drivers●
Allows detection and blocking of malicious behavior via eBPF-based filters●
Minimal TCB increase by relying on novel Confidential Computing Architectures●

Christian Lindenmeier, IT Security Infrastructures Lab, FAU Erlangen-Nürnbeg (FAU), Germany

July 8, 2024

42