Reducing Size and Complexity of the Security-Critical Code Base of File Systems
Total Page:16
File Type:pdf, Size:1020Kb
Reducing Size and Complexity of the Security-Critical Code Base of File Systems Dissertation zur Erlangung des akademischen Grades Doktoringenieur (Dr.-Ing.) vorgelegt an der Technischen Universität Dresden Fakultät Informatik eingereicht von Dipl.-Inf. Carsten Weinhold geboren am 30. September 1980 in Dresden Betreuender Hochschullehrer: Prof. Dr. rer. nat. Hermann Härtig Technische Universität Dresden Gutachter: Prof. Dr. Scott Brandt University of California, Santa Cruz Fachreferent: Prof. Dr. Christof Fetzer Technische Universität Dresden Korrigierte Version vom 2. Juli 2014 (eingereicht am 5. Juli 2013, verteidigt am 14. Januar 2014) 2 Acknowledgements I want to thank my advisor Prof. Dr. rer. nat. Hermann Härtig for all the support and guidance over the years and for encouraging me in my work. I warmly thank Björn Döbel, Michael Roitzsch, Anna Krasnova, and Dr. Claude-Joachim Hamann for all the time and effort they put into proof reading draft versions of this thesis and for giving me so much valuable feedback for improving it. Thanks also go to Adam Lackorzynski and Alexander Warg for maintaining and continuously improving the platform of my work and the work of so many others. Everybody in the coffee area: thank you for all the interesting discussions (not only about work). Finally, my greatest thanks go to my family and to my friends for all their help, support, and patience, but especially for being so much fun to be with. Thank you all! 3 4 Contents 1 Introduction 13 1.1 Motivation ........................................ 13 1.2 A Virtual Private File System .............................. 15 1.3 Thesis Goals ....................................... 16 1.4 Non-Goals ......................................... 17 1.5 Contribution ....................................... 18 2 Background and State of the Art 21 2.1 Isolation Architectures and Legacy Reuse ....................... 21 2.2 Trusted Computing for Software Integrity ....................... 23 2.3 Trusted Computing for Secure Storage ......................... 24 2.4 Threat Model and Platform Assumptions ....................... 25 2.5 Related Work ....................................... 27 2.5.1 Decomposition of Local File System Stacks .................. 27 2.5.2 Cryptographic Protection of Storage ...................... 28 2.5.3 Untrusted Storage ................................ 29 2.5.4 Versioning and Tamper-Proof Storage ..................... 29 3 A Trusted File System Wrapper 31 3.1 General Architecture ................................... 31 3.1.1 How to Reuse Untrusted Infrastructure .................... 31 3.1.2 Cryptographic Protection ............................ 34 3.1.3 Introducing the VPFS Subsystems ....................... 35 3.1.4 Alternative TCBs for Confidentiality and Integrity .............. 37 3.2 Design Principles ..................................... 38 3.2.1 Metadata Integrity and Input Sanitization ................... 38 3.2.2 Simple Inter-Component Interfaces ....................... 39 3.2.3 Handling and Surviving Errors ......................... 40 3.2.4 Reuse of Generic Implementations ....................... 40 3.3 Central Data Structure: The Block Tree ........................ 40 3.3.1 The Case for a Generic Block Tree ....................... 41 3.3.2 Buffer Registry .................................. 42 3.3.3 Generic Tree Walker and Specific Strategies .................. 44 3.4 Optimizations ....................................... 47 3.4.1 Caching Buffer Pointers ............................. 47 3.4.2 Optimal Block Tree Depth ........................... 47 3.4.3 Write Batching and Read Ahead ........................ 48 3.5 Summary ......................................... 48 5 4 Metadata and Namespace Protection 49 4.1 Protection of Metadata in File Systems ........................ 49 4.1.1 Approaches to Namespace Protection and Freshness ............. 49 4.1.2 Requirements for VPFS ............................. 50 4.2 Inode-Based Naming ................................... 51 4.3 Untrusted Naming .................................... 52 4.3.1 Potential of Reusing Untrusted Infrastructure ................. 52 4.3.2 Untrusted Lookup and Proofs .......................... 53 4.3.3 Limitations of Untrusted Naming ........................ 54 4.3.4 Verdict on Untrusted Naming .......................... 55 4.4 Trusted Directory Hierarchy ............................... 56 5 Consistency and Robustness 57 5.1 Consistency in Local File Systems ........................... 57 5.1.1 Approaches to Ensuring Consistency ...................... 57 5.1.2 A Consistency Paradigm for VPFS ....................... 59 5.2 Extended Persistency Interface ............................. 60 5.3 Dependency Tracking in VPFS Core .......................... 61 5.4 Being Prepared for Crashes ............................... 62 5.4.1 Journaling Metadata Operations ........................ 63 5.4.2 Journaling Block Updates ............................ 64 5.4.3 Checkpoints .................................... 65 5.4.4 Securing the Journal ............................... 66 5.5 Recovering From Crashes ................................ 66 5.5.1 Replaying the Journal .............................. 66 5.5.2 Recovery Results ................................. 68 5.6 Garbage Collection .................................... 69 5.7 Optimizations ....................................... 70 5.8 Summary ......................................... 71 6 Backup and Restore 73 6.1 Approaches to Backup and Restore ........................... 73 6.1.1 Backup and Cloud Storage ........................... 73 6.1.2 Availability of Remotely Stored Data ...................... 74 6.1.3 Backup and Restore in VPFS .......................... 75 6.2 Authentication and Transport Security ......................... 76 6.3 Extended Threat Model ................................. 78 6.4 Client-Side TCBs for Backup and Restore ....................... 79 6.5 Backup Creation ..................................... 81 6.5.1 Enabling Backups in Background ........................ 81 6.5.2 Updating a Remote Backup ........................... 82 6.5.3 Impact on TCB Complexity ........................... 84 6.6 Backup to Multiple Servers ............................... 84 6.6.1 Redundancy Schemes .............................. 84 6.6.2 Inconsistent Updates ............................... 85 6.6.3 Recoverability Model ............................... 86 6.6.4 Self-Attesting Erasure Coding .......................... 87 6.6.5 Isolation of Independent Auth Components .................. 89 6.7 Restore from Backup ................................... 89 6.8 Key and Credential Backup ............................... 91 6.9 Summary ......................................... 92 6 7 Evaluation 93 7.1 Experimentation Platform ................................ 93 7.2 Code Size and Complexity ................................ 94 7.2.1 Code Size ..................................... 95 7.2.2 Functional Complexity .............................. 97 7.3 Separation of TCBs and Attack Surface ........................ 100 7.3.1 Size and Complexity of the Recoverability TCB ................ 100 7.3.2 Size and Complexity of the Attack Surface .................. 101 7.4 Efficiency ......................................... 103 7.4.1 Hardware and Software Configuration ..................... 104 7.4.2 Microbenchmarks ................................. 105 7.4.3 Application Workloads .............................. 108 7.4.4 CPU Load ..................................... 111 7.4.5 Crash Recovery .................................. 113 8 Conclusions and Future Work 115 7 8 List of Figures 1.1 Isolation of private file system instances for mutually distrustful applications ... 15 2.1 VPFS in the Nizza Secure System Architecture .................... 22 3.1 Conceptual view of three points in the design space for splitting a file system stack 32 3.2 VPFS architecture with trusted and untrusted components ............. 36 3.3 Mapping of file contents and metadata to untrusted storage ............. 37 3.4 Two examples for inter-block dependencies in the block tree ............. 41 3.5 Pointer structure in VPFS Core’s buffer registry ................... 43 3.6 Addressing scheme for block tree nodes ......................... 44 3.7 C++ implementation of the dirty-block strategy of VPFS Core’s buffer cache ... 45 4.1 Data structures enabling untrusted naming ...................... 54 5.1 Lazy updates of the Merkle hash tree .......................... 60 5.2 Dependencies among cached file system structures .................. 62 5.3 Record groups as the basis of transactions in VPFS journal ............. 67 6.1 TCBs for confidentiality, integrity, and recoverability ................. 80 6.2 Application and backup instances of VPFS for creating backups in the background 81 6.3 Version-based identification of nodes in block tree that require backup ....... 83 6.4 Functional components of VPFS backup architecture and TCB assignment .... 89 6.5 VPFS components involved in recovering a file system from backup ......... 90 7.1 Measured throughput for sequential reads and writes using ’bonnie++’ traces ... 106 7.2 Runtimes for microbenchmarks (PostMark, untar, and grep traces) ......... 107 7.3 Benchmarks of short-running workload traces ..................... 110 7.4 Benchmarks of long-running workload traces ...................... 111 7.5 CPU load under timed playback of ’iPhoto4’ trace for VPFS and dmcrypt ..... 112 7.6 CPU load under timed playback of ’Keynote2’ trace for VPFS and dmcrypt