Received: by 10.223.164.221 with SMTP id h29csp1389619wrb; Wed, 1 Nov 2017 15:46:42 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RAS0eJKhrWYK06209hAEQjAyO/fv4SEmJ5JophfjQesoVhb1vMp1kLcTYtcoke+YPNHFMl X-Received: by 10.98.163.196 with SMTP id q65mr1424669pfl.7.1509576402670; Wed, 01 Nov 2017 15:46:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509576402; cv=none; d=google.com; s=arc-20160816; b=Pzx8xm8klMRtfEFU/7Yum8wafwdDMQlij343Sr3q3PRZPj0CwNRM3ww2xy+C9ufXqh zmeOMl+nzTrNVNQuEINXENArWdd23GKvWZ2lQTYvFRB7oaodDnrFwOgahcNoIPOidTuJ rEGJAjVP5oDkr5uDyAP7h8g2jOGyHeFT/IoQGweToTylqkDzt2AX7hcWgrstEiXK3nYR nxLrT/wl7abC6NW03GJYMi7w0WqK0EeIGLZJeGv1daFABDodmIs6/+DfRAQr0dOpdfQR BYEfbjf2XZWIOfNN2P8tH0a0T72d15TXtSuQ4XEtiT399+23rQYk0z7mAYktjjWPRseH bK4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=CVL66/RHQ2fi1zGL4Z9J1co5sptHYlZmjuLaN4nkWOc=; b=OWiyQG5iX4ex8Q/ATwryIOVOCWRHwk8HUOsgO8kLLHvCpaIfriOcxhyhzctIV4uT7F tggdHQ8l14HfFHrV92zefyFCCyILdp1kN8V1ThIEEmVLHkBKcLAW/cL57vVIoDhNbkJU lzfBX6JHdt3RFHVExPvApwUv1jPBunfOrx3Ds/Z6I5OiQ3mHMIujI9j04u6uGB7KkeaL XL5NXKVaNGe07FZJyt7YQleExnzQl4CPTXxcWingMSAk0rOiD0ye+8h3Wbw6R4ah12Yq dAVDOD2aZxdo4I5Ca0JaMGjamAn4E+IgadnPCRF6x2tIZ5LBEPvmUgRltbgBA7stiEDj c2pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YVSwqVPh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si639592pln.566.2017.11.01.15.46.28; Wed, 01 Nov 2017 15:46:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YVSwqVPh; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933510AbdKAWpv (ORCPT + 99 others); Wed, 1 Nov 2017 18:45:51 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:47764 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753175AbdKAWpu (ORCPT ); Wed, 1 Nov 2017 18:45:50 -0400 Received: by mail-io0-f194.google.com with SMTP id h70so9622359ioi.4 for ; Wed, 01 Nov 2017 15:45:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=CVL66/RHQ2fi1zGL4Z9J1co5sptHYlZmjuLaN4nkWOc=; b=YVSwqVPhzo3hEvY49xiExzDEyo8mRfIUVj/rKk6l+sZ7CNmYOlInyanFMo5Nf5J9KR ImmMiKgcjo8Mk+DRxI7iJ9ONrHfN7YQa2GyKRvVZDie/OzPcofmShp8RkgCPsmddWQhh x2PD60czluhGUJG73z1qRj7Oedfdq20uTSBgBn0jvDIOGeRIF5K3JobxOtU/3EHiN+zZ qeuGkoBtDkLc5/1k2AFEIV2oHciyuSJs2kZb9uCAqXjgqBMHgKDcwjlGe2yrA/j+7rnq oaETAWc83UP+nL4tkNXPEX6QLvDn/e5YnSAU56RTOrRNVn24ui227pPNlqLos8r+mO4V 4QMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=CVL66/RHQ2fi1zGL4Z9J1co5sptHYlZmjuLaN4nkWOc=; b=pcTZusHP0dkJ3mOSVeuaCFimDhv3qkiD3KHAusD+NpjPbKNgy9B8X8JwJcPGZgcphs N5j5NqcIl60n/b8VX3eyTv0zZRM/8XcZhDHvKD1j2LtBZ9oRRfg9/Nz4YV2s9ZnuTHqS ueuEscLabI1wPwvggKhZlm9ed6597ymkhY+wCZq3m+Rc3lCFsDdCBxr/m9wQzGIg9AET +ST57AJ3dLdiaaYOO8O6HIeZEL82rchP/eyLkBbuplYzVL/0/qPgQIhAwOyIbvtjK7PG HbTxVqZpdfxFkfptq3bAqlH3MoILpc0EG98lgB0vz3CrwqVfxykwqc0/je6RhcJrS0Eg FNaw== X-Gm-Message-State: AMCzsaWlKAf92TWT/o/pIuv6xyVtopTSqy/qI1WwhDWQfv8w9OIJZEkT kEm6gukQLsrbr7hwNatSVLHDUMpI86vDYMD5SwBDyg== X-Received: by 10.36.115.144 with SMTP id y138mr2706264itb.89.1509576349129; Wed, 01 Nov 2017 15:45:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.82 with HTTP; Wed, 1 Nov 2017 15:45:48 -0700 (PDT) In-Reply-To: References: <20171031223146.6B47C861@viggo.jf.intel.com> <20171031223150.AB41C68F@viggo.jf.intel.com> From: Kees Cook Date: Wed, 1 Nov 2017 15:45:48 -0700 Message-ID: Subject: Re: [PATCH 02/23] x86, kaiser: do not set _PAGE_USER for init_mm page tables To: Thomas Gleixner Cc: Linus Torvalds , Dave Hansen , Andy Lutomirski , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, Daniel Gruss , michael.schwarz@iaik.tugraz.at, Hugh Dickins , X86 ML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 1, 2017 at 3:20 PM, Thomas Gleixner wrote: > On Wed, 1 Nov 2017, Linus Torvalds wrote: >> On Wed, Nov 1, 2017 at 2:52 PM, Dave Hansen wrote: >> > On 11/01/2017 02:28 PM, Thomas Gleixner wrote: >> >> On Wed, 1 Nov 2017, Andy Lutomirski wrote: >> >>> The vsyscall page is _PAGE_USER and lives in init_mm via the fixmap. >> >> >> >> Groan, forgot about that abomination, but still there is no point in having >> >> it marked PAGE_USER in the init_mm at all, kaiser or not. >> > >> > So shouldn't this patch effectively make the vsyscall page unusable? >> > Any idea why that didn't show up in any of the x86 selftests? >> >> I actually think there may be two issues here: >> >> - vsyscall isn't even used much - if any - any more > > Only legacy user space uses it. > >> - the vsyscall emulation works fine without _PAGE_USER, since the >> whole point is that we take a fault on it and then emulate. >> >> We do expose the vsyscall page read-only to user space in the >> emulation case, but I'm not convinced that's even required. > > I don't see a reason why it needs to be mapped at all for emulation. > >> Nobody who configures KAISER enabled would possibly want to have the >> actual native vsyscall page enabled. That would be an insane >> combination. >> >> So the only possibly difference would be a user mode program that >> actually looks at the vsyscall page, which sounds unlikely to be an >> issue. It's legacy and not really used. > > Right, and we can either disable the NATIVE mode when KAISER is on or just > rip the native mode out completely. Most distros have native mode disabled > anyway, so you cannot even enable it on the kernel command line. > > I'm all for ripping it out or at least removing the config switch to enable > native mode as a first step. I would like to see NATIVE removed too. -Kees -- Kees Cook Pixel Security From 1582904002171428677@xxx Wed Nov 01 22:21:32 +0000 2017 X-GM-THRID: 1582814524376334722 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread