Memory Corruption and Control-Flow Hijacking
Stub. x86 stack/calling-convention review as the prerequisite; the classic stack buffer overflow ("Smashing the Stack"); how a corrupted return address becomes arbitrary control-flow hijacking; and the standard defenses (stack canaries, ASLR, DEP/NX, and control-flow integrity).
The foundational systems-security exploit chain: a review of the x86 stack layout and calling convention (return address, saved registers, local variables), then the classic stack buffer overflow — writing past the end of a fixed-size buffer to overwrite adjacent stack data, most consequentially the saved return address — and why that single corrupted value is enough to redirect execution to attacker-chosen code or, once code injection is blocked, attacker-chosen existing code (return-oriented programming). Covers the standard mitigations in the order they actually close off attack surface: stack canaries (detect corruption before the return), ASLR (make target addresses unguessable), DEP/NX (make injected code non-executable), and control-flow integrity (constrain valid targets directly) — and why none of them alone is sufficient.
Outline (TODO — flesh out each)
- x86 assembly review — stack layout, calling convention
- The stack buffer overflow (“Smashing the Stack for Fun and Profit”)
- From overflow to control-flow hijacking
- Return-oriented programming (ROP)
- Defenses: stack canaries, ASLR, DEP/NX
- Control-flow integrity (CFI)