+ All Categories
Home > Documents > A Soundy Analysis for Linux Kernel Drivers -...

A Soundy Analysis for Linux Kernel Drivers -...

Date post: 21-Sep-2019
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
66
DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry, Chad Spensky, Jake Corina, Nick Stephens, Christopher Kruegel, and Giovanni Vigna University of California, Santa Barbara USENIX Security 2017 seclab THE COMPUTER SECURITY GROUP AT UC SANTA BARBARA
Transcript
Page 1: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

DR. CHECKER A Soundy Analysis for Linux Kernel Drivers

Aravind Machiry, Chad Spensky, Jake Corina, Nick Stephens, Christopher Kruegel, and Giovanni Vigna

University of California, Santa Barbara

USENIX Security 2017

seclabTHE COMPUTER SECURITY GROUP AT UC SANTA BARBARA

Page 2: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

First, a story…

2

Page 3: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

First, a story…

3

Page 4: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

First, a story…

$ mkdir driver_checker

3

Page 5: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

First, a story…

$ mkdir dr_checker

4

Page 6: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

First, a story…

5

Page 7: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Why Drivers?

6

Page 8: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

$ ls linux

Why Drivers?

6

/arch /block /certs /crypto

/drivers /firmware /fs

/include /virt/init

/tools /sound /security/scripts

/samples

/net /mm /lib

/kernel /ipc

/usr

$

Page 9: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

$ ls linux

Why Drivers?

7

/arch /block /certs /crypto

/drivers /firmware /fs

/include /virt/init

/tools /sound /security/scripts

/samples

/net /mm /lib

/kernel /ipc

/usr

$

Page 10: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

$ ls linux

Why Drivers?

7

/arch /block /certs /crypto

/drivers /firmware /fs

/include /virt/init

/tools /sound /security/scripts

/samples

/net /mm /lib

/kernel /ipc

/usr

find bugs $

Page 11: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Why Drivers?

8

CVE - Common Vulnerability and Exposure

Page 12: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Why Drivers?

8

15%

Drivers85%

Bugs in Windows XP (2003)

CVE - Common Vulnerability and Exposure

Page 13: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Why Drivers?

8

15%

Drivers85%

Bugs in Windows XP (2003)

72%

Drivers28%

Linux Kernel CVEs (2016-2017)

CVE - Common Vulnerability and Exposure

Page 14: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Why Drivers?

8

15%

Drivers85%

Bugs in Windows XP (2003)

72%

Drivers28%

Linux Kernel CVEs (2016-2017)

15%

Drivers85%

Reported bugs in Android (2016)

CVE - Common Vulnerability and Exposure

Page 15: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Motivation

9

Only analyze the drivers!

Page 16: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Program Analysis for Bug Finding

10

Page 17: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Program Analysis for Bug Finding

• Points-to Analysis: Determines all storage locations that a pointer can point to

• Example bug: Kernel code pointer to user-controlled memory

10

Page 18: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Program Analysis for Bug Finding

• Points-to Analysis: Determines all storage locations that a pointer can point to

• Example bug: Kernel code pointer to user-controlled memory

• Taint Analysis: Determines all of the locations that are affected by user-supplied (tainted) data

• Example bug: User provided data used as length in copy_from_user()

10

Page 19: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Program Analysis on Kernel Code

• Pointers… Everywhere!

• State explosion

• Inter-procedural calls to core functions

• State explosion

11

Page 20: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Precision vs. Soundness

12

Precise Sound

Page 21: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Precision vs. Soundness

12

Most of the things reported are true

True

True True

TrueTrue

True

TrueTrue

True

True

False

False

Precise Sound

True

True

True

False

False

False

False

False

Page 22: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Precision vs. Soundness

12

Everything that is true is reportedMost of the things reported are true

True

True True

TrueTrue

True

TrueTrue

True

True

False

False

True True

True

True

False

False

False

False

False

False

False

False

False

Precise Sound

True

True

True

False

False

False

False

False

False

False

False

False

Page 23: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundiness

13

Violate soundness to achieve higher precision and practical computational constraints

True

True True

TrueTrue

True

TrueTrue

True

True

False

False

Precise

True

True

True

False

False

False

False

False

True True

True

True

False

False

False

False

False

False

False

False

False

Sound

False

False

False

False

