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

Gedare Bloom (@gedare) gitlab at rtems.org
Wed Dec 18 20:29:33 UTC 2024



Merge request https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277 was reviewed by Gedare Bloom

--
  
Gedare Bloom started a new discussion on cpukit/libmisc/shell/main_stackuse.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_116997

 >  #include <rtems/shell.h>
 >  #include <rtems/score/threadimpl.h>
 > +#include <rtems/score/basedefs.h>

What's this include added for?

--
  
Gedare Bloom started a new discussion on cpukit/libmisc/shell/main_stackuse.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_116998

 > - *
 > + *  COPYRIGHT (c) 1989-2008 On-Line Applications Research Corporation (OAR).
 > + *  COPYRIGHT (c) 2024 Mohamed Hassan <muhammad.hamdy.hassan at gmail.com>

Adding a single include line is probably not copyrightable.

--
  
Gedare Bloom started a new discussion on cpukit/libmisc/stackchk/check.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_116999

 > + * at the application 
 > + */
 > +RTEMS_WEAK RTEMS_NO_RETURN void __stack_chk_fail(void)

Does something define this as a prototype? I expect this would cause warnings in the build.

--
  
Gedare Bloom started a new discussion on testsuites/libtests/stackchk05/init.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277#note_117000

 > +  invoke_stack_overflows();
 > +
 > +  rtems_test_exit();

This is wrong and won't compile. How did you test this code?


-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/277
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/20241218/547653cf/attachment-0001.htm>


More information about the bugs mailing list