Unit 4 - Practice Quiz

CSE316 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 Which of the following is NOT one of the four necessary conditions for a deadlock to occur in an operating system?

Deadlock Characterization Easy
A. Preemption
B. Circular Wait
C. Hold and Wait
D. Mutual Exclusion

2 The condition where a process holds at least one resource and is waiting to acquire additional resources held by other processes is known as:

Deadlock Characterization Easy
A. Hold and Wait
B. No Preemption
C. Circular Wait
D. Mutual Exclusion

3 Deadlock prevention involves ensuring that at least one of the four necessary deadlock conditions cannot hold. Which strategy prevents the 'Circular Wait' condition?

Handling of deadlocks- Deadlock Prevention Easy
A. Imposing a total ordering of all resource types and requiring that each process requests resources in an increasing order.
B. Ensuring that at least one resource is shareable.
C. Allowing the system to take resources away from processes.
D. Requiring each process to request all its resources at once.

4 The Banker's Algorithm is a well-known method for:

Handling of deadlocks- Deadlock Avoidance & Detection Easy
A. Deadlock avoidance
B. Deadlock detection
C. Deadlock recovery
D. Deadlock prevention

5 Which of the following is a common method for recovering from a deadlock?

Handling of deadlocks- Deadlock Recovery Easy
A. Restarting the entire operating system.
B. Granting all pending resource requests.
C. Terminating one or more of the deadlocked processes.
D. Adding more physical memory to the system.

6 In the context of process scheduling, what is 'starvation'?

Starvation Easy
A. When a process is indefinitely denied access to a resource it needs.
B. When two processes are waiting for each other in a circular fashion.
C. When a process completes its execution successfully.
D. When the system runs out of CPU time for all processes.

7 The three fundamental goals of security, often called the 'CIA Triad', are Confidentiality, Integrity, and what?

Goals of protection Easy
A. Authentication
B. Accountability
C. Availability
D. Authorization

8 What is the 'Principle of Least Privilege'?

Principles of protection Easy
A. The principle that the operating system should use the least amount of memory possible.
B. The principle that the least important tasks should be run first.
C. Giving a program only the minimum access rights it needs to perform its job.
D. Giving every user administrator rights.

9 A secret, undocumented entry point into a program used to bypass normal security mechanisms is known as a:

Security Vulnerability like Buffer overflow, Trapdoors, Backdoors, cache poisoning etc Easy
A. Firewall
B. Virus
C. Buffer overflow
D. Backdoor or Trapdoor

10 What is the primary purpose of authentication in a computer system?

Authentication-Password based Authentication Easy
A. To determine what actions a user is allowed to perform.
B. To encrypt data during transmission.
C. To verify the identity of a user or process.
D. To keep a log of user activities.

11 Which type of malicious software is defined by its ability to self-replicate by attaching itself to another program?

Application Security - Virus, Program Threats Easy
A. Trojan Horse
B. Spyware
C. Virus
D. Worm

12 In an operating system's protection model, what is a 'domain'?

Domain of protection Easy
A. A collection of access rights, specifying which objects a subject can access and how.
B. A specific user account.
C. A type of network architecture.
D. The physical location of the computer.

13 In the context of OS protection, what does an 'Access Matrix' represent?

Access matrix Easy
A. The speed at which data can be accessed from a disk.
B. The physical layout of memory chips.
C. The set of permissions that subjects (like users or processes) have for objects (like files or devices).
D. A list of all users currently logged into the system.

14 A network attack designed to make an online service unavailable by overwhelming it with traffic from a single source is called a:

System and network threats Easy
A. Man-in-the-Middle Attack
B. SQL Injection Attack
C. Phishing Attack
D. Denial-of-Service (DoS) Attack

15 Which of the following is a poor practice for password security?

Password Maintenance & Secure Communication Easy
A. Using the same password for multiple websites.
B. Changing your password regularly.
C. Using a password manager to store unique passwords.
D. Using a mix of uppercase letters, lowercase letters, numbers, and symbols.

16 What is a 'buffer overflow' vulnerability?

