CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 1 of 7 · 1 min read

Why this page comes fifth

In this module you will

  • Explain what a buffer overflow is and why it can change what a program does.
  • Describe the stack canary, the non-executable stack, ASLR and PIE, and what each one stops.
  • Check in a real program whether each defence is present, using readelf, nm and file.
  • Show with a short program that ASLR gives different addresses on each run.
  • Say what the defences do not stop, and name the habits and tools that remove the bug itself.

Pages 1 to 4 limited what a process may do once it is running. This page covers how a bug in a process can turn the process against its owner. It uses the stack frame and the virtual address space of Levels 1, 6 and 7, and the page permissions of Level 7. Page 6 then builds walls around a process that may be taken over. This page describes the defences and the idea of the attack only. It gives no recipe for an exploit.

About this example About this example

Real: Both C programs were compiled with GCC 13.3 on a Linux test machine (kernel 6.18, x86-64) and run there. The addresses, the readelf and nm results, the crash messages and the AddressSanitizer report are real output.

Scripted: The 48-character input is a made-up value that is longer than the 8-byte buffer, to trigger the bug.

Not real: Exact addresses change on every run by design. A different compiler version or distribution may enable other defences by default.