From patchwork Thu Jul 14 16:22:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Morse X-Patchwork-Id: 12918187 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 628FDC433EF for ; Thu, 14 Jul 2022 16:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; 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=tna4mbNHxa7AwObi20xmKB7ug7FOdgCERuD3DJ/aq6g=; b=rsid02lzWAOyfG e8jLejVkLOJe3lsu57C8jw4xKheVbCq98dL1mTFacPweXMUr6GKeQ1DdIYJNK2uBqQRmoGyHuoemj jHDk2+0LQoe1T6fsg9DapMCaVomX22JNJPIFJ3N81S5EyPYENcjgg8qD0m7t3S9w59ihbsFcpi0Zn 8HRwIB71dtMMESFqjmSAE+9xSdZ5XWeF4s1lKwcYFW8qEczltlY6MIZw7AhTGypHn6TU3F3WkFKab 2OkXPHGI3jPN8iHF50oOcVUk5bLmNgWxPgpcrIR/xQJnWoPqVoGR8B9+VZdoGrTduvXGoGFGjIG+7 mLrw7azj0OOz8F+6SzGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC1bv-00GDG7-Dr; Thu, 14 Jul 2022 16:22:43 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oC1br-00GDDf-IK for linux-arm-kernel@lists.infradead.org; Thu, 14 Jul 2022 16:22:41 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C28B71D13; Thu, 14 Jul 2022 09:22:38 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.174]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8B1433F70D; Thu, 14 Jul 2022 09:22:37 -0700 (PDT) From: James Morse To: stable@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Catalin Marinas , James Morse , Sumit Gupta Subject: [stable:PATCH v4.9.323] arm64: entry: Restore tramp_map_kernel ISB Date: Thu, 14 Jul 2022 17:22:25 +0100 Message-Id: <20220714162225.280073-1-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220714_092239_673876_E3A6434E X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. 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 Summit reports that the BHB backports for v4.9 prevent vulnerable platforms from booting when CONFIG_RANDOMIZE_BASE is enabled. This is because the trampoline code takes a translation fault when accessing the data page, because the TTBR write hasn't been completed by an ISB before the access is made. Upstream has a complex erratum workaround for QCOM_FALKOR_E1003 in this area, which removes the ISB when the workaround has been applied. v4.9 lacks this workaround, but should still have the ISB. Restore the barrier. Fixes: aee10c2dd013 ("arm64: entry: Add macro for reading symbol addresses from the trampoline") Reported-by: Sumit Gupta Tested-by: Sumit Gupta Cc: Signed-off-by: James Morse --- This only applies to the v4.9 backport, as v4.14 has the QCOM_FALKOR_E1003 workaround. arch/arm64/kernel/entry.S | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 1f79abb1e5dd..4551c0f35fc4 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -964,6 +964,7 @@ __ni_sys_trace: b . 2: tramp_map_kernel x30 + isb tramp_data_read_var x30, vectors prfm plil1strm, [x30, #(1b - \vector_start)] msr vbar_el1, x30