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

Mohamed Hassan (@Hamzi) gitlab at rtems.org
Fri May 23 21:18:30 UTC 2025




Mohamed Hassan commented on a discussion on testsuites/libtests/stackchk06/config.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_122877

 > +
 > +#include <rtems.h>
 > +#include <rtems/score/thread.h>
 > +#include <rtems/bspIo.h>
 > +
 > +const char rtems_test_name[] = "STACKCHK06";
 > +
 > +RTEMS_NO_RETURN void __stack_chk_fail(void);
 > +
 > +/* configuration information */
 > +#define CONFIGURE_STACK_CHECKER_ENABLED
 > +
 > +RTEMS_NO_RETURN void __stack_chk_fail(void)
 > +{
 > +  // Custom handling for stack overflow
 > +  printk("Custom stack overflow handler invoked\n");

`.scn` file are updated [stackchk05.scn](https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/99518a75903843c274fe264433fc7a4dce026c31/testsuites/libtests/stackchk05/stackchk05.scn) and [stackchk06.scn](https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/99518a75903843c274fe264433fc7a4dce026c31/testsuites/libtests/stackchk06/stackchk06.scn). And the `.doc` were updated before. If you spot anything, I'll sort it out.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_122877
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/20250523/569162e7/attachment-0001.htm>


More information about the bugs mailing list