From: Will Deacon <will.deacon@arm.com>
To: Dave Martin <Dave.Martin@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Amit Kachhap <amit.kachhap@arm.com>,
linux-arm-kernel@lists.infradead.org,
Kristina Martsenko <kristina.martsenko@arm.com>
Subject: Re: [PATCH v2] arm64: add ptrace regsets for ptrauth key management
Date: Sat, 19 Jan 2019 23:21:29 +0000 [thread overview]
Message-ID: <20190119232128.GB26876@brain-police> (raw)
In-Reply-To: <20190116151254.GA3578@e103592.cambridge.arm.com>
On Wed, Jan 16, 2019 at 03:13:03PM +0000, Dave Martin wrote:
> On Tue, Jan 15, 2019 at 07:32:30PM +0000, Kristina Martsenko wrote:
> > We don't currently have any other separate nested structs in the arm64
> > ptrace userspace interface. Other architectures also seem to only have a
> > few rare instances of this.
> >
> > It seems odd to complicate the userspace interface because of a kernel
> > implementation detail, but if you think it's better I could change the
> > structs to:
> >
> > struct user_pac_key {
> > __u64 lo;
> > __u64 hi;
> > };
> >
> > struct user_pac_address_keys {
> > struct user_pac_key apiakey;
> > struct user_pac_key apibkey;
> > struct user_pac_key apdakey;
> > struct user_pac_key apdbkey;
> > };
> >
> > struct user_pac_generic_keys {
> > struct user_pac_key apgakey;
> > };
>
> I don't have a strong opinion really.
>
> There's another option that occurred to me just now, and that's simply
> to represent each key as a single __uint128_t in the user regset view
> (with the _hi half strictly in the high 64 bits).
>
> This avoids questions about how to represent the halves of the key,
> and prevents userspace from accessing half-keys. How the half-keys
> map to system registers is an architectural quirk that userspace perhaps
> need not care about.
>
> If you like that approach, you could keep the kernel code as-is for now
> and just do the conversion explicitly in the ptrace accessors (as in
> your original patch).
I think that would be worth persuing. We already have __uint128_t types in
our uapi/ headers, so we're not introducing anything new by using them here.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-01-19 23:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-10 19:35 [PATCH v2] arm64: add ptrace regsets for ptrauth key management Kristina Martsenko
2019-01-10 19:41 ` Kristina Martsenko
2019-01-11 13:58 ` Dave Martin
2019-01-15 19:32 ` Kristina Martsenko
2019-01-16 15:13 ` Dave Martin
2019-01-19 23:21 ` Will Deacon [this message]
2019-01-22 19:07 ` Kristina Martsenko
2019-01-22 19:08 ` Kristina Martsenko
2019-01-23 11:23 ` Dave Martin
2019-01-11 13:31 ` Dave Martin
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=20190119232128.GB26876@brain-police \
--to=will.deacon@arm.com \
--cc=Dave.Martin@arm.com \
--cc=amit.kachhap@arm.com \
--cc=catalin.marinas@arm.com \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=mark.rutland@arm.com \
/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