Page 24: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundiness

13

Violate soundness to achieve higher precision and practical computational constraints

True

True True

TrueTrue

True

TrueTrue

True

True

False

False

Precise

True

True

True

False

False

False

False

False

True True

True

True

False

False

False

False

False

False

False

False

False

Sound

False

False

False

False

True

True

TrueTrue

True

True

True

True

True

False

Soundy

TrueFalse

False

False

False FalseFalse

False

Page 25: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Assumptions

(1) All non-driver code is implemented perfectly

(2) Only evaluate loops until a reaching definition

(3) All calls are traversed exactly once, even in loops

14

Page 26: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

• Modular framework to enable flexible development

• Simultaneously employ numerous vulnerability detectors

• Open source: github.com/ucsb-seclab/dr_checker

15

Page 27: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

16

Driver Code

Soundy Driver Traversal Analysis Clients

Points-to Analysis

Taint Analysis

1

2Global State

Vulnerability Detectors

Improper Tainted-Data Use Detector (ITDUD) Tainted Arithmetic Detector (TAD)

Invalid Cast Detector (ICD) Tainted Loop Bound Detector (TLBD)

Tainted Pointer Dereference Detector (TPDD) Tainted Size Detector (TSD)

Uninit Leak Detector (ULD) Global Variable Race Detector (GVRD)

Warnings

3

Page 28: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

16

Driver Code

Soundy Driver Traversal Analysis Clients

Points-to Analysis

Taint Analysis

1

2Global State

Vulnerability Detectors

Improper Tainted-Data Use Detector (ITDUD) Tainted Arithmetic Detector (TAD)

Invalid Cast Detector (ICD) Tainted Loop Bound Detector (TLBD)

Tainted Pointer Dereference Detector (TPDD) Tainted Size Detector (TSD)

Uninit Leak Detector (ULD) Global Variable Race Detector (GVRD)

Warnings

3

Page 29: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

16

Driver Code

Soundy Driver Traversal Analysis Clients

Points-to Analysis

Taint Analysis

1

2Global State

Vulnerability Detectors

Improper Tainted-Data Use Detector (ITDUD) Tainted Arithmetic Detector (TAD)

Invalid Cast Detector (ICD) Tainted Loop Bound Detector (TLBD)

Tainted Pointer Dereference Detector (TPDD) Tainted Size Detector (TSD)

Uninit Leak Detector (ULD) Global Variable Race Detector (GVRD)

Warnings

3

Page 30: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

16

Driver Code

Soundy Driver Traversal Analysis Clients

Points-to Analysis

Taint Analysis

1

2Global State

Vulnerability Detectors

Improper Tainted-Data Use Detector (ITDUD) Tainted Arithmetic Detector (TAD)

Invalid Cast Detector (ICD) Tainted Loop Bound Detector (TLBD)

Tainted Pointer Dereference Detector (TPDD) Tainted Size Detector (TSD)

Uninit Leak Detector (ULD) Global Variable Race Detector (GVRD)

Warnings

3

Page 31: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

16

Driver Code

Soundy Driver Traversal Analysis Clients

Points-to Analysis

Taint Analysis

1

2Global State

Vulnerability Detectors

Improper Tainted-Data Use Detector (ITDUD) Tainted Arithmetic Detector (TAD)

Invalid Cast Detector (ICD) Tainted Loop Bound Detector (TLBD)

Tainted Pointer Dereference Detector (TPDD) Tainted Size Detector (TSD)

Uninit Leak Detector (ULD) Global Variable Race Detector (GVRD)

Warnings

3

Page 32: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker: Design

16

Driver Code

Soundy Driver Traversal Analysis Clients

Points-to Analysis

Taint Analysis

1

2Global State

Vulnerability Detectors

Improper Tainted-Data Use Detector (ITDUD) Tainted Arithmetic Detector (TAD)

Invalid Cast Detector (ICD) Tainted Loop Bound Detector (TLBD)

Tainted Pointer Dereference Detector (TPDD) Tainted Size Detector (TSD)

Uninit Leak Detector (ULD) Global Variable Race Detector (GVRD)

Warnings

3

Page 33: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

17

Page 34: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

• Context-sensitive: Analysis for each function call is done in the context of the calling function

17

Page 35: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

• Context-sensitive: Analysis for each function call is done in the context of the calling function

