StackCanaries
Stack canaries, or stack guard values, are a defensive mechanism designed to detect stack-based buffer overflows. A canary value is placed in the function's stack frame, typically between local variables and the control data (the saved frame pointer and the return address).
The program then verifies the canary value before returning from the function. If a buffer overflow has
Most modern compilers implement stack canaries as part of stack protection features, such as GCC's -fstack-protector
Limitations include: canaries only detect overflows that touch the canary location; they do not prevent overflows
Related approaches include shadow stacks and control-flow integrity mechanisms, which provide complementary protection against advanced memory