RTEMS | libmisc/stackchk: Add stack smashing protection (!277)

Joel Sherrill (@joel) gitlab at rtems.org
Mon May 12 20:20:00 UTC 2025




Joel Sherrill commented on a discussion on cpukit/include/rtems/confdefs/extensions.h: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_122568

 >    #endif
 >  #endif
 >  
 > +#ifndef CONFIGURE_STACK_CHECKER_GUARD_VALUE
 > +  #define CONFIGURE_STACK_CHECKER_GUARD_VALUE 0xDEADBEEF

The implementation includes default implementations for the variable __stack_chk_guard with the canary value and the __stack_chk_fail() function which is invoked when an issue is found.

The idea is to give RTEMS users a way to change the canary value and the reporting function. Our default reporting function is related to the one we use for the existing stack checking.

https://mcuoneclipse.com/2019/09/28/stack-canaries-with-gcc-checking-for-stack-overflow-at-runtime/ is a pretty good article on all this.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_122568
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250512/1cec7745/attachment.htm>


More information about the bugs mailing list