Security Vulnerability like Buffer overflow, Trapdoors, Backdoors, cache poisoning etc Easy
A. When the network buffer becomes full and drops packets.
B. When a user provides too much input to a program.
C. When the hard disk's read/write buffer is corrupted.
D. When a program writes data beyond the allocated memory for a buffer.

17 What is the primary goal of implementing security measures in a multi-user operating system?

Need for Security Easy
A. To reduce the overall cost of the computer hardware.
B. To make the system run faster.
C. To ensure all users have the same level of access.
D. To prevent unauthorized access and protect user data from corruption or theft.

18 An attack that uses deceptive emails and websites to trick users into providing personal information, such as passwords or credit card numbers, is known as:

Examples of attacks Easy
A. Buffer Overflow
B. Denial of Service
C. Phishing
D. A Worm

19 A common way to implement an Access Matrix is by storing each column as a list. What is this implementation called?

Implementation of access matrix Easy
A. Access Control List (ACL)
B. Lock-Key Mechanism
C. Capability List
D. A Global Table

20 A malicious program that appears to be a legitimate and useful application but performs harmful actions once executed is called a:

Application Security - Virus, Program Threats Easy
A. Virus
B. Trojan Horse
C. Rootkit
D. Worm

21 Consider a system with 3 processes (P0, P1, P2) and 3 resource types (A, B, C) with 10, 5, and 7 instances respectively. The current state is as follows:

| Process | Allocation (A,B,C) | Max (A,B,C) |
|---------|--------------------|-------------|
| P0 | 0 1 0 | 7 5 3 |
| P1 | 2 0 0 | 3 2 2 |
| P2 | 3 0 2 | 9 0 2 |

What is the content of the Available vector and is the system in a safe state?

Handling of deadlocks- Deadlock Avoidance & Detection Medium
A. Available = (5, 4, 5), Safe
B. Available = (3, 3, 2), Not Safe
C. Available = (5, 4, 5), Not Safe
D. Available = (3, 3, 2), Safe

22 A system has several processes and a single instance of a resource R1. If a process is allowed to request another resource R2 while holding R1, but is forced to release R1 if its request for R2 is denied, which of the four necessary conditions for deadlock is being prevented?

Deadlock Characterization Medium
A. Circular Wait
B. No Preemption
C. Hold and Wait
D. Mutual Exclusion

23 An attacker exploits a vulnerability in a web server by sending a carefully crafted input string that is larger than the buffer allocated on the stack for it. The primary goal of overwriting data beyond the buffer's boundary in this specific scenario is typically to:

Security Vulnerability like Buffer overflow, Trapdoors, Backdoors, cache poisoning etc Medium
A. Corrupt adjacent variables to alter program logic in a minor way.
B. Fill up the server's memory to slow it down.
C. Overwrite the function's return address to execute malicious code.
D. Crash the server to cause a denial of service.

24 In a system that implements its access matrix using Access Control Lists (ACLs), which of the following operations is the most computationally efficient?

Implementation of access matrix Medium
A. Verifying if a specific user can write to a specific file.
B. Finding all files a specific user can read.
C. Listing all users who have no access to any file.
D. Transferring all access rights for a file from one user to another.

25 A system administrator configures a web server to run with full root/administrator privileges. The web server only needs to read files from /var/www and bind to port 80. Which fundamental security principle is most clearly violated by this configuration?

Principles of protection Medium
A. Principle of Separation of Privilege
B. Principle of Least Privilege
C. Principle of Open Design
D. Principle of Complete Mediation

26 A common strategy to prevent circular wait is to enforce a total ordering of all resource types, requiring that each process requests resources in an increasing order of enumeration. What is a major drawback of this approach?

Handling of deadlocks- Deadlock Prevention Medium
A. It requires preemption of resources, which is complex to implement.
B. It may be impossible for a process to obtain resources in the enforced order, thus delaying its execution unnecessarily.
C. It can lead to starvation of processes that need a low-numbered resource first.
D. It violates the mutual exclusion condition.

27 In a preemptive priority-based scheduling system, a continuous stream of high-priority processes can prevent a low-priority process from ever getting CPU time. This situation is a classic example of:

