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

env_dup: Allocate memory from the correct memory pool #5814

Merged
merged 1 commit into from
Mar 22, 2022

Conversation

pussuw
Copy link
Contributor

@pussuw pussuw commented Mar 21, 2022

When the initial proxy task is duplicated into the first user task,
the environment exists in kernel memory and this must be copied to user
memory.

The memory allocated for the new task was allocated with the parent's
priority which is incorrect. Use the new task's priority instead.

Follow-up for: #5753

Summary

Fix bug in environment duplication

Impact

Testing

Tested with icicle:knsh (CONFIG_BUILD_KERNEL=y), e.g. ls fails because the working directory name resides in kernel memory.

When the initial proxy task is duplicated into the first user task,
the environment exists in kernel memory and this must be copied to user
memory.

The memory allocated for the new task was allocated with the parent's
priority which is incorrect. Use the new task's priority instead.

Follow-up for: apache#5753
@xiaoxiang781216
Copy link
Contributor

Maybe the best place is put into user space stack just like argument.

@xiaoxiang781216 xiaoxiang781216 merged commit 3581668 into apache:master Mar 22, 2022
@pussuw pussuw deleted the env_fix branch March 22, 2022 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants