From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753952AbdKIT0h (ORCPT ); Thu, 9 Nov 2017 14:26:37 -0500 Received: from mga14.intel.com ([192.55.52.115]:18985 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752622AbdKIT0g (ORCPT ); Thu, 9 Nov 2017 14:26:36 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,370,1505804400"; d="scan'208";a="148027191" Subject: Re: [PATCH 24/30] x86, kaiser: disable native VSYSCALL To: Andy Lutomirski References: <20171108194646.907A1942@viggo.jf.intel.com> <20171108194731.AB5BDA01@viggo.jf.intel.com> Cc: "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, Daniel Gruss , michael.schwarz@iaik.tugraz.at, richard.fellner@student.tugraz.at, Linus Torvalds , Kees Cook , Hugh Dickins , X86 ML From: Dave Hansen Message-ID: <6871f284-b7e9-f843-608f-5345f9d03396@linux.intel.com> Date: Thu, 9 Nov 2017 11:26:34 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/09/2017 11:04 AM, Andy Lutomirski wrote: > On Wed, Nov 8, 2017 at 11:47 AM, Dave Hansen > wrote: >> >> From: Dave Hansen >> >> The VSYSCALL page is mapped by kernel page tables at a kernel address. >> It is troublesome to support with KAISER in place, so disable the >> native case. >> >> Also add some help text about how KAISER might affect the emulation >> case as well. > > Can you re-explain why this is helpful? How about this? The KAISER code attempts to "poison" the user portion of the kernel page tables. It detects the entries pages that it wants that it wants to poison in two ways: * Looking for addresses >= PAGE_OFFSET * Looking for entries without _PAGE_USER set But, to allow the _PAGE_USER check to work, we stopped it from being set on all init_mm entries. The VDSO is at a address >= PAGE_OFFSET and it is also mapped by the init_mm. The fact that we remove _PAGE_USER from the page tables makes it unreadable to userspace. This makes the "NATIVE" case totally unusable since userspace can not even see the memory any more. Disable it whenever KAISER is enabled.