Starvation Medium
A. Deadlock
B. Starvation
C. Aging
D. A race condition

28 What is the primary security purpose of using a 'salt' when hashing user passwords for storage?

Authentication-Password based Authentication Medium
A. To make the hashing algorithm slower and more resource-intensive.
B. To ensure that every user's hashed password is the same length.
C. To encrypt the password before it is hashed.
D. To prevent attackers from using pre-computed tables of hashes (rainbow tables).

29 An attacker positions themselves on a public Wi-Fi network between a user and a legitimate website. They intercept, read, and possibly alter the communication between the two parties, who are unaware of the attacker's presence. What is this type of attack called?

System and network threats Medium
A. SQL Injection
B. Denial of Service (DoS)
C. Man-in-the-Middle (MITM)
D. Phishing

30 When an operating system detects a deadlock and decides to recover by terminating processes, which factor is often the LEAST important when choosing a 'victim' process to terminate?

Handling of deadlocks- Deadlock Recovery Medium
A. The process's priority.
B. The name of the user who owns the process.
C. How many and what type of resources the process holds.
D. How long the process has already been running.

31 What is the key difference between a computer virus and a worm?

Application Security - Virus, Program Threats Medium
A. A virus is written in a low-level language, while a worm is written in a scripting language.
B. A virus is malicious, whereas a worm is not.
C. A worm targets networks, whereas a virus only targets individual computers.
D. A virus requires a host program to replicate, while a worm is a standalone program that can replicate on its own.

32 A disgruntled employee uses their authorized access to a company's database to subtly change financial records, altering transaction amounts. Which primary goal of security has been violated?

Goals of protection Medium
A. Integrity
B. Confidentiality
C. Authentication
D. Availability

33 In a Resource Allocation Graph (RAG), a cycle is detected. The system has multiple instances of each resource type. What can be concluded about the state of the system?

Deadlock Characterization Medium
A. The system will enter a deadlock state soon.
B. The system may or may not be in a deadlocked state.
C. The system is not in a deadlocked state.
D. The system is definitely in a deadlocked state.

34 Consider the following Access Matrix for a system with three processes (P1, P2, P3) and three files (F1, F2, F3).

| Domain/Object | F1 | F2 | F3 |
|---------------|-------|-------|-------|
| P1 | read | write | - |
| P2 | - | read | execute|
| P3 | read | read | read |

If P1 attempts to grant 'read' access for F1 to P2, under which policy would this be allowed?

Access matrix Medium
A. If P1 has the 'copy' right for the F1 entry in its domain.
B. If P1 has the 'transfer' right for the F1 entry in its domain.
C. If P1 is the owner of F1.
D. This action is never allowed as P1 cannot modify the access matrix directly.

35 A programmer leaves a hidden mechanism in the system's login routine that allows them to bypass standard authentication by providing a special, hardcoded password. This mechanism was intentionally created for later unauthorized access. What is this vulnerability called?

Security Vulnerability like Buffer overflow, Trapdoors, Backdoors, cache poisoning etc Medium
A. Logic Bomb
B. Buffer Overflow
C. Trapdoor
D. Backdoor

36 How does a user process typically transition from the user domain (e.g., Ring 3) to the kernel domain (e.g., Ring 0) to request a privileged operation like file I/O?

Domain of protection Medium
A. By sending an inter-process communication (IPC) message to the kernel.
B. By modifying a special register in the CPU.
C. By directly calling a kernel function.
D. By executing a system call instruction (e.g., TRAP or SYSCALL).

37 What is the primary objective of a DNS cache poisoning attack?

Examples of attacks Medium
A. To overload DNS servers, making them unavailable.
B. To corrupt the mapping of a domain name to an IP address in a DNS server's cache.
C. To steal the domain name registration from its legitimate owner.
D. To intercept the traffic between a user and a DNS server.

38 A piece of malicious code is embedded in a large, seemingly legitimate software package. The code is designed to remain dormant until a specific date and time (e.g., April 1st), at which point it activates and deletes critical system files. This type of program threat is best described as a:

Application Security - Virus, Program Threats Medium
A. Worm
B. Logic Bomb
C. Rootkit
D. Trojan Horse

