Operating System Security Features, Explained

UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 9.7 Free with a free account

Operating System Security Features

Introduction to Operating Systems · Chapter 9: Computer Security and Threat PreventionSection 9.7 · lesson 75 of 838 min · free with a free account

← System HardeningNext lesson: User Access Control →

A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

In this lesson

Built-in protections from kernel mode to secure boot and code signing.

  • Explain user mode, kernel mode, and the role of system calls
  • Describe how memory protection, DEP, and ASLR block attacks
  • Explain how sandboxes limit what apps can touch
  • Describe how secure boot and code signing build a chain of trust

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,169 words). Read along, or search it.

Opening Analogy

An Airport's Layout Does the Work

An airport has locks on its doors. But its real safety comes from the layout. You can't walk from the check-in hall to a plane without passing the scanners. And only badge holders may enter the baggage area. An operating system is designed the same way. Long before you install any security program, it already keeps programs apart, keeps ordinary code away from the hardware, and checks who made the software it runs.

Privilege Levels

User Mode and Kernel Mode

The processor can run at two privilege levels. In kernel mode, code may do anything: touch any memory, talk to any device, change any setting. The kernel, from lesson 1.4, runs here. In user mode, code is limited. It can't touch hardware directly, and it can't read memory that belongs to others. Your browser, a game, and a spreadsheet run here. Think of a library where the librarian sits at a desk. You don't walk into the back office and rewrite the catalog. You ask, and the librarian decides. When a user-mode program wants to read a file, it makes a system call, from lesson 2.3: a polite request across the border. The kernel checks whether this program is allowed, then does the work, or refuses.

Memory Protection

Each Process Keeps Its Own Slice

Every running program has its own private slice of memory, as lessons 4.5 and 4.6 showed. The operating system and the processor enforce memory protection together: a process may use its own slice, and nothing else. If it reaches for memory that isn't its own, the hardware raises an error, and the system stops the offender. That crash is called a segmentation fault. So one program's bug, or one program's bad intent, can't quietly read or change another program.

Exploit Defenses

No-Execute Pages and Random Addresses

Attackers have long tried to sneak their own instructions into a program's memory, then trick the program into running them. Modern systems add two protections. The first is the N X bit, for no execute. Windows calls the feature Data Execution Prevention, or D E P. Each page of memory is marked as data, or as code, never both. A page holding text that a user typed may be read and written, but not run. If a flaw makes the program jump into it, the processor refuses. The second is A S L R: address space layout randomization. It puts the parts of a program at different, random addresses each time it starts. An attacker who needs to know exactly where something sits has to guess. Picture a bank that moves its vault to a different room every morning. Both are on by default in today's Windows, macOS, Linux, Android, and iOS. You never see them, unless a program crashes trying something it shouldn't.

Quick Check

A Learned Address That Misses

Quick check. An attacker studies a program on their own computer, and learns the exact address of a useful piece of code. On the victim's computer, the same jump lands on nothing useful, and the program simply crashes. Which protection spoiled the attack? Pause, and decide. Address space layout randomization: A S L R. The program's parts sat at different, random addresses on the victim's machine, so the address learned at home was wrong. Memory protection keeps one process out of another, but this jump stayed inside one program. And code signing checks files before they run, not addresses while they run.

Sandboxing

Apps Fenced Inside a Sandbox

A sandbox is a fenced area where a program may run, with strict limits on what it may touch. A child can build anything in a sandbox, but the sand stays in the box. An app in a sandbox gets its own folder. It may use the camera, the contacts, or the network, only if the system grants it. Phone apps work this way, as lesson 1.6 showed: the weather app can't read your messages. Browsers fence off each tab and extension. And virtual machines, in lesson 10.1, are an even bigger sandbox. A sandbox doesn't assume the program is good. It assumes it might be buggy or hostile, and limits the damage in advance. That's least privilege, applied to software. The common mistake is saying yes to every permission prompt. A flashlight app that asks for your contacts wants something its job doesn't need.

