Protection & Security MCQs for the NSCT
Protection and security cover how an operating system controls which processes and users may use which resources, and how it defends itself against attacks. Silberschatz draws a clear line between the two. Protection is the internal mechanism (domains, access rights, the access matrix). Security adds authentication and defence against threats such as Trojan horses, buffer overflows and worms. This is topic 12 of the 12 in the Operating Systems area, which carries 5% of the NSCT according to HEC's Areas of Competencies.
Operating Systems had the lowest accuracy of any area in 2026, at 33.8%, per the HEC NSCT report. The same ideas also appear in the Cyber Security area (5%), so this topic pays off twice. For the wider security view, see Operating System Security in that area.
Access matrix
Here are the key terms:
- A protection domain is a set of (object, rights) pairs, such as (file F1, {read, write}).
- The principle of least privilege gives each domain only the rights it needs.
- The access matrix has one row per domain and one column per object. Entry access(i, j) lists what a process in domain Di may do to object Oj.
Here is a small example:
| F1 | F2 | Printer | D2 | |
|---|---|---|---|---|
| D1 | read | read* | switch | |
| D2 | write | owner, read | ||
| D3 | execute |
Silberschatz adds special rights that let the matrix change in a controlled way:
- Copy (*): D1's read on F2 lets it copy read into another domain's F2 entry. Under the limited copy* rule, the copy is plain read, so it cannot spread further.
- Owner: D2 owns F2, so it can add or remove any right in F2's column.
- Switch: D1 can switch to D2 and then print. In UNIX, the setuid bit gives this kind of domain switch.
- Control: applies to domain objects. It lets one domain remove rights from another domain's row.
The matrix is rarely stored whole, because a global table is large and mostly empty. The two usual layouts are below.
| Layout | Stores | Strength | Weakness |
|---|---|---|---|
| Access list | One column per object | Easy to revoke rights on an object | Slow to list everything a domain can do |
| Capability list | One row per domain | Fast checks; a capability is like a ticket | Hard to revoke |
| Lock-key | Locks on objects, keys in domains | A compromise between the two | Key management |
UNIX permission bits (owner, group, others) are a condensed access list. Only one class applies to a user, checked in that order. A group member gets the group bits even if "others" has more rights.
Exam angle: expect lookups ("can D1 write F2?"), copy and owner tracing, and "which row or column is this?" questions.
Authentication
Authentication proves who a user is. Authorisation then decides what that user may do.
- Passwords: systems store a salted hash, not the password. A per-user salt stops precomputed tables, and slow hashes such as bcrypt make each guess expensive.
- One-time passwords: codes that are valid once, such as codes sent to a phone.
- Biometrics: fingerprints or faces.
- Multi-factor authentication: combines something you know, something you have and something you are. A password plus a security question is still one factor.
To size a brute-force search, raise the alphabet size to the power of the password length. Six characters from a-z plus 0-9 give 36^6 = 2,176,782,336 options. At 10^6 guesses per second, that is about 36 minutes.
Exam angle: salts increase the attacker's work per user. They do not make a weak password strong.
OS threats
| Threat | What it is |
|---|---|
| Trojan horse | Useful-looking code that misuses the rights of the user who runs it |
| Trap door (back door) | A hidden way past authentication, left in by a programmer |
| Logic bomb | Code that does harm only when a condition, such as a date, is met |
| Stack/buffer overflow | Unchecked input overwrites the return address, so the attacker's code runs |
| Virus | Code that attaches to programs or files and spreads when they run |
| Worm | A standalone program that copies itself across a network |
| Denial of service | Overloads a system so that real users are shut out; DDoS uses many machines |
Silberschatz's search-path example is a classic Trojan horse. If the current directory comes first in PATH, a fake ls in a shared folder runs with your rights.
Exam angle: a buffer overflow in a setuid-root program is a privilege escalation, because the injected code runs as root.
Common traps
- Swapping rows and columns. Access lists are columns; capability lists are rows.
- Thinking a copied right keeps its asterisk under limited copy. It does not.
- Treating UNIX permission classes as a union. Only the first matching class applies.
- Calling a password plus a security question two-factor authentication.
- Mixing up worms (standalone, self-spreading) and viruses (need a host).
- Confusing a trap door (a hidden entry) with a logic bomb (a hidden trigger).
Worked examples
1. Understanding. In the table above, is "F1: write; F2: owner, read; Printer: print" an access list or a capability list? Answer: a capability list, for D2. It is one row: everything a single domain may do.
2. Application. A file has mode 640 and is owned by user ali, group dev. User hina is in dev. Can she write the file? Answer: no. She is not the owner, so the group bits (4 = read only) apply. She can read but not write.
3. Analysis. Using the table above, D2 adds write on F2 to D3's entry. Is this allowed, and could D1 have done it instead? Answer: yes, because D2 holds owner on F2. D1 could not. Its read* lets it copy only read, not write, and it does not own F2.
Practise
The quiz below has 100 protection and security questions, filterable by tier and difficulty.
Practise: 100 questions
FAQs
Is NSCT cyber security the same as OS protection and security?
No. They are two separate areas in HEC's competency list. This OS topic covers protection mechanisms (domains, the access matrix and its implementations) and OS-level threats. The Cyber Security MCQs area goes wider, into cryptography, network security, web application security and incident response. Studying this topic first makes the OS-security questions there easier.
What is the difference between an access list and a capability list?
An access list belongs to an object and records which domains may use it and how: one column of the access matrix. A capability list belongs to a domain and records which objects it may use: one row. Access lists make revocation easy; capabilities make access checks fast.
Why are passwords salted?
A salt is a random value stored with each password and mixed into the hash. Users with the same password then get different hashes, and an attacker cannot reuse one precomputed table for every account. Each user must be attacked separately, which multiplies the work by the number of users.
What does the setuid bit do?
When an executable has the setuid bit set, a process running it takes the file owner's user ID as its effective user ID. The real user ID still records who started it. This is how ordinary users run passwd to change their own password in a root-owned file.
Next step
This is the last Operating Systems topic. The previous topic is Input / Output Systems. Revisit the Operating Systems MCQs hub, carry on into authentication and access control, or test yourself in an NSCT mock test.