Buffer overflow protection: Difference between revisions

Content deleted Content added
Alinowe (talk | contribs)
Canaries: added stack cookie synonym
Alinowe (talk | contribs)
Canaries: stack cookies in the description of canaries
Line 20:
==Canaries==
{{Unreferenced section|date=November 2023}}
''Canaries'' or ''canary words'' or ''stack cookies'' are known values that are placed between a buffer and control data on the stack to monitor buffer overflows. When the buffer overflows, the first data to be corrupted will usually be the canary, and a failed verification of the canary data will therefore alert of an overflow, which can then be handled, for example, by invalidating the corrupted data. A canary value should not be confused with a [[sentinel value]].
 
The terminology is a reference to the historic practice of using [[animal sentinel#Toxic gases|canaries in coal mines]], since they would be affected by toxic gases earlier than the miners, thus providing a biological warning system. Canaries are alternately known as ''stack cookies'', which is meant to evoke the image of a "broken cookie" when the value is corrupted.