mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: "Stephen Röttger" <sroettger@google.com>,
	"Andy Lutomirski" <luto@kernel.org>
Cc: Kees Cook <keescook@chromium.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	the arch/x86 maintainers <x86@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jann Horn <jannh@google.com>
Subject: Re: PKU usage improvements for threads
Date: Wed, 24 Aug 2022 09:28:17 -0700	[thread overview]
Message-ID: <69cfbf60-2583-1bdc-3313-3b1ab72968e0@intel.com> (raw)
In-Reply-To: <CAEAAPHae8Lr3KfqfLpK3w5F3MPFoG4HJLxX3cMgbKpmQ_jp6Og@mail.gmail.com>

On 8/24/22 01:51, Stephen Röttger wrote:
>>> Yeah, that's something for which our defenses are quite weak.  But, it
>>> also calls for a very generic mm/ solution and not something specific at
>>> all to pkeys.
> We were also thinking about if this should be a more generic feature instead of
> being tied to pkeys. I.e. the doc above has an alternative proposal to introduce
> something like a memory seal/unseal syscall.
> I was personally leaning towards using pkeys for this for a few reasons:
> * intuitively it would make sense to me to extend PKEY_DISABLE_ACCESS
>   to also mean disable all changes to the memory, not just the data.

It would make some sense, but we can't do it with the existing
PKEY_DISABLE_ACCESS ABI.  It would surely break existing users if they
couldn't munmap() memory that was PKEY_DISABLE_ACCESS.

But, making it part of the mprotect() ABI wouldn't be the worst thing in
the world.  Since we have a pkey_mprotect(), any mprotect()-based
mechanism could even reuse the existing pkey syscalls.

I do agree with Andy, though, that I'm not quite sure what the attack
model is here.  If an attacker can make arbitrary system calls, surely
protecting one little altstack VMA isn't doing to help much.

  reply	other threads:[~2022-08-24 16:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 20:40 Kees Cook
2022-08-22 21:11 ` Dave Hansen
2022-08-23 11:08   ` Stephen Röttger
2022-08-23 18:12     ` Dave Hansen
2022-08-23 18:24       ` Andy Lutomirski
2022-08-24  8:51         ` Stephen Röttger
2022-08-24 16:28           ` Dave Hansen [this message]
2022-08-24 16:45           ` Andy Lutomirski
2022-08-25 12:30             ` Stephen Röttger
2022-08-25 14:36               ` Dave Hansen
2022-09-02 17:18                 ` Andy Lutomirski
2022-09-03  0:16         ` Fangfei Yang
2022-09-03  0:14       ` Fangfei Yang
2022-09-06  4:34         ` Andy Lutomirski
2022-09-06  5:58           ` Fangfei Yang

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=69cfbf60-2583-1bdc-3313-3b1ab72968e0@intel.com \
    --to=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=jannh@google.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=sroettger@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®