• Field-sensitive: The ability to differentiate between different fields in a memory structure

17

Page 36: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

• Context-sensitive: Analysis for each function call is done in the context of the calling function

• Field-sensitive: The ability to differentiate between different fields in a memory structure

• Flow-sensitive: The ability to track data usage (e.g., taint) throughout a program, according to its control flow

17

Page 37: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

18

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Page 38: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

19

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Taint Analysis

user_ptr

len

Page 39: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

20

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Taint Analysis

user_ptr

len

Field-sensitive

Page 40: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

21

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Taint Analysis

user_ptr

len

ko

Taint Sourcecurr_data->item

Warning: Improper Tainted-Data Use

Field-sensitive

Page 41: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Soundy Driver Traversal

22

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Taint Analysis

user_ptr

len

ko

Taint Sourcecurr_data->item

Warning: Improper Tainted-Data Use

Field-sensitive

Warning: Tainted Loop Bound

Page 42: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Warning: Improper Tainted-Data Use

Soundy Driver Traversal

23

Taint Analysis

user_ptr

len

Field-sensitiveko

Taint Source

Warning: Tainted Loop Bound

curr_data->item

Page 43: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Warning: Improper Tainted-Data Use

Soundy Driver Traversal

24

Taint Analysis

user_ptr

len

Field-sensitiveko

Taint Source

Warning: Tainted Loop Bound

Warning: Tainted Arithmetic

curr_data->item

Page 44: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Warning: Improper Tainted-Data Use

Soundy Driver Traversal

25

Taint Analysis

user_ptr

len

Field-sensitiveko

Taint Source

Warning: Tainted Loop Bound

Warning: Tainted Arithmetic

Untainted Field

curr_data->item

Page 45: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Warning: Improper Tainted-Data Use

Soundy Driver Traversal

26

Taint Analysis

user_ptr

len

Field-sensitiveko

Taint Source

Warning: Tainted Loop Bound

Warning: Tainted Arithmetic

Untainted FieldWarning: Improper Tainted-Data Use

curr_data->item

Page 46: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Warning: Improper Tainted-Data Use

Soundy Driver Traversal

27

Taint Analysis

user_ptr

len

Field-sensitiveko

Taint Source

Warning: Tainted Loop Bound

Warning: Tainted Arithmetic

Untainted FieldWarning: Improper Tainted-Data Use

Kernel Functions Ignored

curr_data->item

Page 47: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

struct kernel_obj ko;

void internal_function(int *ptr) { *ptr += 1; }

void entry_point(void *user_ptr, int len) { curr_data->item = &ko;

copy_from_user(&ko, user_ptr, len);

for (int i = 0; i < ko.count; i++) { internal_function(&(ko.data[i])); }

dangerous_function(curr_data->buf); dangerous_function(curr_data->item); kernel_function(curr_data->item);

}

Warning: Improper Tainted-Data Use

Soundy Driver Traversal

28

Taint Analysis

user_ptr

len

Field-sensitiveko

Taint Source

Warning: Tainted Loop Bound

Warning: Tainted Arithmetic

Untainted FieldWarning: Improper Tainted-Data Use

Kernel Functions Ignored

Soundy: Loop Traversal

Soundy: Ignore kernel functions

Soundy: Single traversalcurr_data->item

Page 48: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Identifying Vendor Drivers

• diff with mainline sources

• Extract code-names from vendor configuration files

29

Page 49: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Driver Entry Points

• File Operations

• Attribute Operations

• Socket Operations

• Wrapper Functions

30

Entry Type Argument(s) Taint Type

Read (File) char *buf, size_t len Direct

Write (File) char *buf, size_t len Direct

Ioctl (File) long args Direct

DevStore (Attribute) const char *buf Indirect

NetDevIoctl (Socket) struct *ifreq Indirect

V4Ioctl struct v412_format *f Indirect

Page 50: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Evaluation: Mobile Kernels

31

Amazon Echo (5.5.0.3)

Amazon Fire HD8 (6th Generation, 5.3.2.1)

HTC One Hima (3.10.61-g5f0fe7e)

Sony Xperia XA (33.2.A.3.123)

HTC Desire A56 (a56uhl-3.4.0)

LG K8 ACG (AS375)

