Skip to content
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

Closed
zephyrbot opened this issue Sep 16, 2016 · 5 comments
Closed

Place thread stacks in their own linker section #2420

zephyrbot opened this issue Sep 16, 2016 · 5 comments
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: medium Medium impact/importance bug

Comments

@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 16, 2016

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)

@zephyrbot
Copy link
Collaborator Author

by Peter Mitsis:

Putting stacks into their own linker section in this way introduces some security vulnerabilities that were not previously present.

@zephyrbot
Copy link
Collaborator Author

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.

@zephyrbot
Copy link
Collaborator Author

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.

@zephyrbot
Copy link
Collaborator Author

by Sharron LIU:

"Won't Do" means keep original behavior. Test cases needed to verify original behavior. Thanks.

@zephyrbot
Copy link
Collaborator Author

zephyrbot commented Oct 26, 2016

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 initialized

TESTPOINT: check init stack of a dynamic init thread. Expect stack is initialized

Concept validation:

TESTPOINT: check the initial value of a reused stack. Expect the stack was re-initialized

test case passed @x86 but failed @arm, logged as GH-2624.

Closing.

@zephyrbot zephyrbot added priority: medium Medium impact/importance bug area: Kernel Enhancement Changes/Updates/Additions to existing features labels Sep 23, 2017
@zephyrbot zephyrbot mentioned this issue Sep 23, 2017
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel Enhancement Changes/Updates/Additions to existing features priority: medium Medium impact/importance bug
Projects
None yet
Development

No branches or pull requests

1 participant