From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35148C433E0 for ; Thu, 4 Mar 2021 17:15:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B941F64F57 for ; Thu, 4 Mar 2021 17:15:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B941F64F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=UVscKseKtP8RDMc3LO1pJjRjsLxTCsF7YQfH6AcpZXw=; b=jE6w543et9WEHcib5wonMJSu1g YUUjm0qAYYusc/E9nx5gp2f5qs505T2R8jJ+ugHsYjmjx5GwM/a8F6j64gey302DyjoL3B61gazP+ TnzcbVDWb30YNB9qwp7c7zDxXf4Ne7dLWudmlJ9fXZQN6ZB4Gu6Z0WjYu1b3K+Aq/0MUNKz23OHAN brpeM+uT8tMbqSScwlv0RfJCT1jvsYEl5MAH0my2pNkuY3OA317MyuJ9XSA6oy5hzGL8vuZiGFV9C +IjVrcF+RybjMyduZKCk/nGMkNsqwKiDnoNmfGZR0z9EHMQoeawrs+DeXeLt7ESHpgLCqHSBrvmS3 dqw7LX9g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHrWz-009O5N-5U; Thu, 04 Mar 2021 17:12:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHrWr-009O3Q-Ux for linux-arm-kernel@lists.infradead.org; Thu, 04 Mar 2021 17:12:54 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1892E64F1E; Thu, 4 Mar 2021 17:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614877964; bh=P5q+0y/uM2GBGqJE1hMKQcR+X1pIEr8lvqL+I77Pk/Q=; h=From:To:Cc:Subject:Date:From; b=J6jQkz4QzaXu9CQwQKIsw6vtfk6dXygrGPUSlR7BLUFPiz24t/bmz1bdG7NezLt6u ik1qGrWxZTLFiInVT9BpZM8RzjuW+NiA8hhZQ8pkwF+ARfLGKyLkprOK/SgqVOtzCN 4iA0Qfd+KPOVjiLd4gQC/wDGsH83h5/8JY41bXJNlX4KDUnOXHfLO8LNuk/2CcEERq zHJeZqpHL1XIU5BeYWkKQfVZ8QlP0F11YtAiDiw/tvoXZEOGIiiDcpNlsb858Lhv9f vjnt709R49tjqkN+z9lkJ0YTqJpSiEGAsKgRYDCO/Q2NU6Wkd2bQlEgWauq3435Epl jlMJn0bdgkx1g== From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , maz@kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, anshuman.khandual@arm.com, qperret@google.com, kernel-team@android.com Subject: [PATCH 0/2] arm64: use XN table mappings for the linear region Date: Thu, 4 Mar 2021 18:11:43 +0100 Message-Id: <20210304171145.12281-1-ardb@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch tweaks the kernel page table population code to set the UXNTable and PXNTable bits on all table entries that cover the linear region. This removes the ability for lower level mappings to grant executable permissions which are never needed in the linear region. And given that swapper's PGD level is mapped r/o and can only be updated via the fixmap API, this cannot be trivially reverted by poking writable memory. This does not address a known exploit or vulnerability, but it applies the principle of least privilege in a way that does not result in any space or runtime overhead. Cc: maz@kernel.org Cc: catalin.marinas@arm.com Cc: will@kernel.org Cc: mark.rutland@arm.com Cc: anshuman.khandual@arm.com Cc: qperret@google.com Cc: kernel-team@android.com Ard Biesheuvel (2): arm64: mm: add missing P4D definitions and use them consistently arm64: mm: use XN table mapping attributes for the linear region arch/arm64/include/asm/pgtable-hwdef.h | 12 ++++++++ arch/arm64/mm/mmu.c | 31 ++++++++++++++------ 2 files changed, 34 insertions(+), 9 deletions(-) -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel