[PATCH] shell: Avoid potential stack corruption

Chris Johns chrisj at rtems.org
Mon Mar 21 06:58:10 UTC 2022


On 19/3/2022 8:29 pm, Sebastian Huber wrote:
> On 19/03/2022 08:31, Chris Johns wrote:
>>> On 15 Mar 2022, at 5:27 pm, Sebastian
>>> Huber<sebastian.huber at embedded-brains.de>  wrote:
>>>
>>> The rtems_shell_init() passed the address of a stack variable
>>> (exit_code) to rtems_shell_run().  If wait == false, then the stack
>>> variable goes out of scope but may be accessed by the created shell
>>> thread.
>>>
>>> The rtems_shell_script() was affected by the same problem.
>>>
>>> Close #4629.
>> Does this change remove the exit code?
> 
> No, the exit code member is still in the shell environment.
> 

Great. I was reviewing the change on my phone while walking somewhere.

Then the change is fine.

Thanks
Chris


More information about the devel mailing list