Data Execution Prevention (DEP)
A memory protection that marks data regions such as the stack and heap as non-executable, using the processor's no-execute (NX) bit, so code injected there is refused.
Data Execution Prevention is the Microsoft Windows name for a memory protection that marks pages holding data, such as the stack and the heap, as non-executable. When code tries to run from one of those pages, the processor raises a fault and the operating system typically ends the process. Hardware enforcement relies on a page-table permission bit, called NX (no-execute) by AMD and XD (execute disable) by Intel. The general rule, often written W^X (write xor execute), is that a page should be writable or executable but not both.
DEP answers the classic buffer overflow exploit, which writes code into a buffer and jumps to it. Attackers adapted with code-reuse techniques such as return-to-libc and return-oriented programming, which chain fragments of code already present in executable memory. That is why DEP is paired with address space layout randomization, which makes the location of those fragments hard to predict. Both are forms of memory protection, and neither removes the underlying bug, which needs input validation and bounds checking.
Exam relevance: a scenario in which injected code is stopped because the memory holding it cannot execute is likely to be describing DEP or the NX bit. Candidates are expected to pair DEP with ASLR as layered defences and to recognise that neither corrects the vulnerable code.