96.1k views
5 votes
__________ is one of the best known protection mechanisms that is a GCC compiler extension that inserts additional function entry and exit code.

User Jtbr
by
8.4k points

1 Answer

5 votes

Final answer:

Stack Smashing Protection (SSP) or stack protection is a GCC compiler extension aimed at preventing buffer overflow attacks by checking a canary value placed on the stack to ensure the return address of a function has not been altered.

Step-by-step explanation:

The protection mechanism being referred to is Stack Smashing Protection (SSP) or stack protection. This is a GCC (GNU Compiler Collection) compiler extension that aims to prevent a common vulnerability in C and C++ programs known as buffer overflow. By inserting additional code at the beginning and end of functions, it checks that the return address of a function has not been altered, which is an indicator of a buffer overflow attack.

This security feature works by placing a special value, called a canary, on the stack right before the return address when a function is called. Upon function exit, the compiler checks if the canary's value has been changed. If it has, the program can assume a stack smashing attack has occurred and take appropriate action, such as terminating the program.