ASUS Zenfone 2 Laser (ZE550KL / MR5- 21.40.1220.1794)

Huawei Venus P9 Lite (2016-03-29)

Samsung Galaxy S7 Edge (SM-G935F NN)

3.1 Million lines of driver code

Page 51: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Other Tools

• Flawfinder — pattern-based bug detector

• RATS (Rough Auditing Tool for Security) — pattern-based bug detector

• Sparse — compiler-based bug detector

• cppcheck — all-in-one static analysis bug detector

32

Page 52: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Other Tools: Analysis

33

Feature cppcheck flawfinder RATS Sparse Dr. Checker

Extensible ✔ ✔

Inter-prodecural ✔

Handles pointers ✔

Kernel specific ✔ ✔

No manual annotations ✔ ✔ ✔ ✔

Requires compilable sources

✔ ✔ ✔

Sound

Tracable Warnings ✔ ✔

Page 53: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Other Tools: Warnings

34

Kernel cppcheck flawfinder RATS Sparse

Qualcomm 18 4,365 693 5,202

Samsung 22 8,173 2,244 1,726

Hauwei 34 18,132 2,301 11,320

Mediatek 168 14,230 3,730 13,771

242 44,900 8,968 31,929

Page 54: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker

35

Detector Huawei Qualcomm Mediatek Samsung Total

TaintedSizeDetector 62 / 62/ 5 33 / 33 / 2 155 / 155 / 6 20 / 20 / 1 270 / 268 / 14TaintedPointerDereferenceChecker 522 / 155 / 12 264 / 264 / 3 465 / 459 / 6 479 / 423 / 4 1,760 / 1,301 / 25

TaintedLoopBoundDetector 75 / 56 / 4 52 / 52 / 0 73 / 73 / 1 78 / 78 / 0 278 / 259 / 5GlobalVariableRaceDetector 324 / 184 / 38 188 / 108 / 8 548 / 420 / 5 100 / 62 / 12 1,160 / 774 / 63

ImproperTaintedDataUseDetector 81 / 74 / 5 92 / 91 / 3 243 / 241 / 9 135 / 134 / 4 551 / 540 / 21IntegerOverflowDetector 250 / 177 / 6 196 / 196 / 2 247 / 247 / 6 99 / 87 / 2 792 / 707 / 16

KernelUninitMemoryLeakDetector 9 / 7 / 5 1 / 1 / 0 8 / 5 / 5 6 / 2 / 1 24 / 15 / 11

InvalidCastDetector 96 / 13 / 2 75 / 74 / 1 9 / 9 / 0 56 / 13 / 0 236 / 109 / 3

1,449 / 728 / 78 901 / 819 / 19 1,748 / 1,607 / 44 973 / 819 / 24 5,071 / 3,973 / 158

Warnings per Kernel (Count / Confirmed / Bug)

Precision: 78%

Page 55: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker

35

Detector Huawei Qualcomm Mediatek Samsung Total

TaintedSizeDetector 62 / 62/ 5 33 / 33 / 2 155 / 155 / 6 20 / 20 / 1 270 / 268 / 14TaintedPointerDereferenceChecker 522 / 155 / 12 264 / 264 / 3 465 / 459 / 6 479 / 423 / 4 1,760 / 1,301 / 25

TaintedLoopBoundDetector 75 / 56 / 4 52 / 52 / 0 73 / 73 / 1 78 / 78 / 0 278 / 259 / 5GlobalVariableRaceDetector 324 / 184 / 38 188 / 108 / 8 548 / 420 / 5 100 / 62 / 12 1,160 / 774 / 63

ImproperTaintedDataUseDetector 81 / 74 / 5 92 / 91 / 3 243 / 241 / 9 135 / 134 / 4 551 / 540 / 21IntegerOverflowDetector 250 / 177 / 6 196 / 196 / 2 247 / 247 / 6 99 / 87 / 2 792 / 707 / 16

KernelUninitMemoryLeakDetector 9 / 7 / 5 1 / 1 / 0 8 / 5 / 5 6 / 2 / 1 24 / 15 / 11

InvalidCastDetector 96 / 13 / 2 75 / 74 / 1 9 / 9 / 0 56 / 13 / 0 236 / 109 / 3

1,449 / 728 / 78 901 / 819 / 19 1,748 / 1,607 / 44 973 / 819 / 24 5,071 / 3,973 / 158

