PROTECTION IN OPERATING SYSTEMS

DISTRIBUTED COMPUTING - SEMINAR
1
Sidharth D | sidharth363@gmail.com
What Protection is About?
●

Resources require protection from illegitimate
access.

●

That is, ensure that each object is accessed
correctly and only by those processes that are
allowed to do so.
2

Sidharth D | sidharth363@gmail.com
Principle of Protection
PRINCIPLE OF LEAST
PRIVILEGE

Programs, users and systems should be given just
enough privileges to perform their tasks
3
Sidharth D | sidharth363@gmail.com
Sources of Threats

MALICIOUS CODE

BUGGY CODE

4
Sidharth D | sidharth363@gmail.com
How to tackle illegitimate access?

Type – Safe Language

Hardware Support

5
Sidharth D | sidharth363@gmail.com
What is a Type – Safe Language?
●

Module A can access Module B only by using
method calls provided by programmer of B.

●

No pointers can be made up.

●

A module cannot change another module's
variables arbitrarily.
6

Sidharth D | sidharth363@gmail.com
Examples

C
Type-safe!

C++

Non-type-safe!
7

Sidharth D | sidharth363@gmail.com
Protection by Hardware Support
Modules can be protected from one another at the
level of individual invocations.
Made possible by :
KERNEL
8
Sidharth D | sidharth363@gmail.com
Kernel
●

Runs always

●

Has complete access privileges for the physical
resources.

●

Makes sure that other codes run legitimately.

9
Sidharth D | sidharth363@gmail.com
Modes of Execution
Kernel
processes

Supervisor mode
(privileged)

Other
processes

User mode
(unprivileged)
10

Sidharth D | sidharth363@gmail.com
Use of Address Spaces
●

Address space – collection of ranges of virtual memory
locations assigned to each process.

●

Kernel sets up address spaces.

●

Each address space has defined access rights
example: read-only, read-write etc.

●

A process cannot access memory outside its address space.
11

Sidharth D | sidharth363@gmail.com
User Process
●

Also called user–level process.

●

Executes in user mode.

●

Has user-level address space.
implication

Restricted Memory Access Rights
12
Sidharth D | sidharth363@gmail.com
Use of Address Spaces (contd.)
Process

Application code

Kernel code

User-level
address space

Kernel's address
space
13

Sidharth D | sidharth363@gmail.com
Use of Address Spaces (contd.)

User-level
address space

TRAP

Kernel's address
space

14
Sidharth D | sidharth363@gmail.com
TRAP
●

Invocation mechanism for resources managed by the kernel.

●

System call trap implemented by machine-level TRAP instruction.

Processor

TRAP

Supervisor mode

15
Sidharth D | sidharth363@gmail.com
TRAP (contd.)
●

On TRAP, hardware forces processor to execute a
kernel – supplied handler function.

●

Result : no process gains illicit control of the
hardware.

16
Sidharth D | sidharth363@gmail.com
Price for Protection
User-level
address space

Simple procedure or
method call

Many processor
cycles

Kernel's address
space

TRAP
17

Sidharth D | sidharth363@gmail.com
Winding Up...
●

Resources require protection from illegitimate access.

●

Principle of least privilege.

●

Sources – malicious code, buggy code.

●

Type-safe languages.

●

Hardware support (kernel).

●

Supervisor mode, privileged mode.

●

User address space, kernel's address space.

●

Price for protection.

Sidharth D | sidharth363@gmail.com

18
Reference
[1] G. Coulouris, et. al., “Operating system support,” in
Distributed Systems Concepts and Design, 4 th ed. Noida,
India: Dorling Kindersley(India) Pvt. Ltd., 2009, ch. 6,
sec. 3, pp. 210-211

19
Sidharth D | sidharth363@gmail.com
Thank you...

20
Sidharth D | sidharth363@gmail.com

Protection in Operating System Layer

  • 1.
    PROTECTION IN OPERATINGSYSTEMS DISTRIBUTED COMPUTING - SEMINAR 1 Sidharth D | sidharth363@gmail.com
  • 2.
    What Protection isAbout? ● Resources require protection from illegitimate access. ● That is, ensure that each object is accessed correctly and only by those processes that are allowed to do so. 2 Sidharth D | sidharth363@gmail.com
  • 3.
    Principle of Protection PRINCIPLEOF LEAST PRIVILEGE Programs, users and systems should be given just enough privileges to perform their tasks 3 Sidharth D | sidharth363@gmail.com
  • 4.
    Sources of Threats MALICIOUSCODE BUGGY CODE 4 Sidharth D | sidharth363@gmail.com
  • 5.
    How to tackleillegitimate access? Type – Safe Language Hardware Support 5 Sidharth D | sidharth363@gmail.com
  • 6.
    What is aType – Safe Language? ● Module A can access Module B only by using method calls provided by programmer of B. ● No pointers can be made up. ● A module cannot change another module's variables arbitrarily. 6 Sidharth D | sidharth363@gmail.com
  • 7.
  • 8.
    Protection by HardwareSupport Modules can be protected from one another at the level of individual invocations. Made possible by : KERNEL 8 Sidharth D | sidharth363@gmail.com
  • 9.
    Kernel ● Runs always ● Has completeaccess privileges for the physical resources. ● Makes sure that other codes run legitimately. 9 Sidharth D | sidharth363@gmail.com
  • 10.
    Modes of Execution Kernel processes Supervisormode (privileged) Other processes User mode (unprivileged) 10 Sidharth D | sidharth363@gmail.com
  • 11.
    Use of AddressSpaces ● Address space – collection of ranges of virtual memory locations assigned to each process. ● Kernel sets up address spaces. ● Each address space has defined access rights example: read-only, read-write etc. ● A process cannot access memory outside its address space. 11 Sidharth D | sidharth363@gmail.com
  • 12.
    User Process ● Also calleduser–level process. ● Executes in user mode. ● Has user-level address space. implication Restricted Memory Access Rights 12 Sidharth D | sidharth363@gmail.com
  • 13.
    Use of AddressSpaces (contd.) Process Application code Kernel code User-level address space Kernel's address space 13 Sidharth D | sidharth363@gmail.com
  • 14.
    Use of AddressSpaces (contd.) User-level address space TRAP Kernel's address space 14 Sidharth D | sidharth363@gmail.com
  • 15.
    TRAP ● Invocation mechanism forresources managed by the kernel. ● System call trap implemented by machine-level TRAP instruction. Processor TRAP Supervisor mode 15 Sidharth D | sidharth363@gmail.com
  • 16.
    TRAP (contd.) ● On TRAP,hardware forces processor to execute a kernel – supplied handler function. ● Result : no process gains illicit control of the hardware. 16 Sidharth D | sidharth363@gmail.com
  • 17.
    Price for Protection User-level addressspace Simple procedure or method call Many processor cycles Kernel's address space TRAP 17 Sidharth D | sidharth363@gmail.com
  • 18.
    Winding Up... ● Resources requireprotection from illegitimate access. ● Principle of least privilege. ● Sources – malicious code, buggy code. ● Type-safe languages. ● Hardware support (kernel). ● Supervisor mode, privileged mode. ● User address space, kernel's address space. ● Price for protection. Sidharth D | sidharth363@gmail.com 18
  • 19.
    Reference [1] G. Coulouris,et. al., “Operating system support,” in Distributed Systems Concepts and Design, 4 th ed. Noida, India: Dorling Kindersley(India) Pvt. Ltd., 2009, ch. 6, sec. 3, pp. 210-211 19 Sidharth D | sidharth363@gmail.com
  • 20.
    Thank you... 20 Sidharth D| sidharth363@gmail.com