From: Will Deacon <will.deacon@arm.com>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Boqun Feng <boqun.feng@gmail.com>
Subject: Re: [RFC PATCH] rseq: Avoid infinite recursion when delivering SIGSEGV
Date: Thu, 21 Jun 2018 12:52:40 +0100 [thread overview]
Message-ID: <20180621115240.GE22505@arm.com> (raw)
In-Reply-To: <10453618.15.1529513735208.JavaMail.zimbra@efficios.com>
On Wed, Jun 20, 2018 at 12:55:35PM -0400, Mathieu Desnoyers wrote:
> ----- On Jun 20, 2018, at 12:36 PM, Will Deacon will.deacon@arm.com wrote:
>
> > When delivering a signal to a task that is using rseq, we call into
> > __rseq_handle_notify_resume() so that the registers pushed in the
> > sigframe are updated to reflect the state of the restartable sequence
> > (for example, ensuring that the signal returns to the abort handler if
> > necessary).
> >
> > However, if the rseq management fails due to an unrecoverable fault when
> > accessing userspace or certain combinations of RSEQ_CS_* flags, then we
> > will attempt to deliver a SIGSEGV. This has the potential for infinite
> > recursion if the rseq code continuously fails on signal delivery.
> >
> > Avoid this problem by using force_sigsegv() instead of force_sig(), which
> > is explicitly designed to reset the SEGV handler to SIG_DFL in the case
> > of a recursive fault.
>
> Your approach looks good. One nit below implementation-wise:
Nit accepted :) v2 on its way.
Will
prev parent reply other threads:[~2018-06-21 11:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 16:36 [RFC PATCH] rseq: Avoid infinite recursion when delivering SIGSEGV Will Deacon
2018-06-20 16:55 ` Mathieu Desnoyers
2018-06-21 11:52 ` Will Deacon [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=20180621115240.GE22505@arm.com \
--to=will.deacon@arm.com \
--cc=boqun.feng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.