39 What is the main security advantage of using a challenge-response authentication protocol over sending a hashed password across an insecure network?

Secure Communication Medium
A. It is faster because no hashing is required.
B. It prevents replay attacks where an attacker could capture and reuse the authentication credential.
C. It requires less computational power on the server-side.
D. It allows the user to have a simpler password.

40 A system uses Capability Lists to manage access rights. Each process has a list of capabilities, where each capability specifies an object and the permitted operations. What is a significant security challenge associated with this implementation?

Implementation of access matrix Medium
A. Revoking a user's access to a specific object is very difficult.
B. It is computationally expensive to check if a process can access an object.
C. Determining which processes can access a specific object is efficient.
D. Capabilities can be forged or modified by user-level processes if not properly protected.

41 Consider a system with 3 processes (P0, P1, P2) and 3 resource types (A, B, C) with 10, 5, and 7 instances respectively. The current state is given by the following Allocation and Max matrices:

| Process | Allocation (A,B,C) | Max (A,B,C) |
|---|---|---|
| P0 | (0, 1, 0) | (7, 5, 3) |
| P1 | (2, 0, 0) | (3, 2, 2) |
| P2 | (3, 0, 2) | (9, 0, 2) |

If process P1 makes a request for Request1 = (1, 0, 2), what is the state of the system after granting this request?

Deadlock Avoidance & Detection Hard
A. The system is in an unsafe state, as no sequence of process execution can be found.
B. The system is in a safe state, with a valid safe sequence such as <P1, P0, P2>.
C. The request is denied because it exceeds P1's maximum claim.
D. The system is in a safe state, but only if P0 runs first in the safe sequence.

42 In a large multi-user system, a security policy change requires revoking a single user's access rights to thousands of objects they previously had access to. Comparing an implementation of the Access Matrix using Access Control Lists (ACLs) versus Capability Lists (C-Lists), which statement is most accurate regarding the complexity of this specific revocation operation?

Implementation of access matrix Hard
A. ACLs are less efficient because the system must iterate through thousands of object ACLs to remove the user's entry from each one.
B. Both implementations have similar, near-constant time complexity for this operation due to modern indexing techniques.
C. ACLs are more efficient because you only need to modify the user's entry, which is stored centrally.
D. C-Lists are more efficient because you can simply destroy the user's capability list.

43 An attacker aims to exploit a buffer overflow vulnerability on a modern 64-bit Linux system. The system has protections including the Non-Executable (NX) bit and Address Space Layout Randomization (ASLR). The attacker's payload cannot be directly injected and executed from the stack. Which technique is specifically designed to bypass both of these protections simultaneously to achieve arbitrary code execution?

Security Vulnerability like Buffer overflow, Trapdoors, Backdoors, cache poisoning etc Hard
A. A simple stack smashing attack that overwrites the return address to point to shellcode on the stack.
B. An integer overflow attack that corrupts a size variable, leading to a denial of service.
C. Return-Oriented Programming (ROP) where the stack is filled with addresses of existing code 'gadgets' within loaded libraries.
D. A heap spraying attack where multiple copies of shellcode are placed in the heap to increase the odds of a corrupted function pointer hitting them.

44 In a database management system that uses a strict two-phase locking (2PL) protocol for transaction concurrency, which of the four necessary deadlock conditions (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait) is most practically and commonly addressed to prevent deadlocks without fundamentally violating the principles of 2PL?

Deadlock Prevention Hard
A. Violating No Preemption by forcibly taking a lock from one transaction and giving it to another.
B. Violating Hold and Wait by requiring transactions to acquire all locks before starting.
C. Violating Mutual Exclusion by allowing shared locks for all data items.
D. Violating Circular Wait by imposing a total ordering of all lockable data items or using timestamps (e.g., Wait-Die scheme).

45 A system stores user passwords using the following scheme: StoredHash = SHA256(PerUserSalt + UserPassword). An attacker gains read-only access to the user database, including usernames, salts, and the stored hashes. Which of the following attack vectors is rendered ineffective by this scheme, while which remains a primary threat?

