
The CryptoGraphic Disk Driver Roland C. Dowdeswell John Ioannidis [email protected] [email protected] The NetBSD Project AT&T Labs – Research Abstract caching of data blocks less effective and have a serious We present the design and implementation of CGD, overall impact on performance. CFS also does not pro- the CryptoGraphic Disk driver. CGD is a pseudo-device tect the filesystem metadata as it encrypts each file sep- driver that sits below the buffer cache, and provides an arately and does not encrypt file system meta-data. It encrypted view of an underlying raw partition. It was de- may be possible in many scenarios to get much of the signed with high performance and ease of use in mind. information that is desired simply by examining the di- CGD is aimed at laptops, other single-user computers or rectory layout. TCFS also uses NFS as its transport, but removable storage, where protection from other concur- operates as an NFS client rather than a server. TCFS has rent users is not essential, but protection against loss or many more features than CFS, but also shares the draw- theft is important. backs of using NFS. To fulfill the needs for secure file storage in a laptop 1 Introduction environment, we built the CryptoGraphic Disk (CGD). The number of laptop users is increasing continuously, CGD is a device driver that looks just like an ordinary and with it the amount of sensitive data that resides out- disk drive, and encrypts an entire real disk partition. It side traditional data protection mechanisms—physical is thus suited for single-user environments (mostly lap- (security guards) or electronic (firewalls). There have tops) where protection from other users on the same ma- been several well-publicized cases of top executives hav- chine is not essential, but protection against physical loss ing their laptops lost or stolen, with highly sensitive is paramount, as is high performance. CGD was written corporate data in them [3]. In fact, any potentially re- for and is available in NetBSD, but can be readily ported movable storage suffers from such threats, as the case to any other BSD-derivative with very few changes. of the missing disk drives from a government research This is a similar approach to that taken by OpenBSD’s lab around 2000 [1] demonstrates. Some of the cases vnd(4) driver, FreeBSD’s GEOM driver and Linux’s involved the violation of doctor–patient privilege [10] loopback mounts. Each of these has a few drawbacks. which may expose doctors or hospitals to liability for OpenBSD’s vnd(4) driver and FreeBSD’s GEOM driver disclosing confidential patient data. When computers do not present a modular framework for defining encryp- are retired, the hard drives may contain sensitive data, tion methods which we discuss in Section 2. We dis- complicating their disposal. Cryptography provides the cuss some of the drawbacks of a vnd approach in Sec- ultimate protection in such cases, but while there exist tion 2.1. In Section 2.2, we discuss how OpenBSD’s many techniques and systems that employ cryptography vnd(4) driver, FreeBSD’s GEOM driver and Linux’s to protect files, many of them are cumbersome to use, loopback mounts do not have flexible key generation require expertise beyond that of the common user, or mechanisms, do not allow for n-factor authentication (unfortunately, in the case of many commercial systems) and do not adequately protect from dictionary attacks offer less security than advertised. We review some of against the pass phrase. these approaches in Section 4. There are many existing solutions to this problem, 2 Architecture and Implementation such as CFS[4], TCFS[5], OpenBSD’s vnd(4) encryp- In setting out to create a secure local storage facility tion, FreeBSD’s GEOM encryption, Linux’s loopback for Unix workstations, the main design considerations encryption, Cryptfs[17] and NCryptfs[16]. CFS and were flexibility, modularity, performance and robust- TCFS operate over the file system layer and for that rea- ness. The flexibility consideration implied the virtual son are well suited to encrypting files stored over a dis- disk approach. Using the disk-driver interface as the tributed file system such as NFS. CFS is implemented chosen abstraction gives its potential users the freedom as a userland NFS server and gains much in the way of to use any kind of file system they want on top of it, be portability, but unfortunately gains all of the drawbacks it FFS, swap space, or even space for a database appli- of NFS in the process. The semantics of NFS even on cation that writes to the raw partition. the local machine make file locking less reliable, make It is important that the design be modular since break- throughs in cryptanalysis are unpredictable and frequent. increases the number of places where deadlocks can oc- Being tied to a single cipher, a single method for choos- cur. In fact, we have run into such problems when trying ing IVs or a single method for generating keys would to run a system entirely off vnd disks on top of msdosfs force users to upgrade critical operating system compo- files. Secondly, because we are laying out an FFS (or nents upon the discovery of weaknesses or vulnerabil- some other) filesystem on top of a file which has already ities. Modularity also allows for use to be tailored to been laid out in an FFS filesystem, the upper filesystem a specific threat model. Allowing multiple ciphers en- will make block allocations based on erroneous assump- ables the user to perform cost-benefit analysis based on tions of block locality; these destroy many of the advan- an evaluation of their risk. Allowing multiple key gen- tages of the FFS layout algorithms. Experience with vnd eration methods allows CGD to be used under different actually indicates that this degradation is not that pro- threat models. For example, unattended booting might nounced, but that may be an artifact of the actual work- be a requirement and in this case it would make sense to load. Lastly, adding crypto to vnd as a way of provid- retrieve the keys from a GSS–API key server. N–factor ing an encrypted disk runs into ease-of-use problems. authentication might be required and CGD provides for To do so, a user would have to create a filesystem on this. the disk, allocate a single maximal-sized file, configure The performance consideration led to the decision it with vnd and partition the resulting pseudo-disk. At- to place the cryptographic disk functionality below the taching and mounting at runtime also add their share of buffer cache; that is, create a virtual disk driver that di- complexity. Complexity for the user is unacceptable un- rectly accesses the raw disk beneath it. This allows all less it delivers value; it is preferable to spend extra effort kernel-level (or even user-level) software that makes as- once if it results in easier use. Moreover, a user will im- sumptions about disk layout to work (whether these as- mediately recognize that, for example, /dev/cgd0a is an sumptions are justified is beyond the scope of this pa- encrypted device, rather than have to remember whether per). they configured the /dev/vnd0a with or without encryp- The robustness consideration led to the decision to tion. This last reason is why we did not release a null place the most complex code in user land in the con- encryption transform. figuration utility. The user land configuration utility per- CGD is a pseudo disk, in the same vein as the concate- forms all key management, key retrieval, etc. This leaves nated disk driver (ccd(4)) or RAIDframe (raid(4)). Ccd the kernel code the easier task of encrypting blocks takes multiple partitions and presents them as a single which makes the kernel code straightforward to audit. disk by either concatenating them or interleaving their The main disadvantage of the pseudo–disk approach blocks (RAID 0). RAIDframe uses the same techniques is that there is no per-user keying or any other per-user to provide RAID 0, 1, 4, and 5. cryptographic isolation. For better or worse, the security A disk device presents both a block interface and a model of Unix is left unchanged. This, of course, is not character interface. CGD does its interesting work in the a problem in the intended user-base for CGD, namely, strategy() call in the block interface and the ioctl() call in laptop users or owners of removable storage in national the character interface. The rest of the interface simply nuclear research laboratories. In any case, if the oper- presents a normal disk/pseudo-disk in the same way as ating system is not trusted to provide adequate protec- ccd(4), raid(4) or vnd(4). For further information about tion, potential intruders can read keys or buffer blocks the block and character devices please refer to “The De- off /dev/kmem anyway, so this is not as big a problem as sign and Implementation of the 4.4BSD Operating Sys- it first appears. tem”[11]. For the purposes of this project, we imple- The CGD code base consists of two parts: a kernel mented a generic set of functions that could be shared driver and user-level configuration software. We exam- by all of the pseudo–disks to simplify the code. ine these two parts next. The ioctl() function responds to all the normal disk ioctl(2)s and also presents two more: CGDIOCSET and 2.1 The Kernel Driver CGDIOCCLR.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages8 Page
-
File Size-