Systems for Safety and DependabilityDavid Evanshttp---.ppt
《Systems for Safety and DependabilityDavid Evanshttp---.ppt》由会员分享,可在线阅读,更多相关《Systems for Safety and DependabilityDavid Evanshttp---.ppt(33页珍藏版)》请在麦多课文档分享上搜索。
1、Systems for Safety and DependabilityDavid Evans http:/www.cs.virginia.edu/evans/,University of Virginia Department of Computer Science,2,14 December 1999,Safety and Dependability,What Are You Afraid Of?,Malicious attacks Russian New Year, Melissa, Chernobyl, Java thread attack, etc. Buggy programs C
2、an cause harm accidentally Can be exploited by attackers User mistakes/bad interfaces tar cf *,3,14 December 1999,Safety and Dependability,Menu,Naccio: Policy-Directed Code SafetyHow do you prevent bad programs from doing bad things?naccio.cs.virginia.eduLCLint: Annotation-Assisted Static CheckingHo
3、w do you help good people not write bad programs?lclint.cs.virginia.edu,4,14 December 1999,Safety and Dependability,Naccio Motivation,Weaknesses in existing code safety systems: Limited range of policies Policy definition is ad hoc and platform dependent Enforcement is tied to a particular architect
4、ure Can we solve them without sacrificing efficiency or convenience?,Yes!,5,14 December 1999,Safety and Dependability,General method for defining policies Abstract resources Platform independent System architecture for enforcing policies Prototypes for JavaVM classes, Win32 executables,Program,Safe
5、Program,Naccio,Safety Policy,Naccio Overview,6,14 December 1999,Safety and Dependability,Problem,Users View,Files,Resources,Policy,System View,WriteFile (fHandle, ),Disk,Program,System Library,OS Kernel,tar cf *,Platform Interface,7,14 December 1999,Safety and Dependability,Safety Policy Definition,
6、Resource descriptions: abstract operational descriptions of resources (files, network, ) Platform interface: mapping between system events (Java API calls) and abstract resourcesResource use policy: constraints on manipulating those resources,8,14 December 1999,Safety and Dependability,global resour
7、ce RFileSystemopenRead (file: RFile) Called before file is opened for readingopenWrite (file: RFile) Called before existing file is opened for writingwrite (file: RFile, nbytes: int)Called before nbytes are written to file / other operations for observing properties of files, deleting, etc.resource
8、RFile RFile (pathname: String) Constructs object corresponding to pathname,Resource Description,9,14 December 1999,Safety and Dependability,Java PFI Excerpt,wrapper java.io.FileOutputStreamrequires RFileMap;state RFile rfile;wrapper void write (byte b)if (rfile != null) RFileSystem.write (rfile, b.l
9、ength);% / original method call / wrappers needed for constructors, other write/ methods, close and getFD,10,14 December 1999,Safety and Dependability,Resource Use Policy,policy LimitWriteLimitBytesWritten (1000000), NoOverwriteproperty LimitBytesWritten (n: int)requires TrackBytesWritten;check RFil
10、eSystem.write (file: RFile, nbytes: int)if (bytes_written n) violation (“Writing more than ”); stateblock TrackBytesWrittenaddfield RFileSystem.bytes_written: int = 0;precode RFileSystem.write (file: RFile, nbytes: int) bytes_written += nbytes;,11,14 December 1999,Safety and Dependability,Enforceabl
11、e Policies,Can enforce any policy that can be defined What can be defined depends on resource operations Resource operations depend on platform interface Any manipulation done through API calls Cannot constrain CPU usage Solutions possible: insert calls Portable policies use standard resources,12,14
12、 December 1999,Safety and Dependability,System architecture Defining policiesEnforcing policiesArchitectureResults JavaVM, Win32,Outline,Program,Safe Program,Naccio,Safety Policy,13,14 December 1999,Safety and Dependability,Policy description file,Applicationtransformer,Program,Version of program th
13、at:Uses policy-enforcing system librarySatisfies low-level code safety,Naccio Architecture,Platforms in development: JavaVM program is collection of Java classes Win32 program is Win32 executable and DLLs,Per application,Policy compiler,Safety policy definition,Policy-enforcing system library,Per po
14、licy,14,14 December 1999,Safety and Dependability,Policy description file,Resource descriptions,System library Java library classes,Platform interface Describes Java API,Platform independent analyses,Platform dependent analyses and code generation,Resource use policy,Policy Compiler,Policy-enforcing
15、 system library Implementations of resource operations Perform checking described by resource use policy Modifies Java byte codes Call abstract resource operations as directed by platform interface,package naccio.p253.resource; class RFileSystem static int bytes_written = 0;static void write (RFile
16、file, int nbytes) bytes_written += nbytes; if (bytes_written 1000000) Check.violation (“LimitWrite”, “Attempt to write );,Policy compiler,Resource implementations,Resource use policy,stateblock TrackBytesWrittenaddfield RFileSystem.bytes_written: int;precode RFileSystem.write (file: RFile, nbytes: i
17、nt) bytes_written += nbytes; property LimitBytesWritten (n: int)check RFileSystem.write (file: RFile, nbytes: int)if (bytes_written n) violation (“Attempt );,Implementing Resources,RFileSystem RFile,Resource descriptions,policy LimitWriteNoOverwrite,LimitBytesWritten (1000000),16,14 December 1999,Sa
18、fety and Dependability,class FileOutputStream public void write (byte b) writeBytes (b, 0, b.length); ,class FileOutputStream naccio.p253.resource.RFile rfile; / orig_write same implementation as old write methodvoid write (byte b) if (rfile != null) naccio.p253.resource.RFileSystem.write (rfile, b.
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- SYSTEMSFORSAFETYANDDEPENDABILITYDAVIDEVANSHTTPPPT

链接地址:http://www.mydoc123.com/p-389574.html