Authentication-Password based Authentication Hard
A. Ineffective: Rainbow table attacks; Primary Threat: Offline dictionary/brute-force attacks on a per-user basis.
B. Ineffective: Brute-force attacks; Primary Threat: Social engineering.
C. Ineffective: Dictionary attacks; Primary Threat: Man-in-the-middle attacks.
D. Ineffective: Phishing attacks; Primary Threat: Rainbow table attacks.

46 A system has detected a deadlock involving four processes (P1, P2, P3, P4) with the following properties:

- P1: High priority, 80% complete, holds 1 critical resource.
- P2: Low priority, 10% complete, holds 2 resources.
- P3: Low priority, 90% complete, holds 1 resource.
- P4: Medium priority, 50% complete, holds 3 resources.

Assuming the cost of termination is proportional to (100 - %complete) * priority_level and the goal is to minimize this immediate cost, which process is the optimal victim to terminate?

Deadlock Recovery Hard
A. P4, because terminating it would release the most resources.
B. P3, because despite being almost done, its low priority makes it a cheap rollback candidate.
C. P1, because it holds the fewest resources.
D. P2, because it has the lowest priority and has completed the least amount of work.

47 A kernel-level device driver for a high-speed network card needs to directly write received packets into a pre-allocated memory buffer for a user-space application. To implement this with the Principle of Least Privilege, which hardware-assisted mechanism is most appropriate to prevent the device driver or the network card itself from accessing arbitrary physical memory?

Principles of protection Hard
A. Utilizing an I/O Memory Management Unit (IOMMU) to restrict device memory access to specific physical pages.
B. Running the device driver in a lower CPU privilege ring (e.g., Ring 1) than the main kernel.
C. Using separate kernel and user address spaces.
D. Implementing system call gates for controlled entry into the kernel.

48 In a system containing resource R1 with 2 instances and resource R2 with 2 instances, consider the following sequence of events:
1. P1 requests and gets an instance of R1.
2. P2 requests and gets an instance of R2.
3. P3 requests and gets an instance of R1.
4. P1 requests an instance of R2 and waits.
5. P2 requests an instance of R1 and waits.
Which statement accurately describes the system state?

Deadlock Characterization Hard
A. A deadlock exists, but it involves P3, not just P1 and P2.
B. The system state is unsafe, but not necessarily deadlocked, as P3's future behavior is unknown.
C. The system is not deadlocked because P3 can release R1, allowing P2 to proceed, which then allows P1 to proceed.
D. The system is deadlocked because a cycle (P1 → R2 → P2 → R1 → P1) exists in the resource-allocation graph.

49 A disgruntled employee embeds a hidden piece of code within a critical financial reporting application. The code is designed to activate and scramble the database tables only if the employee's own user account is deleted from the company's active directory. This type of malicious code is best classified as a:

Program Threats Hard
A. Trojan Horse
B. Rootkit
C. Logic Bomb
D. Worm

50 In a system with a strict, preemptive priority-based scheduler, a continuously running, low-priority process P_low requires periodic access to a resource R protected by a mutex. A stream of high-priority processes P_high also frequently need and release R. Even if the mutex uses a fair (e.g., FIFO) queue for waiting processes, why is P_low still highly susceptible to starvation?

Starvation Hard
A. Because P_low may never get enough CPU time to even make the request for the mutex, as it is constantly being preempted by the P_high processes.
B. Because P_low will be preempted by a P_high process after it has been granted the mutex but before it can finish its critical section.
C. Because the FIFO queue for the mutex does not account for process priorities, leading to priority inversion.
D. Because the high-priority processes will form a convoy, blocking the mutex indefinitely.

51 Consider an access matrix system with the copy right. If a process in Domain D1 has a read* (read with copy) right for an object O, it can copy the read right into another domain's, say D2's, column for O. Suppose the original read* right in D1 is later revoked. In a standard capability-based implementation, what happens to the read right that D1 previously gave to D2?

Access matrix Hard
A. The read right in D2 persists, as the copy operation was a one-time grant and is not linked to the original right.
B. The read right in D2 is automatically and immediately revoked due to the dependency.
C. Revocation of D1's right fails because it has been copied, preventing an inconsistent state.
D. The read right in D2 becomes a 'dangling' capability, causing a system fault when D2 next tries to use it.

