Received: by 10.213.65.68 with SMTP id h4csp699563imn; Fri, 6 Apr 2018 07:29:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx49n5YnzayP5HB0cP0mUi4TX54eVYHKPK0ng4ReVZDVdqQSuP5Xhjbo+sHKSDOCBhe5lZp4h X-Received: by 2002:a17:902:209:: with SMTP id 9-v6mr27029414plc.403.1523024973867; Fri, 06 Apr 2018 07:29:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523024973; cv=none; d=google.com; s=arc-20160816; b=DnjpPOTIg1yuC+9DBKrraxwAiWRvixqBJN/C0ZWMgYS/iWAKxgsycqeeTz6B9sVbwk diCs/Om7oOzzffNK6vucTdy3mOOH2cs7lFz8c+K+56ph1m2oQHfmuKDb4o3SWuzs57qS Lbogl6wd9QK5g+D2P7XuHvphaAx7Fi9FR3p8A4vJmWgcuqp+KCTe9v2pVm6Aa4gRU1Mp CTaiBXr40rLBFsYgYfOifAP/h+F9Biv4UJcfyBc+a1ZGw2shlgD0GF8hHmztXZpUWTnu JZMMD/MTyrMW0eV6jC98f1DoChfxGH3g5UbZ9J2cqnfrtZIOc7efU4woMdXx01TGVfsD 5WCg== 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=bN9tnnuH7OKTHCrdTIZqmvjg+eQK12YMi4ScL50iMec=; b=DBn0MvyrOAObcOxzTK5uAfCN87UTYSU4ehHJwglV2FlzjA4cIYs7/fiWsfRhMdhmWR c0OyS3JPKpTHOTp3B19x14LN1+wEpyoZfskq9bxkubLB7YXmwZjZLVlagqdAvKRnF4uc SAYLER8aVlsyB1FXRXYx76oeJmUnEfHXTrolgRQFrseeWOZV5HnbZ3P3riC5x4UTcqJ1 moODzw7cNLs+ohhpnmN+WWs25qoJJkBjTDMoF2pgKpoR966qoHtizk3S5LnRIO8ysmo1 HBZ+ocZ4dJ0vipK2v9Sem5j/cnEqIHj7XaRq1rAp/gpg+Mlc3BMa1gnZrURec0tx4ygr kWnw== 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 b14si7212551pge.252.2018.04.06.07.29.05; Fri, 06 Apr 2018 07:29:33 -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; 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 S1756720AbeDFO16 (ORCPT + 99 others); Fri, 6 Apr 2018 10:27:58 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33010 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932291AbeDFNhl (ORCPT ); Fri, 6 Apr 2018 09:37:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 2CC0DBB6; Fri, 6 Apr 2018 13:37:18 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Mark Rutland , Laura Abbott , Shanker Donthineni , Will Deacon , Greg Hackmann , Alex Shi Subject: [PATCH 4.9 065/102] arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0 Date: Fri, 6 Apr 2018 15:23:46 +0200 Message-Id: <20180406084340.697495344@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180406084331.507038179@linuxfoundation.org> References: <20180406084331.507038179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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.9-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: Alex Shi [v4.9 backport] Signed-off-by: Mark Rutland [v4.9 backport] Tested-by: Will Deacon Tested-by: Greg Hackmann Signed-off-by: Greg Kroah-Hartman --- arch/arm64/Kconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -733,6 +733,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