Ring (computer security)

Ring (computer security)

In computer science, hierarchical protection domains, [Paul A. Karger, Andrew J. Herbert, " [http://doi.ieeecomputersociety.org/10.1109/SP.1984.10001 An Augmented Capability Architecture to Support Lattice Security and Traceability of Access] ", sp, p. 2, 1984 IEEE Symposium on Security and Privacy, 1984] [Walter Binder, " [http://doi.ieeecomputersociety.org/10.1109/SAINT.2001.905166 Design and Implementation of the J-SEAL2 Mobile Agent Kernel] ", saint, p. 35, 2001 Symposium on Applications and the Internet (SAINT'01), 2001] often called protection rings, are a mechanism to protect data and functionality from faults (fault tolerance) and malicious behaviour (computer security). This approach is diametrically opposite to that of capability-based security.

Computer operating systems provide different levels of access to resources. A protection ring is one of two or more hierarchical "levels" or "layers" of privilege within the architecture of a computer system. This is generally hardware-enforced by some CPU architectures that provide different CPU modes at the firmware level. Rings are arranged in a hierarchy from most privileged (most trusted, usually numbered zero) to least privileged (least trusted, usually with the highest ring number). On most operating systems, Ring 0 is the level with the most privileges and interacts most directly with the physical hardware such as the CPU and memory.

Special gates between rings are provided to allow an outer ring to access an inner ring's resources in a predefined manner, as opposed to allowing arbitrary usage. Correctly gating access between rings can improve security by preventing programs from one ring or privilege level from misusing resources intended for programs in another. For example, spyware running as a user program in Ring 1 should be prevented from turning on a web camera without informing the user, since hardware access should be a Ring 0 function reserved for device drivers. Programs such as web browsers running in higher numbered rings must request access to the network, a resource restricted to a lower numbered ring.

Implementations

Hardware supported rings were among the more revolutionary concepts introduced by the Multics operating system, a highly secure predecessor of today's UNIX family of operating systems. However, most general-purpose UNIX systems use only two rings, even if the hardware it runs on provides more CPU modes than that.

Many modern CPU architectures (including the popular Intel x86 architecture) include some form of ring protection, although the Windows NT operating system, like Unix, does not fully exploit this feature. Its predecessor, OS/2, did to some extent, as it used three rings: ring 0 for kernel code and device drivers, ring 2 for privileged code (user programs with I/O access permissions), and ring 3 for unprivileged code (nearly all user programs).

There has been a renewed interest in this design structure, with the proliferation of the Xen VMM software, ongoing discussion on monolithic- vs micro-kernel (particularly in Usenet newsgroups and Web forums), Microsoft's "Ring-1" design structure as part of their NGSCB initiative and hypervisors embedded in firmware such as Intel's Vanderpool technology.

The original Multics system had eight rings, but many modern systems have fewer. The hardware is aware of the current ring of the executing instruction thread at all times, thanks to special machine registers. In some systems, areas of virtual memory are also assigned ring numbers in hardware, and/or the most privileged ring is given special capabilities (such as real memory addressing that bypasses the virtual-memory hardware).

The hardware severely restricts the ways in which control can be passed from one ring to another, and also enforces restrictions on the types of memory access that can be performed across rings. Typically there is a special "gate" or "call" instruction that transfers control in a secure way towards predefined entry points in lower-level (more trusted) rings; this functions as a supervisor call in many operating systems that use the ring architecture. The hardware restrictions are designed to limit opportunities for accidental or malicious breaches of security.

Ring protection can be combined with processor modes (master/kernel/privileged mode versus slave/user/unprivileged mode) in some systems. Operating systems running on hardware supporting both may use both forms of protection or only one.

Effective use of ring architecture requires close cooperation between hardware and the operating system. Operating systems designed to work on multiple hardware platforms may make only limited use of rings if they are not present on every supported platform. Often the security model is simplified to "kernel" and "user" even if hardware provides finer granularity through rings.

upervisor mode

In computer terms supervisor mode (sometimes called kernel mode) is a hardware-mediated flag which can be changed by code running in system-level software. System-level tasks or threads will have this flag set while they are running, whereas user-space applications will not. This flag determines whether it would be possible to execute machine code operations such as modifying registers for various descriptor tables, or performing operations such as disabling interrupts. The idea of having two different modes to operate in comes from “with more control comes more responsibility” — a program in supervisor mode is trusted never to fail, since a failure may cause the whole computer system to crash.

As summarized on [http://foldoc.org/index.cgi?query=supervisor+mode&action=Search foldoc.org] , supervisor mode is “An execution mode on some processors which enables execution of all instructions, including privileged instructions. It may also give access to a different address space, to memory management hardware and to other peripherals. This is the mode in which the operating system usually runs.”

In a monolithic kernel, the kernel runs in supervisor mode and the applications run in user mode. Other types of operating systems, like those with an exokernel or microkernel do not necessarily share this behavior.

Some examples from the PC world:

: Linux and Windows are two operating systems that use supervisor/user-mode. To perform specialized functions, user-mode code must perform a system call into kernel-space (running in supervisor mode) where trusted code in the operating system will perform the needed task.

: DOS, other simple operating systems, and many embedded devices run in supervisor mode permanently, meaning that drivers can be written directly as user programs.

Most processors have at least two different modes. The x86-processors have four different modes divided into four different rings. Programs that run in Ring 0 can do "anything" with the system, and code that runs in Ring 3 should be able to fail at any time without impact to the rest of the computer system. Ring 1 and Ring 2 are rarely used, but could be configured with different levels of access.

Switching from “user mode” to “kernel mode” is, in most existing systems, very expensive. It has been measured, on the basic request getpid, to cost 1000-1500 cycles on most machines. Of these just around 100 are for the actual switch (70 from user to kernel space, and 40 back), the rest is "kernel overhead".Jochen Liedtke. " [http://i30www.ira.uka.de/research/publications/papers/index.php?lid=en&docid=642 On µ-Kernel Construction] ", "Proc. 15th ACM Symposium on Operating System Principles (SOSP)", December 1995] Ousterhout, J. K. 1990. "Why aren't operating systems getting faster as fast as hardware?" In Usenix Summer Conference, Anaheim, CA, pp. 247{256.] In the L3 microkernel the minimization of this overhead reduced the overall cost to around 150 cycles.

Maurice Wilkes wrote: [Maurice Wilkes " [http://doi.acm.org/10.1145/198153.198154 Operating systems in a changing world] " ACM SIGOPS Operating Systems Review. Volume 28 , Issue 2 (April 1994). pp. 9 - 21 ISSN:0163-5980 [http://cat.inist.fr/?aModele=afficheN&cpsidt=4146165] [http://www.soe.ucsc.edu/~brucem/soft_ins/dissert.html quote from] .]

... it eventually became clear that the hierarchical protection that rings provided did not closely match the requirements of the system programmer and gave little or no improvement on the simple system of having two modes only. Rings of protection lent themselves to efficient implementation in hardware, but there was little else to be said for them. [...] The attractiveness of fine-grained protection remained, even after it was seen that rings of protection did not provide the answer... This again proved a blind alley...

To gain performance and determinism, some systems place functions that would likely be viewed as application logic, rather than as device drivers, in kernel mode; security applications (access control, firewalls, etc.) and operating system monitors are cited as examples. At least one embedded database management system, "e"X"treme"DB Kernel Mode, has been developed specifically for kernel mode deployment, to provide a local database for kernel-based application functions, and to eliminate the context switches that would otherwise occur when kernel functions interact with a database system running in user mode. [Gorine, Andrei and Krivolapov, Alexander. [http://www.ddj.com/database/207401567 "Kernel Mode Databases: A DBMS Technology For High-Performance Applications"] , "Dr. Dobb's Journal", May, 2008..]

Hypervisor mode

Recent CPUs from Intel and AMD offer x86 virtualization instructions for a hypervisor to control Ring 0 hardware access. Although they are mutually incompatible, both Intel's "Vanderpool" (or VT) and AMD's "Pacifica" (AMD-V) create a new "Ring -1" so that a guest operating system can run Ring 0 operations natively without affecting other guests or the host OS. [cite web | last=Dornan | first=Andy | year=2005-11-01 | url=http://www.networkcomputing.com/showArticle.jhtml?articleID=172302134 | title=Intel VT vs. AMD Pacifica | publisher=CMP | accessdate=2008-07-16 ]

Interoperation between CPU and OS levels of abstraction

Many CPU hardware architectures provide far more flexibility than is exploited by the operating systems that they normally run. Proper use of complex CPU modes requires very close cooperation between the operating system and the CPU, and thus tends to tie the OS to the CPU architecture. When the OS and the CPU are specifically designed for each other, this is not a problem (although some hardware features may still be left unexploited), but when the OS is designed to be compatible with multiple, different CPU architectures, a large part of the CPU mode features may be ignored by the OS. For example, Windows NT was designed to be portable and many architectures at the time only supported user and kernel mode.

Multics was an operating system designed specifically for a special CPU architecture (which in turn was designed specifically for Multics), and it took full advantage of the CPU modes available to it. However, it was an exception to the rule. Today, this high degree of interoperation between the OS and the hardware is not often cost-effective, despite the potential advantages for security and stability.

Ultimately, the purpose of distinct operating modes for the CPU is to provide hardware protection against accidental or deliberate corruption of the system environment (and corresponding breaches of system security) by software. Only "trusted" portions of system software are allowed to execute in the unrestricted environment of kernel mode, and only then when absolutely necessary. All other software executes in one or more user modes. If a processor generates a fault or exception condition in a user mode, in most cases system stability is unaffected; if a processor generates a fault or exception condition in kernel mode, most operating systems will halt the system with an unrecoverable error. When a hierarchy of modes exists (ring-base security), faults and exceptions at one privilege level may destabilize only the higher-numbered privilege levels. Thus, a fault in Ring 0 (the kernel mode with the highest privilege) will crash the entire system, but a fault in Ring 2 will only affect rings 3 and beyond and Ring 3 itself, at most.

Transitions between modes are at the discretion of the executing thread when the transition is from a level of high privilege to one of low privilege (as from kernel to user modes), but transitions from lower to higher levels of privilege can take place only through secure, hardware-controlled "gates" that are traversed by executing special instructions or when external interrupts are received.

Microkernel operating systems attempt to minimize the amount of code running in privileged mode, for purposes of security and elegance.

See also

* System call
* Protected mode (x86-compatible CPUs of the 80286 series or later)
* THE multiprogramming system
* Multics

Further reading


* David T. Rogers: [http://theses.nps.navy.mil/03Jun_Rogers_David.pdf A FRAMEWORK FOR DYNAMIC SUBVERSION] Thesis, June 2003 (pdf)
* Glossary of Multics acronyms and terms: [ftp://ftp.stratus.com/vos/multics/tvv/mgr.html#ring Ring]
* William J. Caelli: [http://cisse.info/history/CISSE%20J/2002/cael.pdfRelearning "Trusted Systems" in an Age of NIIP: Lessons from the Past for the Future.] 2002 (pdf)
* [http://www.warpspeed.com.au/cgi-bin/inf2html.cmd?..htmlookddkPDRREF.INF+5 Presentation Device Driver Reference for OS/2] 5. Introduction to OS/2 Presentation Drivers
* Haruna R. Isa, William R. Shockley, Cynthia E. Irvine: [http://cisr.nps.navy.mil/downloads/99paper_multithread.pdf A Multi-threading Architecture for Multilevel Secure Transaction Processing] 1999 (pdf)
* Ivan Kelly: [http://minixonxen.skynet.ie Report Porting MINIX to Xen] 2006
* Paul Barham, Boris Dragovic, Keir Fraser, Steven Hand, Tim Harris, Alex Ho, Rolf Neugebauer, Ian Pratt, Andrew Warfield: [http://www.cl.cam.ac.uk/netos/papers/2003-xensosp.pdf Xen and the Art of Virtualization] 2003 (pdf)
* Marcus Peinado, Yuqun Chen, Paul England, and John Manferdelli: [http://research.microsoft.com/~yuqunc/papers/ngscb.pdf NGSCB: A Trusted Open System] (pdf)
* Michael D. Schroeder, Jerome H. Saltzer: [ftp://ftp.digital.com/pub/Digital/SRC/publications/mds/protection.pdf A Hardware Architecture for Implementing Protection Rings] 1972 (pdf)
* [http://download.intel.com/design/PentiumII/manuals/24319202.pdf Intel Architecture Software Developer's Manual Volume 3: System Programming] (Order Number 243192) Chapter 4 Protection; section 4.5 Privilege levels. (pdf)
* Tzi-cker Chiueh, Ganesh Venkitachalam, Prashant Pradhan: [http://portal.acm.org/ft_gateway.cfm?id=319161&type=pdf&coll=portal&dl=ACM&CFID=15151515&CFTOKEN=6184618 Integrating segmentation and paging protection for safe, efficient and transparent software extensions] 1999 Chapter 3: Protection hardware features in Intel X86 architecture; section 3.1 Protection checks. (pdf)
* Takahiro Shinagawa, Kenji Kono, Takashi Masuda: [http://www.is.s.u-tokyo.ac.jp/tech-reports/TR00-02-a4.pdf Exploiting Segmentation Mechanism for Protecting Against Malicious Mobile Code] 2000 chapter 3 Implementation; section 3.2.1 Ring Protection (pdf)
*Boebert, William Earl and R. Kain. "A Practical Alternative to Hierarchical Integrity Policies". Proceedings of the 8th National Computer Security Conference, 1985.
*Gorine, Andrei and Krivolapov, Alexander. [http://www.ddj.com/database/207401567 Kernel Mode Databases: A DBMS technology for high-performance applications] , "Dr. Dobb's Journal", May, 2008.

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Computer security compromised by hardware failure — is a branch of computer security applied to hardware. The objective of computer security includes protection of information and property from theft, corruption, or natural disaster, while allowing the information and property to remain accessible …   Wikipedia

  • Ring — may refer to: Ring (jewellery), a decorative ornament worn on fingers, toes, or around the arm or neck Contents 1 Computing 2 Entertainment 3 …   Wikipedia

  • Computer insecurity — This article is about computer security exploits and defenses. For computer security through design and engineering, see computer security. Computer security Secure operating systems Security architecture Security by design Secure coding …   Wikipedia

  • Ring Raiders — Articleissues citations missing = August 2008 refimprove = August 2008Infobox Television show name = Ring Raiders caption = format = Animated creator = DIC Entertainment Those Characters from Cleveland writer = Phil Harnage voices = Dan Gilvezan… …   Wikipedia

  • Kernel (computer science) — In computer science, the kernel is the central component of most computer operating systems (OS). Its responsibilities include managing the system s resources (the communication between hardware and software components). As a basic component of… …   Wikipedia

  • Computer network — Computer networks redirects here. For the periodical, see Computer Networks (journal). Datacom redirects here. For other uses, see Datacom (disambiguation). Internet map. The Internet is a global system of interconnected computer networks that… …   Wikipedia

  • Computer crime — Computer crime, or cybercrime, refers to any crime that involves a computer and a network.[1] The computer may have been used in the commission of a crime, or it may be the target.[2] Netcrime refers to criminal exploitation of the Internet.[3]… …   Wikipedia

  • Computer networking — is the engineering discipline concerned with communication between computer systems or devices. Networking, routers, routing protocols, and networking over the public Internet have their specifications defined in documents called RFCs. [… …   Wikipedia

  • Ring of Death — Xbox 360 Hersteller Microsoft …   Deutsch Wikipedia

  • computer — computerlike, adj. /keuhm pyooh teuhr/, n. 1. Also called processor. an electronic device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations. Cf. analog… …   Universalium

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”