52 An attacker captures gigabytes of TLS-encrypted traffic between a user and a bank. One year later, the bank's long-term RSA private key is compromised. The attacker finds they cannot decrypt the captured sessions. This resilience is due to the session key exchange protocol having a property known as:

Secure Communication Hard
A. Message Authentication Codes (MAC)
B. Certificate Pinning
C. Symmetric-key Cryptography
D. Perfect Forward Secrecy (PFS)

53 In the UNIX operating system, a program owned by the root user has the setuid bit enabled. When a non-privileged user alice executes this program, the resulting process has a Real User ID (RUID) and an Effective User ID (EUID). Which of the following statements accurately describes the state of the process's domain and privileges?

Domain of protection Hard
A. The RUID is alice and the EUID is root. The process has root privileges for the duration of its execution.
B. The RUID is root and the EUID is alice. The process has root privileges.
C. Both the RUID and EUID are set to root, completely severing the link to the original user alice.
D. The RUID is alice and the EUID is alice, but the process is granted a special capability to perform root-level actions.

54 An attacker sends a flood of TCP SYN packets to a server with a spoofed, non-existent source IP address. The server responds with a SYN-ACK to the spoofed address and adds an entry to its TCB (Transmission Control Block) table, waiting for an ACK that will never arrive. This exhausts the server's TCB table, preventing legitimate users from connecting. This attack is a:

System and network threats Hard
A. Teardrop Attack
B. Smurf Attack
C. TCP SYN Flood Attack
D. Man-in-the-Middle Attack

55 What is the computational complexity of the Banker's Algorithm's safety check, where n is the number of processes and m is the number of resource types?

Deadlock Avoidance & Detection Hard
A. O(n * m)
B. O(n * m^2)
C. O(n + m)
D. O(m * n^2)

56 A system developer intentionally leaves a hardcoded username/password combination in a network service that grants administrative access, to be used for emergency maintenance. This mechanism is undocumented and bypasses standard authentication channels. This is a classic example of a:

Security Vulnerability like Buffer overflow, Trapdoors, Backdoors, cache poisoning etc Hard
A. Trapdoor
B. Buffer Overflow
C. Logic Bomb
D. Backdoor

57 In a system implementing the access matrix using a global table of triplets <domain, object, rights-set>, what is the primary performance bottleneck when a process frequently switches between domains that have access to a very large number of distinct objects?

Implementation of access matrix Hard
A. The difficulty of revoking rights for a specific object from all domains.
B. The storage overhead of the large global table itself.
C. The time required to search the entire global table to find all rights for the new domain upon a domain switch.
D. The excessive number of system calls required to modify the table.

58 A 'man-in-the-middle' attack where an adversary intercepts and modifies messages between two parties without their knowledge is a direct violation of which two fundamental security goals?

Goals of protection Hard
A. Confidentiality and Non-repudiation
B. Availability and Integrity
C. Confidentiality and Availability
D. Integrity and Authenticity

59 A malware strain infects executable files on a system. When an infected program is run, the malware code activates, but instead of containing the entire malicious payload itself, it uses a multi-stage process. The initial code (the 'dropper') contains just enough logic to connect to a remote command-and-control server, download the main malicious payload into memory, and then execute it. What is the primary advantage of this multi-stage approach for the malware author?

Application Security - Virus, Program Threats Hard
A. It allows the malware to function as a worm and spread more rapidly.
B. It ensures the malware can only infect systems with a network connection.
C. It reduces the initial size of the infected file, making it harder to detect by static signature-based antivirus scanners.
D. It improves the execution speed of the malicious payload by loading it directly into RAM.

60 In a system where a process can have its resources preempted (e.g., its memory pages swapped to disk), but only if its state can be saved and restored later without loss, which of the four necessary conditions for deadlock is being strategically broken or relaxed?

Deadlock Characterization Hard
A. No Preemption
B. Mutual Exclusion
C. Circular Wait
D. Hold and Wait