Robust Composition: Towards a Unified Approach To
Total Page:16
File Type:pdf, Size:1020Kb
Robust Composition: Towards a Uni¯ed Approach to Access Control and Concurrency Control by Mark Samuel Miller A dissertation submitted to Johns Hopkins University in conformity with the requirements for the degree of Doctor of Philosophy. Baltimore, Maryland May, 2006 Copyright °c 2006, Mark Samuel Miller. All rights reserved. Permission is hereby granted to make and distribute verbatim copies of this document without royalty or fee. Permission is granted to quote excerpts from this documented provided the original source is properly cited. ii Abstract When separately written programs are composed so that they may cooperate, they may instead destructively interfere in unanticipated ways. These hazards limit the scale and functionality of the software systems we can successfully compose. This dissertation presents a framework for enabling those interactions between components needed for the cooperation we intend, while minimizing the hazards of destructive interference. Great progress on the composition problem has been made within the object paradigm, chiefly in the context of sequential, single-machine programming among benign components. We show how to extend this success to support robust composi- tion of concurrent and potentially malicious components distributed over potentially malicious machines. We present E, a distributed, persistent, secure programming language, and CapDesk, a virus-safe desktop built in E, as embodiments of the tech- niques we explain. Advisor: Jonathan S. Shapiro, Ph.D. Readers: Scott Smith, Ph.D., Yair Amir, Ph.D. iii iv This dissertation is dedicated to the number \3469" and the letter \E". v vi Acknowledgements Jonathan Shapiro, my advisor, for encouraging me to continue this work in an aca- demic setting, and for providing insight, encouragement, and support way beyond the call of any duty. Terry Stanley, for her patient support, encouragement, and enthusiam for this project. My parents, Ann and Bernard Miller. Knowing the naches they would feel, helped motivate me to complete this dissertation (\Naches" is approximately \re- flected pride"). Hewlett-Packard Laboratories for supporting portions of this research, and Alan Karp for helping to arrange this. Combex and Henry Boreen for investing in these ideas. I still hope to see this investment pay o®. The Defense Advanced Research Projects Agency for sponsoring the security re- view of E, CapDesk, and the DarpaBrowser [WT02]. Lauren Williams for rescue from crisis. I don't know what would have happened without your help. The software systems explained in this dissertation are the results of collaborative e®orts starting at Electric Communities, Inc. and continuing with the e-lang online community. Since the contributors are many and changing, they are accurately docu- mented only by navigation from erights.org. Here, I'd like to single out and express my gratitude speci¯cally to E's most creative and proli¯c user, Marc Stiegler. He is the creator and primary developer of the systems documented in Part IV: CapDesk, Polaris, and the DarpaBrowser. Without his contributions, the value of E would have remained inaccessibly abstract. This dissertation borrows liberally from several of my previous papers [MMF00, MYS03, MS03, MTS04, MTS05]. Without further attribution, I'd like to especially thank my co-authors on these papers: Bill Frantz, Chip Morningstar, Jonathan Shapiro, E. Dean Tribble, Bill Tulloh, and Ka-Ping Yee. I cannot hope to enumerate all their contributions to the ideas presented here. I'd also like to thank again all those who contributed to these prior papers: Yair Amir, Paul Baclace, Darius Bacon, Howie Baetjer, Hans Boehm, Dan Bornstein, Per Brand, Marc \Lucky Green" Briceno, Michael Butler, Tyler Close, John Corbett, M. Scott Doerrie, Jed Donnelley, K. Eric Drexler, Ian Grigg, Norm Hardy, Chris Hibbert, Jack High, Tad Hogg, David Hopwood, Jim Hopwood, Ted Kaehler, Ken Kahn, Piotr vii Kaminski, Alan Karp, Terence Kelly, Lorens Kockum, Matej Kosik, Kevin Lacobie, Charles Landau, Jon Leonard, Mark Lillibridge, Brian Marick, Patrick McGeer, Eric Messick, Greg Nelson, Eric Northup, Constantine Plotnikov, Jonathan Rees, Kevin Reid, Matthew Roller, Vijay Saraswat, Christian Scheideler, Scott Smith, Michael Sperber, Fred Spiessens, Swaroop Sridhar, Terry Stanley, Marc Stiegler, Nick Szabo, Kazunori Ueda, David Wagner, Bryce \Zooko" Wilcox-O'Hearn, Steve Witham, and the e-lang and cap-talk communities. Thanks to Ka-Ping Yee and David Hopwood for a wide variety of assistance. They reviewed numerous drafts, contributed extensive and deep technical feedback, clar- ifying rephrasings, crisp illustrations, and moral support. Ka-Ping Yee contributed Figures 14.2 (p. 107), 14.3 (p. 108), 16.1 (p. 118), and 17.1 (p. 124) with input from the e-lang community. Thanks to Terry Stanley for suggesting the listener pattern and purchase-order examples. Thanks to Marc Stiegler for the membrane example shown in Figure 9.3 (p. 71). Thanks to Darius Bacon for the promise pipelining ex- ample shown in Figure 16.1 (p. 118). Thanks to Mark Seaborn for suggesting that the when-catch expression evaluate to a promise for its handler's result, as explained in Section 18.1. Thanks to the Internet Assigned Numbers Authority, for choosing the perfect port number for Pluribus on their own. Thanks to Norm Hardy for bringing to my attention the relationship between knowledge and authority in computational systems. For helpful suggestions regarding the dissertation itself, I thank Yair Amir, Tyler Close, M. Scott Doerrie, K. Eric Drexler, Bill Frantz, Norm Hardy, Chris Hibbert, Ken Kahn, Alan Karp, Patrick McGeer, Chip Morningstar, Eric Northup, Jonathan Shapiro, Matthew Roller, Scott Smith, Mark Smotherman, Swaroop Sridhar, Terry Stanley, Marc Stiegler, E. Dean Tribble, Bill Tulloh, and Lauren Williams. I am eternally grateful to the board of Electric Communities for open sourcing E when their business plans changed. Thanks to Kevin Reid and E. Dean Tribble for keeping the E development process alive and well while I spent time on this dissertation. viii Contents Abstract iii Acknowledgements vii List of Tables xv List of Figures xvii 1 Introduction 1 1.1 Organization of this Dissertation ........................ 2 2 Approach and Contributions 5 2.1 Unattenuated Composition ........................... 5 2.2 Attenuating Authority .............................. 6 2.3 Distributed Access Control ........................... 6 2.4 Distributed Concurrency Control ........................ 7 2.5 Promise Pipelining ................................ 9 2.6 Delivering Messages in E-ORDER ....................... 9 2.7 Emergent Robustness .............................. 10 I The Software Composition Problem 13 3 Fragile Composition 15 3.1 Excess Authority: The Gateway to Abuse ................... 16 3.2 How Much Authority is Adequate? ....................... 17 3.3 Shared-State Concurrency is Di±cult ...................... 18 3.4 Why a Uni¯ed Approach? ............................ 19 3.5 Notes on Related Work on Designation ..................... 20 4 Programs as Plans 23 4.1 Using Objects to Organize Assumptions .................... 23 4.1.1 Decomposition .............................. 23 4.1.2 Encapsulation ............................... 24 4.1.3 Abstraction ................................ 24 4.1.4 Composition ............................... 25 4.2 Notes on Related Work ............................. 26 ix 5 Forms of Robustness 29 5.1 Vulnerability Relationships ........................... 29 5.2 Platform Risk ................................... 30 5.3 Conventional Correctness ............................ 30 5.4 Cooperative Correctness ............................. 31 5.5 Defensive Correctness .............................. 32 5.6 Defensive Consistency .............................. 32 5.7 A Practical Standard for Defensive Programming . 33 5.8 Notes on Related Work ............................. 35 6 A Taste of E 39 6.1 From Functions to Objects ........................... 39 6.1.1 Lambda Abstraction ........................... 39 6.1.2 Adding Message Dispatch ........................ 40 6.1.3 Adding Side E®ects ........................... 42 6.2 Composites and Facets .............................. 42 6.3 Soft Type Checking ............................... 44 6.4 Notes on Related Work ............................. 46 7 A Taste of Pluribus 49 7.1 Pointer Safety ................................... 49 7.2 Distributed Objects ............................... 50 7.3 Distributed Pointer Safety ............................ 51 7.4 Bootstrapping Initial Connectivity ....................... 52 7.5 No Central Points of Failure ........................... 52 7.6 Notes on Related Work ............................. 53 II Access Control 55 8 Bounding Access Rights 57 8.1 Permission and Authority ............................ 58 8.2 Notes on Related Work ............................. 61 9 The Object-Capability Paradigm 63 9.1 The Object-Capability Model .......................... 64 9.2 Reference Graph Dynamics ........................... 66 9.2.1 Connectivity by Initial Conditions ................... 66 9.2.2 Connectivity by Parenthood ....................... 66 9.2.3 Connectivity by Endowment ...................... 66 9.2.4 Connectivity by Introduction ...................... 67 9.2.5 Only Connectivity Begets Connectivity . 68 9.3 Selective Revocation: Redell's Caretaker Pattern . 68 9.4 Analysis and Blind Spots ............................ 70 9.5 Access Abstraction ...............................