protecting commodity operating system kernels from vulnerable device drivers

31
Protecting Commodity Operating System Kernels from Vulnerable Device Drivers Shakeel Butt*, Vinod Ganapathy*, Michael Swift ^ , Chih-Cheng Chang* 1 *Rutgers University, ^ University of Wisconsin, Madison

Upload: kordell

Post on 10-Jan-2016

27 views

Category:

Documents


0 download

DESCRIPTION

Protecting Commodity Operating System Kernels from Vulnerable Device Drivers. Shakeel Butt*, Vinod Ganapathy*, Michael Swift ^ , Chih-Cheng Chang*. *Rutgers University, ^ University of Wisconsin, Madison. Take home message. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Protecting Commodity Operating System Kernels from Vulnerable

Device Drivers

Shakeel Butt*, Vinod Ganapathy*, Michael Swift^, Chih-Cheng Chang*

1

*Rutgers University,^University of Wisconsin, Madison

Page 2: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Take home message

Vulnerable device drivers can be compromised to hijack control of

commodity operating systems

2

This talkNew security architecture to contain

vulnerable device drivers

Page 3: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

1. Device drivers dominate OS code base• Large percentage of OS is device driver code– 3.1 million out of 5.4 million LOC in Linux– 35K different drivers with over 112K versions in Win XP.

3

Page 4: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

2. Device drivers execute in kernel mode

4

KernelKernel Device DriverDevice Driver DeviceDevice

ApplicationsApplications

Device DriverDevice Driver DeviceDevice

Device DriverDevice Driver DeviceDevice

Page 5: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Vulnerable device driver

5

KernelKernel

Device DriverDevice Driver DeviceDevice

ApplicationsApplicationsMalformed InputMalformed Input

Page 6: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

3. Device drivers are vulnerable• Wireless drivers exploits in WinXP & OS X.– BroadCom, D-Link, NetGear [Cache 06]– Intel Wireless 2200BG & 2915ABG [Bulygin 07]– OS X Atheros driver [Maynor 07]

• Device drivers contain more bugs than kernel.

6

Page 7: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Outline

• Introduction• Background• Our Architecture• Evaluation• Summary

7

Page 8: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Related Work

• Driver isolation systems– Nooks [Swift 03]– SafeDrive [Zhou 06]

• User-level drivers– Windows UMDF– Linux User-Level Device Drivers [Leslie 05]

• Hybrid– Microdrivers [Ganapathy 08]

8

Page 9: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Microdrivers

9

KernelKernel

K-DriverK-DriverDeviceDevice

ApplicationsApplications

Device DriverDevice DriverU-driverU-driver

Page 10: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Benefit # 1: Reduced code in kernel

10

KernelKernel

K-DriverK-Driver DeviceDevice

ApplicationsApplications U-driverU-driver

Reduced in-kernel device drive codeReduced in-kernel device drive code

Page 11: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Benefit # 2: Compatibility

11

KernelKernel

K-DriverK-Driver DeviceDevice

ApplicationsApplications U-driverU-driver

Same interface with the KernelSame interface with the Kernel

Page 12: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Benefit # 3: Good performance

12

KernelKernel

K-DriverK-Driver DeviceDevice

ApplicationsApplications U-driverU-driver

Performance critical codePerformance critical code

Page 13: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Benefit # 4: Flexibility

13

KernelKernel

K-DriverK-Driver DeviceDevice

ApplicationsApplications U-driverU-driver

int get_status(char*)

Page 14: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

U-driver & K-driver Communication

14

KernelKernel

K-DriverK-Driver

ApplicationsApplications U-driverU-driver

get_status(arg)

int get_status(char*)

Marshalling BufferMarshalling Buffer

Marshalling BufferMarshalling Buffer

Page 15: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

15

KernelKernel

K-DriverK-Driver

ApplicationsApplications U-driverU-driver

get_status(arg)

int get_status(char*)

Marshalling BufferMarshalling Buffer

kern_fptr = {injected code}

Page 16: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Solution: RPC Monitor

16

KernelKernel

K-DriverK-Driver DeviceDevice

ApplicationsApplications

RPC monitorRPC monitor

U-driverU-driver

Page 17: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Outline

• Introduction• Background• Our Architecture• Evaluation• Summary

17

Page 18: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

RPC Monitor

• Enforces– Data integrity constraints– Control flow policies

• Data integrity constraints are extracted automatically using dynamic analysis.

• Control flow policies are extracted automatically through static analysis.

18

Page 19: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Enforcing data integrity constraints

19

KernelKernel

K-DriverK-Driver

ApplicationsApplications U-driverU-driver

get_status(arg)

int get_status(char*)

Marshalling BufferMarshalling Buffer

RPC MonitorRPC MonitorMarshalling BufferMarshalling Buffer

Page 20: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Inferring data integrity constraints

21

KernelKernel

K-DriverK-Driver DeviceDevice

Training workloadTraining workload LoggerLogger

U-driverU-driver

TracesTraces

Data Integrity Constraints

Data Integrity ConstraintsDaikonDaikonTracesTraces

U-driverU-driver

Page 21: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Examples of data integrity constraints

Functions Constraints

rtl8139_init_module rtl8139_intr_mask = 0xC07F

rtl8139_init_module rtl8139_norx_intr_mask = 0xC02E

rtl8139_get_link dev->hard_start_xmit has only one value

rtl8139_get_link Len(dev->mc_list) == Orig(Len(dev->mc_list))

22

Page 22: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Enforcing control flow policies

• Scenario 1:– Return from function call in U-driver– RPC Monitor ensures that control returns to the

instruction following upcall instruction

• Scenario 2:– U-driver calls a function in Kernel or K-driver– RPC Monitor ensures that the function call is

allowed according to statically extracted policy

23

Page 23: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Outline

• Introduction• Background• Our Architecture• Evaluation• Summary

24

Page 24: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Experiment Setup

• QEMU 0.9.1 & VMWare Workstation 6• Implemented in Linux 2.6.18.1 kernel• Ported 4 device drivers

25

Page 25: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Goals of Evaluation

• Effectiveness– Simulated attacks– Fault injection experiment

• Performance

26

Page 26: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Fault Injection Experiment Setup

• Fault injector from SafeDrive [Zhou 06]• Types of faults– Removes assignment instructions– Changes if conditions– Changes loop counters

• Two device drivers– 8139too– 8139cp

27

Page 27: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Fault injection experiment

28

KernelKernel

K-DriverK-Driver

ApplicationsApplications

RPC monitorRPC monitor

U-driverU-driver

Driver Faults No Crash UD Clear In Log Detect8139too 400 49 26 212 113 95 (84%)

8139cp 400 134 14 147 105 64 (61%)

Faults

FaultsCrashedCrashed

System Log

System Log

System Log

System Log

Page 28: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Performance Experiment Setup

• Device drivers– Network drivers (8139too, 8139cp)– USB driver (uhci-hcd)

• Workload for network drivers– TCP send– TCP receive

• Workload for USB driver– Copy a file of 100MB

29

Page 29: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Performance

30

Page 30: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Summary

• Reduction of trusted code in kernel• Good common-case performance• Compatible with Commodity OS• Able to detect large number of faults

31

Page 31: Protecting Commodity Operating System Kernels from Vulnerable Device Drivers

Thanks

Questions?

32