Warnings per Kernel (Count / Confirmed / Bug)

Precision: 78%5,071 / 3,973 / 158

Page 56: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker

35

Detector Huawei Qualcomm Mediatek Samsung Total

TaintedSizeDetector 62 / 62/ 5 33 / 33 / 2 155 / 155 / 6 20 / 20 / 1 270 / 268 / 14TaintedPointerDereferenceChecker 522 / 155 / 12 264 / 264 / 3 465 / 459 / 6 479 / 423 / 4 1,760 / 1,301 / 25

TaintedLoopBoundDetector 75 / 56 / 4 52 / 52 / 0 73 / 73 / 1 78 / 78 / 0 278 / 259 / 5GlobalVariableRaceDetector 324 / 184 / 38 188 / 108 / 8 548 / 420 / 5 100 / 62 / 12 1,160 / 774 / 63

ImproperTaintedDataUseDetector 81 / 74 / 5 92 / 91 / 3 243 / 241 / 9 135 / 134 / 4 551 / 540 / 21IntegerOverflowDetector 250 / 177 / 6 196 / 196 / 2 247 / 247 / 6 99 / 87 / 2 792 / 707 / 16

KernelUninitMemoryLeakDetector 9 / 7 / 5 1 / 1 / 0 8 / 5 / 5 6 / 2 / 1 24 / 15 / 11

InvalidCastDetector 96 / 13 / 2 75 / 74 / 1 9 / 9 / 0 56 / 13 / 0 236 / 109 / 3

1,449 / 728 / 78 901 / 819 / 19 1,748 / 1,607 / 44 973 / 819 / 24 5,071 / 3,973 / 158

Warnings per Kernel (Count / Confirmed / Bug)

Precision: 78%5,071 / 3,973 / 158

Page 57: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker

35

Detector Huawei Qualcomm Mediatek Samsung Total

TaintedSizeDetector 62 / 62/ 5 33 / 33 / 2 155 / 155 / 6 20 / 20 / 1 270 / 268 / 14TaintedPointerDereferenceChecker 522 / 155 / 12 264 / 264 / 3 465 / 459 / 6 479 / 423 / 4 1,760 / 1,301 / 25

TaintedLoopBoundDetector 75 / 56 / 4 52 / 52 / 0 73 / 73 / 1 78 / 78 / 0 278 / 259 / 5GlobalVariableRaceDetector 324 / 184 / 38 188 / 108 / 8 548 / 420 / 5 100 / 62 / 12 1,160 / 774 / 63

ImproperTaintedDataUseDetector 81 / 74 / 5 92 / 91 / 3 243 / 241 / 9 135 / 134 / 4 551 / 540 / 21IntegerOverflowDetector 250 / 177 / 6 196 / 196 / 2 247 / 247 / 6 99 / 87 / 2 792 / 707 / 16

KernelUninitMemoryLeakDetector 9 / 7 / 5 1 / 1 / 0 8 / 5 / 5 6 / 2 / 1 24 / 15 / 11

InvalidCastDetector 96 / 13 / 2 75 / 74 / 1 9 / 9 / 0 56 / 13 / 0 236 / 109 / 3

1,449 / 728 / 78 901 / 819 / 19 1,748 / 1,607 / 44 973 / 819 / 24 5,071 / 3,973 / 158

Warnings per Kernel (Count / Confirmed / Bug)

Precision: 78%

24 / 15 / 11

Page 58: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Dr. Checker

35

Detector Huawei Qualcomm Mediatek Samsung Total

TaintedSizeDetector 62 / 62/ 5 33 / 33 / 2 155 / 155 / 6 20 / 20 / 1 270 / 268 / 14TaintedPointerDereferenceChecker 522 / 155 / 12 264 / 264 / 3 465 / 459 / 6 479 / 423 / 4 1,760 / 1,301 / 25

TaintedLoopBoundDetector 75 / 56 / 4 52 / 52 / 0 73 / 73 / 1 78 / 78 / 0 278 / 259 / 5GlobalVariableRaceDetector 324 / 184 / 38 188 / 108 / 8 548 / 420 / 5 100 / 62 / 12 1,160 / 774 / 63

