These problems should be done on your own. We're not going to be grading them strictly (we'll mainly look at whether you attempted them). But they will be reinforcing knowledge and skills, so you should totally work through them carefully.
File systems
Is it fundamentally necessary to store on disk information about the unallocated disk sectors (the bitmap, etc.)? Explain why or why not.
File systems
Consider a UNIX-like file system with multi-level indexing. For more reliability, the inode array is replicated on the disk in two different places. The intent is that if one or a group of sectors that are storing either replica of the array becomes corrupted, the system can always recover from the other replica. Discuss the effect of having this replicated data structure on performance.
File systems
Suppose you have a file system with: multi-level indexing (with 14 direct pointers, 1 indirect inode, 1 doubly indirect pointer, and 1 triple indirect pointer in the inode), directories, and inodes statically allocated in an array 0..MAX_INUM in a known location on disk. Also assume there is an on-disk bitmap of free inodes and free blocks. Assume that the file containing the root directory is stored in a well-known inode with inumber ROOT_INUM.
Assume each inode consumes exactly one block.
Consider creating a new file "/foo/bar" in an existing directory "foo" and writing one block of data to that file.
Assume no in-memory cache.
- List the reads and writes that must be executed to accomplish this task (and explain how each disk address is determined.)
- Write down the writes in the order they should occur.
- List the actions that the FSCK program must take to ensure the disk is brought to a correct state on recovery, and argue that these actions guarantee file system consistency.
- Suppose we want to ensure reliable updates using logging (as in a journaling file system). List the series of writes (to the disk and log) in the order they should occur. Also describe what actions (if any) must be taken on recovery after a crash.
Crash recovery: Copy-on-write
Consider a copy-on-write filesystem. Alice executes rm /home/alice/lab.c
, where lab.c
has 2 data blocks. Assume all directory entries are in direct blocks. List the operations performed by the filesystem when deleting lab.c
, and specify any ordering constraints that must be obeyed between operations. Additionally, state any assumptions you make about how directory inodes are stored.
Crash recovery: Undo-redo logging
Consider the redo-undo logging protocol from lecture. Why can’t we eliminate the undo pass, and just have a redo pass in which we redo only sub-operations from committed transactions?
NFS
The NFS authors had a goal of transparency. They wanted applications to be unable to distinguish whether a file system was (a) a remote file system served from an NFS server; or (b) a typical, local Unix file system. They did not succeed. (In fact, their goal was impossible.) State precisely one way in which application code can experience different behavior when interacting with a remote NFS file system versus a local Unix file system. Your answer should be in terms of what application code sees (rather than in terms of what a global observer sees). Furthermore, please give the reason why it was impossible to provide transparency for the use case you stated.
Buffer overflow vulnerabilities
For the statements below, please state whether they are true or false. Justify each answer.
- "If a server has a buffer overflow vulnerability, that means the server definitely has a bug."
- "Buffer overflow vulnerabilities can be ruled out by making the stack non-executable."
- "Buffer overflow vulnerabilities can be ruled out by making program text read-only."
- "Buffer overflow vulnerabilities can be ruled out with the W XOR X security policy."
- "Buffer overflow vulnerabilities can be eliminated with ASLR (address space layout randomization)."
- "Buffer overflow vulnerabilities are not possible on a 64-bit architecture."
- "If a buffer overflow vulnerability is exploited, this implies that the attacker has changed
%cr3
."
Handing in the homework
Use Gradescope; you can enroll in our course with entry code JBGJKG. (And please feel free to send us feedback about Gradescope.)