From patchwork Wed Oct 9 14:22:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Bruel X-Patchwork-Id: 13828507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB303CEDD9E for ; Wed, 9 Oct 2024 14:26:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: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:List-Owner; bh=p2zU0J8Ozzt2FEFRpgTVYICyFeINndEpbE2yibsv9bg=; b=CBmWjDfskS/zGSHWVeB0dPMUKZ RoxsXJfcfZF1TIpo6iLGV6I9nE8x/jJVeYMltIilQBGqOGM/aL8Zjok+TBimhsolgPME/FHX9P/cX Mg3my930moAYKt6blbaX5uYREzW5IMUu77Pd/ptWiYsN/Ap9HZTzQTrYasFlQ0R+K8xMsE5nK28Sz N7u88zW2xcputHYI8qfaWZ8xLTzzZrdhue3aSTqs+FOiIwI/+A7g/cjWFdw2KUyUPkdFU6OB7JsK1 q+ZRNvgTB1PL1d//YVtUSNYthVowY6NmSWr6y1PVQK5XuM4NXinHvuQVL3hDR/8qoNLWg63Ce6PH4 s3kDaXiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syXdb-00000009Zzq-3Mp1; Wed, 09 Oct 2024 14:26:03 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syXbc-00000009ZiC-2n9Y for linux-arm-kernel@lists.infradead.org; Wed, 09 Oct 2024 14:24:02 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 499C8JMn006254; Wed, 9 Oct 2024 16:23:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=selector1; bh= p2zU0J8Ozzt2FEFRpgTVYICyFeINndEpbE2yibsv9bg=; b=C5mocmDWIyl4eS+2 rWzd7ksodcyUxo7yZWUTAkBqHEnRHnNid8sOZRDYAIUu5ecSzaTooQ7ByYH7SEfZ Xb/F9+Aa2DZU+6cqhgKEYNs3E2b15gH969zHfciHKLOcqy2mlReXMi26OeQ8NAX3 S4tP4l347WNrmMnjnR9Y/S5piRp9hDOtBBKy+rSedPCXDP6ViBUKxaxvtGbujOd8 9VH3wvzW00rwhcx3kVqfa+h/VbxYwS3oHJJaA2kGqdfUVL3U/NnI04ilbgu8GgZr fbdQUMTuDFwgqQECb77+DDyM/uITDeS06/doJIK3k50JyX9A2Cgt9vdEukG833fH GT0MVQ== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 4257n8d5xt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 09 Oct 2024 16:23:52 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id AF0B14004D; Wed, 9 Oct 2024 16:23:15 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node3.st.com [10.75.129.71]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 574E52612A5; Wed, 9 Oct 2024 16:22:41 +0200 (CEST) Received: from localhost (10.129.178.212) by SHFDAG1NODE3.st.com (10.75.129.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.37; Wed, 9 Oct 2024 16:22:41 +0200 From: Christian Bruel To: CC: , , , Subject: [PATCH 1/1] ARM: decompressor: Use Domain Manager Access permissions Date: Wed, 9 Oct 2024 16:22:22 +0200 Message-ID: <20241009142222.1489500-2-christian.bruel@foss.st.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241009142222.1489500-1-christian.bruel@foss.st.com> References: <20241009142222.1489500-1-christian.bruel@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.129.178.212] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE3.st.com (10.75.129.71) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241009_072401_166931_A3872533 X-CRM114-Status: GOOD ( 11.83 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org EL1 exec access with read/write permissions result in a Permission Fault if SCTLR.WXN or SCTLR.UWXN is set by the trusted firmware. Since XN attribute is not checked for domains marked a Manager, change the domain used for kernel relocation. Signed-off-by: Christian Bruel --- arch/arm/boot/compressed/head.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 9f406e9c0ea6..d4ee205f3b9c 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -888,7 +888,7 @@ __armv7_mmu_cache_on: ARM_BE8( orr r0, r0, #1 << 25 ) @ big-endian page tables mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg orrne r0, r0, #1 @ MMU enabled - movne r1, #0xfffffffd @ domain 0 = client + movne r1, #0xffffffff @ domains = Manager bic r6, r6, #1 << 31 @ 32-bit translation system bic r6, r6, #(7 << 0) | (1 << 4) @ use only ttbr0 mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer