E1 - Scavenger Hunt 🔎

We will assign you a syscall and give you our specially designed program. Your task is to trace invocations of that syscall by the program within userspace and kernelspace and document your observations.

Outcomes:

What to submit

Procedure:

  1. Create a firstname_lastname folder named for yourself within the e1 directory and cd into it.
  2. Copy the provided questions.txt file into your folder (cp ../questions.txt .).
  3. You can make the commit for your first patch at this point.
  4. Play with the provided program. You can run it by typing ../program_amd64 (or ../program_arm64 if you are running fedora aarch64 on an apple silicon mac)
  5. Examine the source code for the provided program here
  6. Run strace on the provided program
  7. Answer question 0 in questions.txt
  8. Read the manual page for your system call (type man 2 [syscall name] e.g. man 2 execve)
  9. Answer question 1 in questions.txt
  10. Find the syscall definition within the kernel source
  11. Answer question 2 in questions.txt
  12. Pull the full history of the linux repository with git pull --unshallow (this will take a little while to download)
  13. Run git blame on the file containing the definition of the syscall and scroll to the lines containing the definition
  14. Answer question 3 in questions.txt
  15. Identify the probe you will use for tracing by searching for kprobes that match your syscall with sudo bpftrace -l
  16. Write the bpf script that inserts a probe and prints the syscall arguments, the kernelspace stack, and the userspace stack each time the syscall is executed by the program.
  17. Capture the necessary output, and create commits out of your changes as described in “what to submit”
  18. Generate patches out of your commits. Don’t forget the cover letter
  19. Submit your patches to exercise1@kdlp.underground.software

Tools of interest

Submission Guidelines