[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191119051003.108253979@linuxfoundation.org>
Date: Tue, 19 Nov 2019 06:19:39 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Oleg Nesterov <oleg@...hat.com>,
Roman Gushchin <guro@...com>, Tejun Heo <tj@...nel.org>,
Bruce Ashfield <bruce.ashfield@...il.com>
Subject: [PATCH 5.3 19/48] cgroup: freezer: call cgroup_enter_frozen() with preemption disabled in ptrace_stop()
From: Oleg Nesterov <oleg@...hat.com>
commit 937c6b27c73e02cd4114f95f5c37ba2c29fadba1 upstream.
ptrace_stop() does preempt_enable_no_resched() to avoid the preemption,
but after that cgroup_enter_frozen() does spin_lock/unlock and this adds
another preemption point.
Reported-and-tested-by: Bruce Ashfield <bruce.ashfield@...il.com>
Fixes: 76f969e8948d ("cgroup: cgroup v2 freezer")
Cc: stable@...r.kernel.org # v5.2+
Signed-off-by: Oleg Nesterov <oleg@...hat.com>
Acked-by: Roman Gushchin <guro@...com>
Signed-off-by: Tejun Heo <tj@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
kernel/signal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2205,8 +2205,8 @@ static void ptrace_stop(int exit_code, i
*/
preempt_disable();
read_unlock(&tasklist_lock);
- preempt_enable_no_resched();
cgroup_enter_frozen();
+ preempt_enable_no_resched();
freezable_schedule();
cgroup_leave_frozen(true);
} else {
Powered by blists - more mailing lists