ImproperTaintedDataUseDetector 81 / 74 / 5 92 / 91 / 3 243 / 241 / 9 135 / 134 / 4 551 / 540 / 21IntegerOverflowDetector 250 / 177 / 6 196 / 196 / 2 247 / 247 / 6 99 / 87 / 2 792 / 707 / 16

KernelUninitMemoryLeakDetector 9 / 7 / 5 1 / 1 / 0 8 / 5 / 5 6 / 2 / 1 24 / 15 / 11

InvalidCastDetector 96 / 13 / 2 75 / 74 / 1 9 / 9 / 0 56 / 13 / 0 236 / 109 / 3

1,449 / 728 / 78 901 / 819 / 19 1,748 / 1,607 / 44 973 / 819 / 24 5,071 / 3,973 / 158

Warnings per Kernel (Count / Confirmed / Bug)

Precision: 78%

522 / 155 / 12 479 / 423 / 4

Page 59: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Zero-day Bug

36

static char call status ; ...static ssize_t accdet_store_call_state( struct device driver ∗ddri , const char ∗buf , size t count) { int ret = sscanf(buf, ”%s”, &call status);

if (ret != 1) { ACCDETDEBUG(”accdet: Invalid values\n”); return -EINVAL; } … }

A buffer overflow bug detected in Mediatek’s Accdet driver

Page 60: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Zero-day Bug

36

static char call status ; ...static ssize_t accdet_store_call_state( struct device driver ∗ddri , const char ∗buf , size t count) { int ret = sscanf(buf, ”%s”, &call status);

if (ret != 1) { ACCDETDEBUG(”accdet: Invalid values\n”); return -EINVAL; } … }

buf can contain more than one char !

A buffer overflow bug detected in Mediatek’s Accdet driver

Page 61: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Zero-day Bug

36

static char call status ; ...static ssize_t accdet_store_call_state( struct device driver ∗ddri , const char ∗buf , size t count) { int ret = sscanf(buf, ”%s”, &call status);

if (ret != 1) { ACCDETDEBUG(”accdet: Invalid values\n”); return -EINVAL; } … }

Warning: Improper Tainted-Data Use

buf can contain more than one char !

A buffer overflow bug detected in Mediatek’s Accdet driver

Page 62: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Zero-day Bug

36

static char call status ; ...static ssize_t accdet_store_call_state( struct device driver ∗ddri , const char ∗buf , size t count) { int ret = sscanf(buf, ”%s”, &call status);

if (ret != 1) { ACCDETDEBUG(”accdet: Invalid values\n”); return -EINVAL; } … }

Warning: Improper Tainted-Data Use

buf can contain more than one char !

ret is checked, but it’s too late

A buffer overflow bug detected in Mediatek’s Accdet driver

Page 63: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Results: Soundy vs. Sound

37

Dr. Checker

Dr. Checker (Ignoring kernel functions)

Dr. Checker (Sound Analysis) [18/100]

.008 Seconds

log10(seconds)

980 Seconds

Time to analyze 100 randomly selected entry points

3,000 Seconds

2,300 Seconds

.16 Seconds

.12 Seconds

Page 64: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Results: Soundy vs. Sound

37

Dr. Checker

Dr. Checker (Ignoring kernel functions)

Dr. Checker (Sound Analysis) [18/100]

.008 Seconds

log10(seconds)

980 Seconds

Time to analyze 100 randomly selected entry points

3,000 Seconds

2,300 Seconds

.16 Seconds

.12 Seconds

82 Analyses did not finish!

Page 65: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

Conclusion

• Modular bug-finding tool for Linux kernel drivers

• Soundy program analysis techniques to maintain practicality

• Scalable tool capable of employing multiple vulnerability detectors

• 158 previously undiscovered zero-day bugs

• Open-source project to encourage more development/collaboration

38

Page 66: A Soundy Analysis for Linux Kernel Drivers - sites.cs.ucsb.educspensky/slides/dr_checker_usenix2017.pdf · DR. CHECKER A Soundy Analysis for Linux Kernel Drivers Aravind Machiry,

seclabDr Checker: A Soundy Analysis of Linux Kernel DriversCSS, USENIX Security, 08/18/2017

github.com/ucsb-seclab/dr_checker

Aravind Machiry ([email protected])

Chad Spensky ([email protected])

Help Make Drivers Great Again

39


Recommended