From patchwork Fri Jan 5 13:12:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 123513 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp800113qgn; Fri, 5 Jan 2018 05:12:50 -0800 (PST) X-Google-Smtp-Source: ACJfBovAJtRZv1oBSIhpRaYiwd0nL4KxMGLja4ioNs61TO9jwnwZQjjhjKeLNKYhG6G56pAdhP19 X-Received: by 10.84.211.39 with SMTP id b36mr3128818pli.217.1515157970719; Fri, 05 Jan 2018 05:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515157970; cv=none; d=google.com; s=arc-20160816; b=FcAy9Gis79D0LkSkF3a3w/G+JX21q4qS1q96jw/b4AYXCPQaLmd+jlgRiFmyoPoMEg SPuivD0ms7CvnOQmtkeYF/aEVWm0V43nlyD2q9f4RNG6zhhMUACM7slXDr/cPGTGB1Vf F7Zk0kkNs9l7LVuPNaxYIphJrTU8QPiikg9at7u8DU3nNNf8pQPtH46zaGpx0c7l9zZA 8XHdTiu5qDAjMn2+EHKsuGlqQipd/+a11+pRTf5cvbAyzRJk3MPbAuPpBUSXA5aUZS1a THbDTq+YpfoD/NJ9BnM4bx0vpjjd2mJTkkWRx+IoaUlMpvExqgiFg7PODdpiWvKXLFqx 2u2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=fyr47MyjiLpFN9wd4C3cjBopnAx0Q8tHK0n2/CJh4PE=; b=S5YzlAxzPiBHubv4xUP+781h8CpF/iJQkdR9nKEWhsUjO1tIq0uO+ERw0TIo/1pd9l eNxIngxBuEPXtJVi7uDkFrgxLa1ORcQA2CP/ZS3kTyw1Ll+ujRZjAANP1/+6SjtiZ3mc gNyJkrrUlBlS/pOtoPf9dwHEKrNnBDh0ytcWZAc48JOJw7xDxFn8Bh5UujardNpevZTY BQqxKUfSh7YqbKMU0jkW95A2LUV0OxBxvoXtkXRbqa/cSDxoO6L0nqiMfur/NJISoTfM 8sXoHn6hDzIC5+G3II4FPE7S5WqUcIoKmYeBcLGgoLJUjeiN7SaPZdDjjl2rC6QtuNDe cWcQ== 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 f30si3999185plf.468.2018.01.05.05.12.50; Fri, 05 Jan 2018 05:12:50 -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 S1751932AbeAENMs (ORCPT + 27 others); Fri, 5 Jan 2018 08:12:48 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:44732 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750915AbeAENMn (ORCPT ); Fri, 5 Jan 2018 08:12:43 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C1C2215BE; Fri, 5 Jan 2018 05:12:42 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 901D83F77C; Fri, 5 Jan 2018 05:12:42 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id 07E2F1AE17D1; Fri, 5 Jan 2018 13:12:42 +0000 (GMT) From: Will Deacon To: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, lorenzo.pieralisi@arm.com, christoffer.dall@linaro.org, linux-kernel@vger.kernel.org, labbott@redhat.com, Will Deacon Subject: [PATCH v2 02/11] arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry Date: Fri, 5 Jan 2018 13:12:32 +0000 Message-Id: <1515157961-20963-3-git-send-email-will.deacon@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1515157961-20963-1-git-send-email-will.deacon@arm.com> References: <1515157961-20963-1-git-send-email-will.deacon@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Although CONFIG_UNMAP_KERNEL_AT_EL0 does make KASLR more robust, it's actually more useful as a mitigation against speculation attacks that can leak arbitrary kernel data to userspace through speculation. Reword the Kconfig help message to reflect this, and make the option depend on EXPERT so that it is on by default for the majority of users. Signed-off-by: Will Deacon --- arch/arm64/Kconfig | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) -- 2.1.4 diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 3af1657fcac3..efaaa3a66b95 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -834,15 +834,14 @@ config FORCE_MAX_ZONEORDER 4M allocations matching the default size used by generic code. config UNMAP_KERNEL_AT_EL0 - bool "Unmap kernel when running in userspace (aka \"KAISER\")" + bool "Unmap kernel when running in userspace (aka \"KAISER\")" if EXPERT 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. + Speculation attacks against some high-performance processors can + be used to bypass MMU permission checks and leak kernel data to + userspace. This can be defended against by unmapping the kernel + when running in userspace, mapping it back in on exception entry + via a trampoline page in the vector table. If unsure, say Y.