The processes in an operating system must be protected from one another’s



tải về 252.86 Kb.
Chế độ xem pdf
trang6/34
Chuyển đổi dữ liệu13.12.2022
Kích252.86 Kb.
#53970
1   2   3   4   5   6   7   8   9   ...   34
Abraham Silberschatz-Operating System Concepts (9th,2012.12)-trang-649-679

Figure 14.1 System with three protection domains.


14.3
Domain of Protection
629
Thus, the need-to-know principle is violated. We must allow the contents of
a domain to be modified so that the domain always reflects the minimum
necessary access rights.
If the association is dynamic, a mechanism is available to allow
domain
switching
, enabling the process to switch from one domain to another. We may
also want to allow the content of a domain to be changed. If we cannot change
the content of a domain, we can provide the same effect by creating a new
domain with the changed content and switching to that new domain when we
want to change the domain content.
A domain can be realized in a variety of ways:

Each user may be a domain. In this case, the set of objects that can be
accessed depends on the identity of the user. Domain switching occurs
when the user is changed—generally when one user logs out and another
user logs in.

Each process may be a domain. In this case, the set of objects that can be
accessed depends on the identity of the process. Domain switching occurs
when one process sends a message to another process and then waits for
a response.

Each procedure may be a domain. In this case, the set of objects that can be
accessed corresponds to the local variables defined within the procedure.
Domain switching occurs when a procedure call is made.
We discuss domain switching in greater detail in Section 14.4.
Consider the standard dual-mode (monitor–user mode) model of
operating-system execution. When a process executes in monitor mode, it
can execute privileged instructions and thus gain complete control of the
computer system. In contrast, when a process executes in user mode, it can
invoke only nonprivileged instructions. Consequently, it can execute only
within its predefined memory space. These two modes protect the operating
system (executing in monitor domain) from the user processes (executing
in user domain). In a multiprogrammed operating system, two protection
domains are insufficient, since users also want to be protected from one
another. Therefore, a more elaborate scheme is needed. We illustrate such a
scheme by examining two influential operating systems—
UNIX
and
MULTICS
—to see how they implement these concepts.
14.3.2 An Example: UNIX
In the
UNIX
operating system, a domain is associated with the user. Switching
the domain corresponds to changing the user identification temporarily.
This change is accomplished through the file system as follows. An owner
identification and a domain bit (known as the
setuid bit
) are associated with
each file. When the setuid bit is
on
, and a user executes that file, the
user
ID
is
set to that of the owner of the file. When the bit is
off
, however, the
user
ID
does not change. For example, when a user (that is, a user with
user
ID
=
A
) starts executing a file owned by B, whose associated domain bit is
off
, the
user
ID
of the process is set to A. When the setuid bit is
on
, the
user
ID
is set to



tải về 252.86 Kb.

Chia sẻ với bạn bè của bạn:
1   2   3   4   5   6   7   8   9   ...   34




Cơ sở dữ liệu được bảo vệ bởi bản quyền ©hocday.com 2024
được sử dụng cho việc quản lý

    Quê hương