|Summary:||stack guard should lead with zero byte to gain protections from str* writes|
|Product:||glibc||Reporter:||Kees Cook <kees>|
|Component:||libc||Assignee:||Ulrich Drepper <drepper.fsp>|
|Attachments:||keep leading zero|
Description Kees Cook 2009-05-12 18:05:34 IST
When building the stack guard, it has been traditionally important to have the value start (in memory) with a zero byte to protect the guard value (and the rest of the stack past it) from being read via strcpy, etc. This patch reduces the number of random bytes by one, leaving the leading zero byte.
Comment 2 Kees Cook 2009-05-14 21:48:40 IST
I should clarify -- the read-blocking is nice, but the more common reason the leading zero is important is to avoid the guard being written as part of a larger overflow being written out by a str* function, if its value were leaked to an attacker in some other way.
Comment 3 Ulrich Drepper 2011-05-15 15:00:37 IST
I've applied a cleaner and more efficient patch.