Received: by 10.223.185.116 with SMTP id b49csp2559486wrg; Thu, 15 Feb 2018 13:38:35 -0800 (PST) X-Google-Smtp-Source: AH8x226tCDNVBc1ZfjZsfIRjtuahJS18726qW+XKDzgWhlZXWTDSbBuU8+6VgeFy3MXZJOAGmGa4 X-Received: by 10.99.95.201 with SMTP id t192mr3362731pgb.313.1518730715829; Thu, 15 Feb 2018 13:38:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518730715; cv=none; d=google.com; s=arc-20160816; b=s6nSI8sPwwyYcGPaEhqAbtAk16aud9eFMvoRBmwJeLMCsIopUkzSHi1kD2YFpH6PGv xKldVeqzgDFErTQi8N7a5Njfi88rVAntels+C19lfLYrkq6l7kUgDh8+xusVhC/MoeIB tXdHqiGIKLbWD9mth2+9RYeEghPRsw8Q1uaN5Tp29pgamP0CV7xFvKl++m/QCRi3N06a ruLFRg9tqDHQA16gHeyT+3kHDzp0NWebUiwjU2rjtedXFEknMweZR8zdxg0hpFGkq5SO 5UlW6ot8+Qa8KET5Qsq7UT76LhDiwMkUpLIPYtjLeTZkrm2A9SYSij7wvG2dsj5DfCWk XQpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=KWIUqBZwpFm0YqwtBaYGTLdOqOZSYflaZpgfkDIX9ag=; b=LEGLjk8V7Hm0alk66L9A3OvlqV8tQxyliaKzjJPTWaas8wFDfY7HRcBFQk1SlT3vKd LZNMaddHJK5OqHg/Nj/78FEF0uWZIkh3DhIVXQKJpRR6Kpujm+g2oHLyBNWwPkAjZhxZ WrH8YgbVxJOhVHSPvIsIf/t015Ec/Hza7nWx7BIyIQaRbmqSdDuPmsxP2Wg/pyTC5zlI pIvJLm2qwualUYR1zF+FcMteRnpQi4p46HohG7iTzCWqIIrYl4/zBCdOexSKKnZFP+kp vWoRgvB16/nd2DwjR6WpGcrZxNNzQzUS5ZGRnILCH8d5EqgHC0/cF2mWSbRGlHWY9n9W 3Q9w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u36si379290pgn.702.2018.02.15.13.38.19; Thu, 15 Feb 2018 13:38:35 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1164432AbeBOPb3 (ORCPT + 99 others); Thu, 15 Feb 2018 10:31:29 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:55668 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164416AbeBOPb0 (ORCPT ); Thu, 15 Feb 2018 10:31:26 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6836ECE3; Thu, 15 Feb 2018 15:31:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rutland , Laura Abbott , Shanker Donthineni , Will Deacon , Ard Biesheuvel Subject: [PATCH 4.14 042/195] [Variant 3/Meltdown] arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0 Date: Thu, 15 Feb 2018 16:15:33 +0100 Message-Id: <20180215151707.852352120@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151705.738773577@linuxfoundation.org> References: <20180215151705.738773577@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon Commit 084eb77cd3a8 upstream. Add a Kconfig entry to control use of the entry trampoline, which allows us to unmap the kernel whilst running in userspace and improve the robustness of KASLR. Reviewed-by: Mark Rutland Tested-by: Laura Abbott Tested-by: Shanker Donthineni Signed-off-by: Will Deacon Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman --- arch/arm64/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -806,6 +806,19 @@ config FORCE_MAX_ZONEORDER However for 4K, we choose a higher default value, 11 as opposed to 10, giving us 4M allocations matching the default size used by generic code. +config UNMAP_KERNEL_AT_EL0 + bool "Unmap kernel when running in userspace (aka \"KAISER\")" + default y + help + Some attacks against KASLR make use of the timing difference between + a permission fault which could arise from a page table entry that is + present in the TLB, and a translation fault which always requires a + page table walk. This option defends against these attacks by unmapping + the kernel whilst running in userspace, therefore forcing translation + faults for all of kernel space. + + If unsure, say Y. + menuconfig ARMV8_DEPRECATED bool "Emulate deprecated/obsolete ARMv8 instructions" depends on COMPAT