Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752546AbeAETWZ (ORCPT + 1 other); Fri, 5 Jan 2018 14:22:25 -0500 Received: from mail-pl0-f46.google.com ([209.85.160.46]:45132 "EHLO mail-pl0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbeAETWX (ORCPT ); Fri, 5 Jan 2018 14:22:23 -0500 X-Google-Smtp-Source: ACJfBotgmucOPGAZw+TQQVJcNQW8AaaptQXIxaYqZhw1eYX1dzHYDH5XtZF38PeNqGssCKnKFaCuHw== Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [RFC] selftests/x86: Add test_vsyscall From: Andy Lutomirski X-Mailer: iPhone Mail (15C153) In-Reply-To: <20180105191000.n2gnkbsyry4kd65z@pd.tnic> Date: Fri, 5 Jan 2018 11:22:21 -0800 Cc: Andy Lutomirski , X86 ML , LKML , Kees Cook , Peter Zijlstra , Greg Kroah-Hartman Content-Transfer-Encoding: 8BIT Message-Id: <08190E47-05B3-4599-A415-DE4276D56B3F@amacapital.net> References: <17c5ebeb2e00879b0af1a9c32bf37ecdd9b9b31b.1515130397.git.luto@kernel.org> <20180105134025.kzmnydmzrnfdokz7@pd.tnic> <20180105183048.ywi5cccs4ecggwy3@pd.tnic> <20180105191000.n2gnkbsyry4kd65z@pd.tnic> To: Borislav Petkov Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: > On Jan 5, 2018, at 11:10 AM, Borislav Petkov wrote: > >> On Fri, Jan 05, 2018 at 10:45:49AM -0800, Andy Lutomirski wrote: >> Not _PAGE_RW. Probably _PAGE_USER somewhere in the hierarchy. > > Yeah, just realized that. But it must be somewhere in the PT hierarchy > because: > > 0xffffffffff600000-0xffffffffff601000 4K USR ro NX pte > > So something up needs to take _PAGE_USER too. > > But WTF does it say NX there for and still can execute the vsyscall > test? Oh boy, what a mess... > It's emulated! We catch the page fault and fake the whole thing :) > -- > Regards/Gruss, > Boris. > > Good mailing practices for 400: avoid top-posting and trim the reply.