Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp938644pxb; Thu, 31 Mar 2022 23:38:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygtZV3HeHKplxCVtVu1UbAn/0aiKSjT2L4tX1ZOYaA7QbFZO7QctjF9busJq89Pm6rm5Jo X-Received: by 2002:a17:90a:86c5:b0:1ca:2887:e7f4 with SMTP id y5-20020a17090a86c500b001ca2887e7f4mr5578746pjv.130.1648795137326; Thu, 31 Mar 2022 23:38:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648795137; cv=none; d=google.com; s=arc-20160816; b=YztkdHd0fL2/J7JGyRo5nZSDKI1BAtTV9bc5o6LH5txepps1SH291PKDSAE5NVceaO Nw43byTBwCNMrew1W3hRV0f3N26NkTvp8EB3MuU7YC1JIb0g7WtBAU3QPB2yWGoB9OCv 00OUdx/aFQQLy+ITHB0sE+6Pcn7Ju3zNMPQDOUVtBo2b+itFX/DFGutb6LBqIWWT9HUh az0/bpJOXzL5M/kpiflDmtlybjllk2FfwrUCGh15WAtBIEU4iWbGyjau0CtbnM2OW8Wc PdwTVWK//djQj3P25rWpeuIgsheKpUuswwmMPHGunFN9afKVPkqmSk7Tpkq6vCBPNvMd OusA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=s32JtineurD4W2KRPYVkf+6h2VGWnAs00HH1JQcJYUY=; b=MiWrZApBzwcFSR6eDcrkTHuRKkFlFwnqbwyGRep+uZegd+0iw5DW7Te1+dk3j4Mwu9 CoedHGZKqEHbWQm38mVIJ4SogGBYU0NZKuMO7PQlbVE0D7PFfvAYuIm9uJABsdaNvYsv +5JDj+ET5UcU9gqo33kzZXqyzcOCzv126AzG2Wz4/dwEOkx/LC/3kVBuLveonDBllg+C d/7QhShcPp+KlmuxazU1Zc8SAVZF0H0T47eRDapX7+tjLFdvolpGc//Aayx6g7ESSRag pJdTt0jxEmjC2+wpsyDnOfxnzHS3PzM/wOiPV1tMCXItzvLJnTr0VpZC/sD8X/wB5Ys/ nLWQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 184-20020a6304c1000000b00398700b4862si1596338pge.602.2022.03.31.23.38.43; Thu, 31 Mar 2022 23:38:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236165AbiCaSgu (ORCPT + 99 others); Thu, 31 Mar 2022 14:36:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234932AbiCaSgY (ORCPT ); Thu, 31 Mar 2022 14:36:24 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 52CC01E6E8E; Thu, 31 Mar 2022 11:34:37 -0700 (PDT) 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 2EDE813D5; Thu, 31 Mar 2022 11:34:37 -0700 (PDT) Received: from eglon.cambridge.arm.com (eglon.cambridge.arm.com [10.1.196.218]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 853BF3F718; Thu, 31 Mar 2022 11:34:36 -0700 (PDT) From: James Morse To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: james.morse@arm.com, catalin.marinas@arm.com Subject: [stable:PATCH v4.14.274 09/27] arm64: entry.S: Add ventry overflow sanity checks Date: Thu, 31 Mar 2022 19:33:42 +0100 Message-Id: <20220331183400.73183-10-james.morse@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220331183400.73183-1-james.morse@arm.com> References: <20220331183400.73183-1-james.morse@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit 4330e2c5c04c27bebf89d34e0bc14e6943413067 upstream. Subsequent patches add even more code to the ventry slots. Ensure kernels that overflow a ventry slot don't get built. Reviewed-by: Russell King (Oracle) Reviewed-by: Catalin Marinas Signed-off-by: James Morse --- arch/arm64/kernel/entry.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index c1ffa95c0ad2..81069ad43a5e 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -74,6 +74,7 @@ .macro kernel_ventry, el, label, regsize = 64 .align 7 +.Lventry_start\@: #ifdef CONFIG_UNMAP_KERNEL_AT_EL0 alternative_if ARM64_UNMAP_KERNEL_AT_EL0 .if \el == 0 @@ -131,6 +132,7 @@ alternative_else_nop_endif mrs x0, tpidrro_el0 #endif b el\()\el\()_\label +.org .Lventry_start\@ + 128 // Did we overflow the ventry slot? .endm .macro tramp_alias, dst, sym @@ -1036,6 +1038,7 @@ alternative_insn isb, nop, ARM64_WORKAROUND_QCOM_FALKOR_E1003 add x30, x30, #(1b - tramp_vectors) isb ret +.org 1b + 128 // Did we overflow the ventry slot? .endm .macro tramp_exit, regsize = 64 -- 2.30.2