mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Andy Lutomirski <luto@kernel.org>
Cc: X86 ML <x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [RFC] selftests/x86: Add test_vsyscall
Date: Fri, 5 Jan 2018 19:30:48 +0100	[thread overview]
Message-ID: <20180105183048.ywi5cccs4ecggwy3@pd.tnic> (raw)
In-Reply-To: <CALCETrVp3AaiXcZrxKCw0ABdn5_HjO8Ud0BcapGxABRyB=sFdA@mail.gmail.com>

On Fri, Jan 05, 2018 at 10:01:23AM -0800, Andy Lutomirski wrote:
> Yes.  There are very clever tools like 'pin' that instrument a binary
> by decoding all the instructions it executes and generating an
> instrumented copy.  If that binary calls into the vDSO, the vDSO gets
> decoded and instrumented (which works fine).  If the binary calls into
> the vsyscall page, it still needs to work.  So the vsyscall page
> contains machine code that actually works (even if it's NX) to support
> these tools.  The authors and users of the tools yelled loudly in an
> earlier version of the vsyscall emulation code that didn't support
> this use case.

It rings a bell...

> The root cause here is that 4.4 is KAISER, not KPTI.  The
> kaiser_set_shadow_pgd() function is a steaming pile of shit, and this
> is a known bug in it.

Tell me about it.

We found out last night it breaks EFI too, see:

https://lkml.kernel.org/r/alpine.LRH.2.00.1801051909160.27010@gjva.wvxbf.pm

To put it mildly, this new PTI et al crap will bring us a lot of fun in
the coming year. I tell ya, a year from now we'll be dealing with the
fallout from this.

> I have zero desire to hack up some stupid special case in there. For
> the modern KPTI kernels, I rewrote that function entirely to be much
> simpler and much more correct.
> 
> It should be straightforward to kludge something up, though, but I'm
> not volunteering.

Yeah, I think adding _PAGE_RW into the mix should fix it but I need to
give it a try first.

Thanks for the test!

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

  reply	other threads:[~2018-01-05 18:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-05  5:38 Andy Lutomirski
2018-01-05 12:33 ` Borislav Petkov
2018-01-05 17:53   ` Andy Lutomirski
2018-01-05 18:23     ` Borislav Petkov
2018-01-05 18:47       ` Andy Lutomirski
2018-01-05 19:05         ` Borislav Petkov
2018-01-05 13:40 ` Borislav Petkov
2018-01-05 18:01   ` Andy Lutomirski
2018-01-05 18:30     ` Borislav Petkov [this message]
2018-01-05 18:45       ` Andy Lutomirski
2018-01-05 19:10         ` Borislav Petkov
2018-01-05 19:22           ` Andy Lutomirski
2018-01-05 19:28             ` Borislav Petkov
2018-01-05 20:10               ` Andy Lutomirski
2018-01-09 11:45 ` Naresh Kamboju
2018-01-09 11:51   ` Borislav Petkov
2018-01-09 21:25 ` Shuah Khan
2018-01-09 21:27   ` Andy Lutomirski

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=20180105183048.ywi5cccs4ecggwy3@pd.tnic \
    --to=bp@alien8.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=peterz@infradead.org \
    --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®