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

fix locking pids_lock timing of do_exit #2300

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ noreturn void do_exit(int status) {
futex_wake(clear_tid, 1);
}

// the actual freeing needs pids_lock
lock(&pids_lock);
// release all our resources
mm_release(current->mm);
current->mm = NULL;
Expand All @@ -67,8 +69,6 @@ noreturn void do_exit(int status) {
struct rusage_ group_rusage = current->group->rusage;
unlock(&current->group->lock);

// the actual freeing needs pids_lock
lock(&pids_lock);
current->exiting = true;
// release the sighand
sighand_release(current->sighand);
Expand Down
Loading