From: Roman Gushchin <guro@fb.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: "Alex Xu (Hello71)" <alex_y_xu@yahoo.ca>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"tj@kernel.org" <tj@kernel.org>, Kernel Team <Kernel-team@fb.com>
Subject: Re: [REGRESSION] ptrace broken from "cgroup: cgroup v2 freezer" (76f969e)
Date: Mon, 13 May 2019 16:54:33 +0000 [thread overview]
Message-ID: <20190513165426.GA10982@tower.DHCP.thefacebook.com> (raw)
In-Reply-To: <20190513163814.GA31756@redhat.com>
On Mon, May 13, 2019 at 06:38:14PM +0200, Oleg Nesterov wrote:
> On 05/13, Oleg Nesterov wrote:
> >
> > Probably we add leave_frozen(true) after freezable_schedule() for now, then
> > think try to make something better...
>
> And again, this is what I thought ptrace_stop() does, somehow I didn't notice
> that the last version doesn't have leave_frozen() in ptrace_stop().
>
> Perhaps we can do a bit better, change only tracehook_report_syscall_entry() and
> PTRACE_EVENT_EXIT/SECCOMP paths to do leave_frozen() ?
>
> At first glance other callers look fine in that they can do nothing "interesting"
> befor get_signal(), but we need to re-check...
Hi Oleg!
Thank you for looking into it!
I've just check the following patch (see below). It solves the regression
and overall seems correct. But I need some more time to check.
Thanks!
--
diff --git a/kernel/signal.c b/kernel/signal.c
index 8607b11ff936..088b377ad439 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -2112,6 +2112,8 @@ static void ptrace_stop(int exit_code, int why, int clear_code, kernel_siginfo_t
preempt_enable_no_resched();
cgroup_enter_frozen();
freezable_schedule();
+ if (info)
+ cgroup_leave_frozen(true);
} else {
/*
* By the time we got the lock, our tracer went away.
next prev parent reply other threads:[~2019-05-13 16:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 1:20 [REGRESSION] ptrace broken from "cgroup: cgroup v2 freezer" (76f969e) Alex Xu (Hello71)
2019-05-13 1:57 ` Valdis Klētnieks
2019-05-13 12:17 ` Oleg Nesterov
2019-05-13 16:38 ` Oleg Nesterov
2019-05-13 16:54 ` Roman Gushchin [this message]
2019-05-13 17:03 ` Roman Gushchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190513165426.GA10982@tower.DHCP.thefacebook.com \
--to=guro@fb.com \
--cc=Kernel-team@fb.com \
--cc=alex_y_xu@yahoo.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).