-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Place thread stacks in their own linker section #2420
Comments
by Peter Mitsis: Putting stacks into their own linker section in this way introduces some security vulnerabilities that were not previously present. |
by Sharron LIU: Though this story is marked Won't Do. A few test cases under development to verify thread stack. Will close once that verification done. |
by Mark Linkmeyer: Sharron LIU , how are the tests you're referring to relate to this story that isn't getting implemented? I don't see the connection. It seems to me there is nothing to verify for this story (since it's marked as "Won't Do") and therefore the story should simply be closed right away. |
by Sharron LIU: "Won't Do" means keep original behavior. Test cases needed to verify original behavior. Thanks. |
by Sharron LIU: verified original stack behavior @quark_se and @quark_d2000 @qemu_x86 @qemu_cortex_m3. Kconfig runtime validation: TESTPOINT: check init stack of a static defined thread. Expect stack is initializedTESTPOINT: check init stack of a dynamic init thread. Expect stack is initializedConcept validation: TESTPOINT: check the initial value of a reused stack. Expect the stack was re-initializedtest case passed @x86 but failed @arm, logged as GH-2624. Closing. |
Reported by Benjamin Walsh:
Thread stacks (as defined by the __stack attribute) should be placed into their own section. By default this section should be a part of the .noinit section so that they do not impact run time performance. However, if the Kconfig option INIT_STACKS is enabled, then the stacks should be placed into their own unique section and their stack space should be initialized at boot time to a known value (0xaa).
Although this will result in a longer boot time (when INIT_STACKS) is enabled, it means that aside from the potential boot time penalty, there is never a run time penalty when creating a thread. This may be particularly beneficial should a thread be restarted or thread-space be reused as the stack will not be re-initialized. Note that this changes the semantics of thread stack usage to mean thread stack usage for all threads that use that stack.
(Imported from Jira ZEP-913)
The text was updated successfully, but these errors were encountered: