linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Peter Collingbourne <pcc@google.com>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	Helge Deller <deller@gmx.de>,
	Kevin Brodsky <kevin.brodsky@arm.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Linux API <linux-api@vger.kernel.org>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	Kostya Serebryany <kcc@google.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Andrey Konovalov <andreyknvl@google.com>,
	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>
Subject: Re: [PATCH v17 3/3] arm64: expose FAR_EL1 tag bits in siginfo
Date: Tue, 17 Nov 2020 11:51:56 -0800	[thread overview]
Message-ID: <CAMn1gO4+nrwNGPqtAr6gPg=zMQ+kCH-e1YWqCz1kZgS6kHZXkA@mail.gmail.com> (raw)
In-Reply-To: <87mtzgcdb7.fsf@x220.int.ebiederm.org>

On Tue, Nov 17, 2020 at 5:40 AM Eric W. Biederman <ebiederm@xmission.com> wrote:
>
> Peter Collingbourne <pcc@google.com> writes:
>
> > diff --git a/kernel/signal.c b/kernel/signal.c
> > index 8f34819e80de..16be62e6d341 100644
> > --- a/kernel/signal.c
> > +++ b/kernel/signal.c
> > @@ -1650,6 +1650,15 @@ void force_sigsegv(int sig)
> >       force_sig(SIGSEGV);
> >  }
> >
> > +static void __user *get_si_addr(void __user *addr, unsigned long sig,
> > +                             unsigned long si_code)
> > +{
> > +     if (current->sighand->action[sig - 1].sa.sa_flags & SA_EXPOSE_TAGBITS)
> > +             return addr;
>
> Apologies for not seeing this before but this part of the patch is
> buggy.
>
> It is using current->sighand->action when the destination task may not
> be current.  send_sig_fault and send_sig_mcerr may somewhat legitimately
> be used to send faults to other processes.
>
> Now that I think about it there are interactions with
> PTRACE_GETSIGINFO/PTRACE_SETSIGINFO.
>
> Can we move the masking into get_signal after the ptrace handling?
>
> That way everything in the core of the kernel deals with unmasked
> si_addr values and we only mask the address just before sending it to
> userspace?

Makes sense, done in v18.

Peter

_______________________________________________
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-17 19:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17  3:17 [PATCH v17 0/3] arm64: expose FAR_EL1 tag bits in siginfo Peter Collingbourne
2020-11-17  3:17 ` [PATCH v17 1/3] arch: provide better documentation for the arch-specific SA_* flags Peter Collingbourne
2020-11-17  3:17 ` [PATCH v17 2/3] signal: define the SA_UNSUPPORTED bit in sa_flags Peter Collingbourne
2020-11-17  3:17 ` [PATCH v17 3/3] arm64: expose FAR_EL1 tag bits in siginfo Peter Collingbourne
2020-11-17 13:39   ` Eric W. Biederman
2020-11-17 19:51     ` Peter Collingbourne [this message]
2020-11-17 18:16 ` [PATCH v17 0/3] " Eric W. Biederman
2020-11-17 19:52   ` Peter Collingbourne

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='CAMn1gO4+nrwNGPqtAr6gPg=zMQ+kCH-e1YWqCz1kZgS6kHZXkA@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=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).