Secure Boot

A Chain of Trust from Startup

All of these protections assume the operating system itself is genuine. What if something swapped it for a fake, before it even started? That's the job of secure boot. When the computer starts, the firmware checks that the bootloader carries a valid digital signature from a known maker. The bootloader then checks the kernel, and the kernel checks its drivers. Each step proves the next, one link after another. This is a chain of trust. If a link has been tampered with, its check fails, and the start-up stops there, or warns you. On Apple's own chips, the chain starts in read-only code built into the chip.

Code Signing

Signatures Prove Who and Unchanged

Code signing uses the same idea for ordinary programs. A publisher signs its software with a secret key. The system checks the signature with the matching public key, the idea from lesson 7.5. If even one byte of the program has changed since signing, the check fails, and the system warns you, or refuses to run it. A valid signature tells you two things: who published the software, and that nobody changed it afterward. It doesn't promise the software is harmless. Only that it's exactly what the publisher shipped.

Quick Check

An Installer with Extra Code

Quick check. Sam, who runs a small online bakery, wants an accounting app. The download page names the real publisher. But a stranger has added extra code to the installer file. Sam double-clicks it. What does the system do? Pause, and decide. It warns, or refuses. The signature was made over the original file, so added code means it no longer matches. A famous name doesn't help: the signature proves the file is unchanged, and this one isn't. And a sandbox limits what a program may touch. It doesn't catch a changed file.

Real Example

An Unverified Recipe Organizer

Earlier, Sam had downloaded a free recipe organizer, and the laptop warned that the publisher could not be verified. Sam almost clicked past it. Ivy, who looks after the computers at a school, explained the warning. The file carried no valid signature, so nothing proved who made it, or that it was unchanged. So Sam got the app from the official store instead, where programs are checked, and run inside a sandbox.

Summary

Layout Does Most of the Work

Back to the airport. Its layout does most of the work: scanners on the only path, and badges for the back rooms. Your operating system does the same, with user and kernel mode, memory protection, D E P and A S L R, sandboxes, and a chain of trust from the very first instruction.

Key Takeaways

Built-In Protections Reviewed

To recap. Ordinary programs run in user mode, and must ask the kernel through system calls. Memory protection keeps each process in its own memory. And D E P and A S L R make injected code hard to run. Sandboxes limit, in advance, what an app may touch. And secure boot and code signing check who made the software, and that it hasn't changed.

About Introduction to Operating Systems at UPI Study

Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About Operating System Security Features

How does the split between user mode and kernel mode protect a computer?
Kernel mode lets code touch any memory, device, or setting, while user mode stops code from reaching hardware directly or reading other programs' memory. The kernel runs in kernel mode, and browsers, games, and spreadsheets run in user mode. When a user-mode program needs something privileged, such as reading a file, it makes a system call, and the kernel checks permission before doing the work or refusing.
How do DEP and ASLR protect against attacks?
DEP and ASLR make injected attack code hard to run. DEP, Windows' name for the no-execute or NX feature, marks each memory page as data or code, so typed-in data cannot be executed. ASLR, address space layout randomization, places a program's parts at random addresses each time it starts, so an attacker cannot count on a known location. Both are on by default in today's major operating systems.
What is secure boot?
Secure boot checks that each piece of start-up software is genuine before it runs. The firmware verifies the bootloader's digital signature, the bootloader verifies the kernel, and the kernel verifies its drivers, forming a chain of trust. If any link has been tampered with, its check fails and start-up stops or warns the user. On Apple's own chips, the chain begins in read-only code built into the chip.
Does a valid code signature mean software is safe?
No, a valid code signature does not prove software is harmless. It shows two things: who published the software, and that not one byte has changed since it was signed. The publisher signs with a secret key, and the system checks with the matching public key. If a stranger adds code to an installer, the signature no longer matches, and the system warns or refuses to run it.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Introduction to Operating Systems.

83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Updated

Introduction to Operating Systems
3 credits · NCCRS
Enroll →