From: "Marko Mäkelä" <marko.makela@mariadb.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Kyle Huey <me@kylehuey.com>,
open list <linux-kernel@vger.kernel.org>,
Jens Axboe <axboe@kernel.dk>,
Peter Zijlstra <peterz@infradead.org>,
Marco Elver <elver@google.com>, Oleg Nesterov <oleg@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Collingbourne <pcc@google.com>,
Alexey Gladkov <legion@kernel.org>,
"Robert O'Callahan" <rocallahan@gmail.com>,
Linux API <linux-api@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Linus Torvalds <torvalds@linux-foundation.org>,
Kees Cook <keescook@chromium.org>
Subject: Re: [PATCH 0/3] signal: requeuing undeliverable signals
Date: Thu, 18 Nov 2021 08:12:24 +0200 [thread overview]
Message-ID: <CAJuX1hyqRzOkYhoVLwUORTOn2ncJxiru8JfM9cpZt8uXigff2g@mail.gmail.com> (raw)
In-Reply-To: <87y25m9154.fsf@email.froward.int.ebiederm.org>
On Wed, Nov 17, 2021 at 6:51 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
>
> Kyle Huey <me@kylehuey.com> writes:
>
> > On Mon, Nov 15, 2021 at 9:31 PM Eric W. Biederman <ebiederm@xmission.com> wrote:
> >>
> >>
> >> Kyle Huey recently reported[1] that rr gets confused if SIGKILL prevents
> >> ptrace_signal from delivering a signal, as the kernel setups up a signal
> >> frame for a signal that rr did not have a chance to observe with ptrace.
> >>
> >> In looking into it I found a couple of bugs and a quality of
> >> implementation issue.
> >>
> >> - The test for signal_group_exit should be inside the for loop in get_signal.
> >> - Signals should be requeued on the same queue they were dequeued from.
> >> - When a fatal signal is pending ptrace_signal should not return another
> >> signal for delivery.
> >>
> >> Kyle Huey has verified[2] an earlier version of this change.
> >>
> >> I have reworked things one more time to completely fix the issues
> >> raised, and to keep the code maintainable long term.
> >>
> >> I have smoke tested this code and combined with a careful review I
> >> expect this code to work fine. Kyle if you can double check that
> >> my last round of changes still works for rr I would appreciate it.
> >
> > This still fixes the race we reported.
>
> >
> > Tested-by: Kyle Huey <khuey@kylehuey.com>
>
> Thank you very much for retesting.
>
> Eric
Thank you, Kyle and Eric, for reporting and fixing the root cause of this race.
Meanwhile, I followed Kyle's suggestion and will disable the crash
handlers in the tracee whenever it is being traced.
Marko
--
Marko Mäkelä, Lead Developer InnoDB
MariaDB Corporation
prev parent reply other threads:[~2021-11-18 6:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 3:41 [PATCH] signal: SIGKILL can cause signal effects to appear at PTRACE_EVENT_EXIT without tracer notification Kyle Huey
2021-11-01 3:41 ` [PATCH 1/2] signal: factor out SIGKILL generation in get_signal Kyle Huey
2021-11-01 3:41 ` [PATCH 2/2] signal: after notifying a ptracer of a signal, recheck for pending SIGKILLs Kyle Huey
2021-11-02 14:08 ` [PATCH] signal: SIGKILL can cause signal effects to appear at PTRACE_EVENT_EXIT without tracer notification Eric W. Biederman
2021-11-02 16:01 ` Kyle Huey
2021-11-02 18:06 ` Eric W. Biederman
2021-11-02 19:09 ` Kyle Huey
2021-11-08 23:58 ` Kyle Huey
2021-11-14 17:19 ` Eric W. Biederman
2021-11-16 5:29 ` [PATCH 0/3] signal: requeuing undeliverable signals Eric W. Biederman
2021-11-16 5:32 ` [PATCH 1/3] signal: In get_signal test for signal_group_exit every time through the loop Eric W. Biederman
2021-11-16 18:23 ` Kees Cook
2021-11-17 16:31 ` Eric W. Biederman
2021-11-16 5:33 ` [PATCH 2/3] signal: Requeue signals in the appropriate queue Eric W. Biederman
2021-11-16 18:30 ` Kees Cook
2021-11-17 16:42 ` Eric W. Biederman
2021-11-16 5:34 ` [PATCH 3/3] signal: Requeue ptrace signals Eric W. Biederman
2021-11-16 18:31 ` Kees Cook
2021-11-17 16:44 ` Eric W. Biederman
2021-11-17 16:24 ` [PATCH 0/3] signal: requeuing undeliverable signals Kyle Huey
2021-11-17 16:51 ` Eric W. Biederman
2021-11-18 6:12 ` Marko Mäkelä [this message]
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=CAJuX1hyqRzOkYhoVLwUORTOn2ncJxiru8JfM9cpZt8uXigff2g@mail.gmail.com \
--to=marko.makela@mariadb.com \
--cc=axboe@kernel.dk \
--cc=ebiederm@xmission.com \
--cc=elver@google.com \
--cc=keescook@chromium.org \
--cc=legion@kernel.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=me@kylehuey.com \
--cc=oleg@redhat.com \
--cc=pcc@google.com \
--cc=peterz@infradead.org \
--cc=rocallahan@gmail.com \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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).