Assignments

Assignment Grading

We will grade your assignments using gcc from the command line of the programming server (check HelloLab for instructions on how to access your account).

You are free to use a local VM and other compilers or IDEs to develop your code but, in the end, it has to work with gcc on this server (check that before submitting!).

Reconsideration requests for any graded artifact must be made within one week of our release of grades. Once this period has passed, grades are considered final.

Late Submissions

Each student has 5 grace days over the course of the semester; at most 2 grace days can be used on a single assignment. You can use grace days by making a “push” to your repository after the deadline (push time matters, not commit time); late days used for each assignment will be posted on BlackBoard together with grades. Without grace days, late submissions will receive a score of 0.

Expect delays and things to go wrong, so please don’t start your submission with only a few minutes left. Finish the assignment early, submit it a few hours ahead of time to allow for such problems.

Assignment 0: Hello Lab (Linux VM, git, gcc)

This assignment is mandatory but not graded. The goal is to become familiar with our development environment: the class programming server (running Debian Linux), the Linux shell (bash), the version control system (git), the editor (Visual Studio Code), the compiler (gcc), the build system (make), the debugger (gdb and the built-in debugger of VS Code), the main features of the C language.

Assignment 1: Data Lab

This assignment will introduce you to bitwise operations in C, such as bitwise AND (&), OR (|), NOT (~) and right/left shift (>> / <<). The goal is to become familiar with the bit-level representation of integers and with the corner cases of their operations (e.g., two’s complement encoding, signed/unsigned overflow). The assignment also requires the manipulation of IEEE 754 floating point variables (float and double) at the bit level.

Assignment 2: Bomb Lab

This assignment gives you a binary program containing “bombs” which trigger a ping to our server (and make you lose points). Your goal is to set breakpoints and step through the binary code using gdb to figure out the program inputs that defuse the bombs.

Assignment 3: Attack Lab

This assignment asks you to run buffer overflow attacks using two strategies: (1) loading your binary code on the stack and starting its execution by overwriting the return address, or (2) a return-oriented attack, where return addresses are used to jump to one or more gadgets.

Assignment 4: Cache Lab

This lab will help you understand the impact that cache memories can have on the performance of your C programs. In this lab, you will write a small C program (about 200-300 lines) that simulates the behavior of a cache memory.

Assignment 5: Allocation Lab

In this lab you will be writing a dynamic storage allocator for C programs, i.e., your own version of the malloc, free and realloc routines. You are encouraged to explore the design space creatively and implement an allocator that is correct, efficient and fast.