Skip to content

Conversation

@ShoichiroKitano
Copy link
Contributor

@ShoichiroKitano ShoichiroKitano commented Dec 10, 2023

I have corrected the timing of locking the pids_lock in the do_exit function to be before mm_release.

The reason for this fix is that there was a potential for invalid memory access when executing processes related to /proc/{pid}, specifically when memory for the struct task member is freed during the process (this issue occurred during the execution of tmux). Additionally, there was a problem where resources locked during operations on /proc/{pid} were being released in do_exit, leading to further issues, so I addressed and fixed that as well.

@tbodt
Copy link
Member

tbodt commented Dec 13, 2023

Unfortunately this violates the lock ordering of always taking a task group lock after taking pids_lock.

@ShoichiroKitano
Copy link
Contributor Author

ShoichiroKitano commented Dec 13, 2023

@tbodt
I'm sorry. Since I can't understand the issue, could you provide a bit more information?
To the best of my understanding, in this fix, it appears that the lock on group->lock will be acquired after acquiring the lock on pids_lock.

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.

2 participants