linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Peter Collingbourne <pcc@google.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Andrey Konovalov <andreyknvl@google.com>,
	Helge Deller <deller@gmx.de>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	Oleg Nesterov <oleg@redhat.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	Kostya Serebryany <kcc@google.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Linux API <linux-api@vger.kernel.org>,
	David Spickett <david.spickett@linaro.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Will Deacon <will@kernel.org>, Dave Martin <Dave.Martin@arm.com>,
	Evgenii Stepanov <eugenis@google.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH v13 8/8] arm64: expose FAR_EL1 tag bits in siginfo
Date: Wed, 4 Nov 2020 10:27:30 -0800	[thread overview]
Message-ID: <CAMn1gO7JzVGyf-1W19=wocMDwg7CDRYjhd2vOmEMUz-287JmEg@mail.gmail.com> (raw)
In-Reply-To: <20201104174549.GG28902@gaia>

On Wed, Nov 4, 2020 at 9:45 AM Catalin Marinas <catalin.marinas@arm.com> wrote:
>
> On Tue, Nov 03, 2020 at 11:16:53AM -0800, Peter Collingbourne wrote:
> > On Tue, Nov 3, 2020 at 10:33 AM Catalin Marinas <catalin.marinas@arm.com> wrote:
> > > That said, I wonder whether we could solve this for MTE without new
> > > fields by always setting the tag in si_addr when si_code is SEGV_MTE*.
> >
> > This wouldn't solve the problem for MTE in the case where there is a
> > non-linear buffer overflow that extends into an unmapped page, in
> > which case we would get a SEGV_MAPERR that we would still need the tag
> > bits for.
>
> What I was thinking of is to only present the tags for SEGV_MTE* faults
> (tag check faults). Is the tag relevant for a SEGV_MAPERR fault?

Yes, because in the case that I mentioned with a non-linear buffer
overflow into an unmapped page, the error reporting mechanism would
still need to know the address tag in order to associate the access
with an allocation.

> > > Alternatively, we could add a prctl() bit to require tagged si_addr.
> >
> > It's an option that we considered but I would be concerned about the
> > compatibility implications of this. In practice, on Android we would
> > always have this bit set, so applications would be exposed to the tag
> > bits in si_addr. If applications have previously relied on the
> > documented behavior that the tag bits are unset, they may get confused
> > by them now being set. It also wouldn't provide a way for the kernel
> > to communicate which tag bits are valid.
>
> It depends what you mean by application. If the MTE enabling and signal
> handling is done from zygote, I suspect the rest of the app won't
> install its own signal handlers, so they can't get confused.

This isn't the case for every Android application. For example, some
applications, such as Chrome, have their own crash reporting mechanism
(Crashpad in Chrome's case) and install their own signal handlers.
Google also offers Firebase Crashlytics for third-party applications
to use. Although the systems that I've mentioned are open source
and/or owned by Google so we could fix them if necessary, there's
nothing stopping apps from using their own third-party crash reporting
systems.

It's also possible for application-supplied language implementations,
such as Mono and Unity, to install their own signal handler to
implement fast null checks. You could also imagine a userspace page
fault handler being implemented this way as an alternative to using
userfaultfd.

> For standard Linux processes and glibc, the feature wouldn't be enabled
> by default even if MTE was turned on (we'd add a new prctl() bit).

Regardless of whether it's Android or not, you might still run into a
situation where one part of the system needs the bits and another gets
confused by them. (This could be something like two libraries sharing
a signal handler with something like Android's libsigchain, or one
process monitoring another's signals via ptrace.) Having this
controlled by a prctl seems like a global solution to a local problem,
which is the sort of thing that should be avoided if possible.

Peter

> Anyway, I'm not saying we should go for this approach, just making sure
> that we explored all the options (sorry, should have read the previous
> 12 series ;)).
>
> --
> Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-11-04 18:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-03  4:09 [PATCH v13 0/8] arm64: expose FAR_EL1 tag bits in siginfo Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 1/8] parisc: Drop parisc special case for __sighandler_t Peter Collingbourne
2020-11-04 16:54   ` Eric W. Biederman
2020-11-04 17:24     ` Catalin Marinas
2020-11-04 17:36       ` Eric W. Biederman
2020-11-04 18:00       ` Dave Martin
2020-11-04 20:46       ` Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 2/8] parisc: start using signal-defs.h Peter Collingbourne
2020-11-04 18:05   ` Eric W. Biederman
2020-11-03  4:09 ` [PATCH v13 3/8] arch: move SA_* definitions to generic headers Peter Collingbourne
2020-11-04 18:47   ` Eric W. Biederman
2020-11-04 20:48     ` Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 4/8] signal: clear non-uapi flag bits when passing/returning sa_flags Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 5/8] signal: define the SA_UNSUPPORTED bit in sa_flags Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 6/8] signal: deduplicate code dealing with common _sigfault fields Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 7/8] signal: define the field siginfo.si_faultflags Peter Collingbourne
2020-11-03 17:53   ` Catalin Marinas
2020-11-03 18:39     ` Peter Collingbourne
2020-11-04 10:57       ` Dave Martin
2020-11-04 18:23       ` Catalin Marinas
2020-11-04 19:57         ` Peter Collingbourne
2020-11-03  4:09 ` [PATCH v13 8/8] arm64: expose FAR_EL1 tag bits in siginfo Peter Collingbourne
2020-11-03 18:33   ` Catalin Marinas
2020-11-03 19:16     ` Peter Collingbourne
2020-11-04 17:45       ` Catalin Marinas
2020-11-04 18:27         ` Peter Collingbourne [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='CAMn1gO7JzVGyf-1W19=wocMDwg7CDRYjhd2vOmEMUz-287JmEg@mail.gmail.com' \
    --to=pcc@google.com \
    --cc=Dave.Martin@arm.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=andreyknvl@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=david.spickett@linaro.org \
    --cc=deller@gmx.de \
    --cc=ebiederm@xmission.com \
    --cc=eugenis@google.com \
    --cc=kcc@google.com \
    --cc=kevin.brodsky@arm.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=oleg@redhat.com \
    --cc=rth@twiddle.net \
    --cc=vincenzo.frascino@arm.com \
    --cc=will@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).