Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422AbeAESax (ORCPT + 1 other); Fri, 5 Jan 2018 13:30:53 -0500 Received: from mail.skyhub.de ([5.9.137.197]:42130 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbeAESaw (ORCPT ); Fri, 5 Jan 2018 13:30:52 -0500 Date: Fri, 5 Jan 2018 19:30:48 +0100 From: Borislav Petkov To: Andy Lutomirski Cc: X86 ML , LKML , Kees Cook , Peter Zijlstra , Greg Kroah-Hartman Subject: Re: [RFC] selftests/x86: Add test_vsyscall Message-ID: <20180105183048.ywi5cccs4ecggwy3@pd.tnic> References: <17c5ebeb2e00879b0af1a9c32bf37ecdd9b9b31b.1515130397.git.luto@kernel.org> <20180105134025.kzmnydmzrnfdokz7@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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.