All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Derek Bruening <bruening@google.com>,
	Kevin Malachowski <chowski@google.com>,
	Alexander Mikhalitsyn <alexander@mihalicyn.com>,
	Florian Weimer <fw@deneb.enyo.de>,
	Carlos O'Donell <carlos@redhat.com>, Paul Turner <pjt@google.com>,
	Simon Marchi <simon.marchi@efficios.com>,
	Peter Oskolkov <posk@posk.io>,
	Chris Kennelly <ckennelly@google.com>,
	Pedro Alves <palves@redhat.com>,
	Bui Quang Minh <minhquangbui99@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>, x86 <x86@kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	Kees Cook <keescook@chromium.org>,
	"Chang S. Bae" <chang.seok.bae@intel.com>,
	Brian Gerst <brgerst@gmail.com>, Andrei Vagin <avagin@gmail.com>,
	Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Subject: Re: [PATCH] rseq: x86: Fix rseq_cs get cleared when returning from signal handler
Date: Tue, 21 Jun 2022 16:05:12 -0400 (EDT)	[thread overview]
Message-ID: <871717002.20576.1655841912053.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <87y1xper17.fsf@email.froward.int.ebiederm.org>

----- On Jun 21, 2022, at 3:48 PM, Eric W. Biederman ebiederm@xmission.com wrote:

> Derek Bruening <bruening@google.com> writes:
> 
>> From the viewpoint of dynamic binary translation/instrumentation and
>> memtrace (go/memtrace), removing those RSEQ_CS_FLAG_NO_RESTART_ON_* flags
>> is a good thing as it reduces complexity and makes it easier to handle rseq
>> (which is painful enough to handle already).
> 
> It sounds like there is consensus.
> 
> Does someone want to code up a simple patch that detects when
> RSEQ_CS_NO_RESTART_ON_SIGNAL and does a WARN_ON_ONCE and fails if
> someone uses so it can be set to Linus in the next merge window.
> 
> After no one screams at that patch it should be safe to remove the
> functionality, because you have empirical proof that no one uses
> that functionality.

Sure, I can whip up something.

I'll send it to Peter Zijlstra shortly.

I plan to, as you suggest, WARN_ON_ONCE() when this happens, and return
an error when the rseq flags or rseq_cs flags contain either of the
RSEQ_CS_FLAG_NO_RESTART_ON_* flags. This error is handled by forcing a
killing the process with sigsegv:

__rseq_handle_notify_resume()
[...]
error:
        sig = ksig ? ksig->sig : 0;
        force_sigsegv(sig);

Does it look acceptable ?

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  parent reply	other threads:[~2022-06-21 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-18 18:25 [PATCH] rseq: x86: Fix rseq_cs get cleared when returning from signal handler Bui Quang Minh
2022-06-20 15:39 ` Mathieu Desnoyers
2022-06-20 15:46   ` Alexander Mikhalitsyn
2022-06-20 18:10     ` Mathieu Desnoyers
2022-06-20 18:36       ` Alexander Mikhalitsyn
     [not found]         ` <CAB=H8NXaMvNU+0Z02VPnLmQde-F8pdw2Ms2SqiOzWtuTcyNjaA@mail.gmail.com>
     [not found]           ` <CAO1ikSbnEbN1-=rY+aOUbjvPS=i9AFJaGBpmbkGR-9UinNKbKw@mail.gmail.com>
     [not found]             ` <87y1xper17.fsf@email.froward.int.ebiederm.org>
2022-06-21 20:05               ` Mathieu Desnoyers [this message]
2022-06-21 21:04                 ` Eric W. Biederman

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=871717002.20576.1655841912053.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=alexander@mihalicyn.com \
    --cc=avagin@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bruening@google.com \
    --cc=bsegall@google.com \
    --cc=carlos@redhat.com \
    --cc=chang.seok.bae@intel.com \
    --cc=chowski@google.com \
    --cc=ckennelly@google.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=ebiederm@xmission.com \
    --cc=fw@deneb.enyo.de \
    --cc=hpa@zytor.com \
    --cc=juri.lelli@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=minhquangbui99@gmail.com \
    --cc=palves@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=posk@posk.io \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=rostedt@goodmis.org \
    --cc=simon.marchi@efficios.com \
    --cc=tglx@linutronix.de \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=x86@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 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.