[Devel] [PATCH 0/3 v2 RHEL7] cgroup: do not use cgroup_mutex in cgroup_show_options
Valeriy Vdovin
valeriy.vdovin at virtuozzo.com
Thu Oct 29 14:00:41 MSK 2020
The patchset fixes lock order inversion problem https://jira.sw.ru/browse/PSBM-121438:
Thread A:
m_start() --> down_read(&namespace_sem);
cgroup_show_options() --> mutex_lock(&cgroup_mutex);
Thread B:
attach_task_by_pid()
cgroup_lock_live_group --> mutex_lock(&cgroup_mutex);
threadgroup_lock() --> down_write(&tsk->signal->group_rwsem);
Thread C:
copy_process
threadgroup_change_begin() --> down_read(&tsk->signal->group_rwsem);
copy_namespaces
create_new_namespaces
copy_mnt_ns
namespace_lock() --> down_write(&namespace_sem)
It's split logically so that the first patch fixes pre-existing incorrect resource release order
in ve_drop_contex, that was behaving not as expected in cgroup_show_options.
In the next patch cgroup_show_options itself get's slightly rewritten to not use cgroup_mutex
which fixes the bug.
One more patch is added to clean up the coding style of the function ve_get_release_agent_path,
which is relevant to current problem.
v1: original patch
v2: Added logic that depends on validness of ve->root_css_set instead of cgroup_mutex. Added coding-style fixes.
Valeriy Vdovin (3):
ve/cgroup: change resource release order in ve_drop_context
cgroup: do not use cgroup_mutex in cgroup_show_options
ve: cleanup in function ve_get_release_agent_path
kernel/cgroup.c | 9 ++-------
kernel/ve/ve.c | 7 ++++---
2 files changed, 6 insertions(+), 10 deletions(-)
--
1.8.3.1
More information about the Devel
mailing list